Commit 124932cc authored by 陈前坚's avatar 陈前坚

perf: 冻结用户和app配置

parent 43cf21aa
This diff is collapsed.
.contentContainer{
// min-height: calc(100vh - 194px);
display: flex;
.menuContainer{
min-width: 300px;
.ant-tree-list{
padding: 10px;
border:1px solid #abaeb1;
height:calc(100vh - 300px);
.ant-tree-switcher{
line-height: 1;
color:#1890FF;
}
}
}
.previewContainer{
margin-left: 12px;
flex: 1;
float: left;
// background: white;
.ant-table-pagination-right{
padding-right: 12px;
}
}
.ant-tree-treenode{
width: 100% !important;
.ant-tree-node-content-wrapper{
display: inline-block;
width: 100%;
}
.iconWraper1{
float: right;
span{
display: none;
}
}
}
.ant-tree-treenode:hover{
.iconWraper1>span{
margin-left: 12px;
font-size: 18px;
display: inline-block;
}
}
}
.redText{
color: red;
cursor: pointer;
}
// .ant-modal-root{
// .ant-tree-switcher{
// line-height: 1;
// color:#1890FF;
// }
// }
// .menuContainer{
// width: 300px;
// padding: 10px;
// background: #1890FF;
// }
\ No newline at end of file
import React from 'react';
import { Tabs } from 'antd';
import { Tabs, Card } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import SevenParams from './SevenParams';
// import AppMenu from './AppMenu';
import AppMenu from './AppMenu';
const AppConfigPage = () => {
const { TabPane } = Tabs;
return (
<PageContainer>
<Tabs defaultActiveKey="1">
<TabPane tab="七参数" key="1">
<SevenParams />
</TabPane>
<TabPane tab="菜单管理" key="2">
{/* <AppMenu /> */}
123
</TabPane>
</Tabs>
<Card>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="应用配置" key="1">
<SevenParams />
</TabPane>
<TabPane tab="菜单管理" key="2" type="card">
<AppMenu />
</TabPane>
</Tabs>
</Card>
</PageContainer>
);
};
......
......@@ -76,6 +76,7 @@ const UserManage = () => {
const [deleteUserVisible, setDeleteUserVisible] = useState(false);
const [orgTitle, setOrgTitle] = useState('机构');
const [tableTitle, setTableTitle] = useState('机构');
const [orgID, setOrgID] = useState();
const [newOrgID, setNewOrgID] = useState();
const [currentUser, setCurrentUser] = useState({});
......@@ -118,6 +119,12 @@ const UserManage = () => {
key: 'userName',
width: 100,
},
{
title: '所在机构',
dataIndex: 'OUName',
key: 'OUName',
width: 150,
},
{
title: '手机号码',
dataIndex: 'phone',
......@@ -141,7 +148,7 @@ const UserManage = () => {
title: '操作',
key: 'action',
fixed: 'right',
width: 300,
width: 250,
align: 'center',
render: (text, record) => (
<Space size="middle">
......@@ -169,12 +176,27 @@ const UserManage = () => {
style={{ fontSize: '16px' }}
/>
</Tooltip>
<Tooltip title="冻结用户">
<StopOutlined
onClick={() => freezeUser(record)}
style={{ fontSize: '16px', color: '#1890FF' }}
/>
</Tooltip>
{(record.state === '0' || record.state === null) && (
<>
<Tooltip title="冻结用户">
<StopOutlined
onClick={() => freezeUser(record)}
style={{ fontSize: '16px', color: '#1890FF' }}
/>
</Tooltip>
</>
)}
{record.state === '1' && (
<>
<Tooltip title="解冻用户">
<StopOutlined
onClick={() => freezeUser(record)}
style={{ fontSize: '16px' }}
/>
</Tooltip>
</>
)}
<Tooltip title="删除用户">
<DeleteTwoTone
onClick={() => deleteUser(record)}
......@@ -289,6 +311,7 @@ const UserManage = () => {
// 获取用户机构树
useEffect(() => {
setTreeLoading(true);
updateTrees();
}, []);
......@@ -303,9 +326,12 @@ const UserManage = () => {
setOrgID(props[0] || currentSelectOrg);
getOneOUUserListNew(props[0] || currentSelectOrg)
.then(res => {
if (res.success) {
if (res.IsSuccess) {
setTableLoading(false);
const table = res.root.map((item, index) => {
const temp = flatten(getUsers(res.Data));
console.log(temp);
setTableTitle(temp.length);
const table = temp.map((item, index) => {
item.key = index;
item.phone = item.phone || '-';
item.ddid = item.ddid ? '已绑定' : '未绑定';
......@@ -320,7 +346,25 @@ const UserManage = () => {
message.error(err);
});
};
// 返回数据结构处理,扁平化
const getUsers = orgObj => {
let result = orgObj.Users;
result.map(item => {
item.OUID = orgObj.GroupId;
item.OUName = orgObj.GroupName;
return item;
});
if (orgObj.Childs.length > 0)
result = [...result, ...orgObj.Childs.map(o => getUsers(o))];
return result;
};
const flatten = arr => {
while (arr.some(item => Array.isArray(item))) {
arr = [].concat(...arr);
}
return arr;
};
const getTableTitle = () => `当前机构用户总数( ${tableTitle} )`;
// 左侧目录树相关操作
const searchUser = () => {
setSearchUserVisible(true);
......@@ -586,7 +630,7 @@ const UserManage = () => {
});
};
const submitChangeOrg = () =>
addToOrg(currentUser.userID, orgID, newOrgID)
addToOrg(currentUser.userID, currentUser.OUID, newOrgID)
.then(res => {
if (res.success) {
setChangeOrgVisible(false);
......@@ -658,7 +702,13 @@ const UserManage = () => {
message.error(err);
});
const submitFreezeUser = () => {
postSetUserState(currentUser.userID, +!currentUser.state)
let state = '';
if (currentUser.state === '0') {
state = '1';
} else {
state = '0';
}
postSetUserState(currentUser.userID, state)
.then(res => {
if (res.success) {
setFreezeUserVisible(false);
......@@ -746,6 +796,7 @@ const UserManage = () => {
</div>
<div className={styles.userContainer}>
<Table
title={getTableTitle}
bordered
columns={columns}
dataSource={tableData}
......@@ -1008,7 +1059,7 @@ const UserManage = () => {
</Form>
</Modal>
<Modal
title="请确认冻结用户"
title="请确认"
visible={freezeUserVisible}
onOk={submitFreezeUser}
onCancel={() => setFreezeUserVisible(false)}
......
import { get, post } from '@/services/index';
/** ***网站配置*** */
// 七参数初始化
export const getSevenParams = () =>
get(`/Cityinterface/rest/services/OMS.svc/M_GetSevenParams`, {
......@@ -19,3 +20,45 @@ export const postSevenParams = sevenFormData =>
`/Cityinterface/rest/services/OMS.svc/M_SetSevenParams?_version=9999`,
sevenFormData,
);
/** ***菜单管理*** */
// 获取菜单树
export const getTree = () =>
get(`/Cityinterface/rest/services/OMS.svc/MiniAppSiteTree`, {
_version: 9999,
_dc: new Date().getTime(),
node: -2,
userMode: 'super',
// subSystemValue: '手持系统',
// subSystemName: '手持系统',
select: '',
});
// 添加菜单
export const addMenuApi = (
menuID,
menuName,
shortName,
imageUrl,
pageUrl,
funParam,
) =>
get(`/Cityinterface/rest/services/OMS.svc/MiniApp_AddMenu`, {
_version: 9999,
_dc: new Date().getTime(),
parentID: menuID,
menuName,
shortName,
imageUrl,
pageUrl,
funParam,
subSystemValue: 'miniapp',
relatedRoleList: '',
});
// 添加菜单
export const getRoleList = () =>
get(`/Cityinterface/rest/services/OMS.svc/P_GetRoleListPlain`, {
_version: 9999,
_dc: new Date().getTime(),
subSystemValue: 'miniapp',
});
import { get, post } from '@/services/index';
// import { get, post } from '@/services/index';
import qs from 'qs';
import { CITY_SERVICE, get, post, PUBLISH_SERVICE } from '@/services/index';
export const getUserTree = (selectOU, node) =>
get(`/Cityinterface/rest/services/OMS.svc/U_GetOUTree`, {
......@@ -9,11 +10,18 @@ export const getUserTree = (selectOU, node) =>
node,
});
// export const getOneOUUserListNew = OUID =>
// get(`/Cityinterface/rest/services/OMS.svc/U_GetOneOUUserListNew`, {
// _version: 9999,
// _dc: new Date().getTime(),
// OUID,
// });
export const getOneOUUserListNew = OUID =>
get(`/Cityinterface/rest/services/OMS.svc/U_GetOneOUUserListNew`, {
get(`${PUBLISH_SERVICE}/UserCenter/GroupUserList`, {
_version: 9999,
_dc: new Date().getTime(),
OUID,
GroupId: OUID,
});
/**
......
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