Commit 9bf4df9c authored by Maofei94's avatar Maofei94

feat(pages/usercenter/sitemanage): 站点管理

parent 4332da74
...@@ -48,9 +48,9 @@ const BasicLayout = props => { ...@@ -48,9 +48,9 @@ const BasicLayout = props => {
style={{ height: '100vh' }} style={{ height: '100vh' }}
onCollapse={handleMenuCollapse} onCollapse={handleMenuCollapse}
onMenuHeaderClick={() => {}} onMenuHeaderClick={() => {}}
footerRender={() => defaultFooterDom} // footerRender={() => defaultFooterDom}
rightContentRender={() => <RightContent />} rightContentRender={() => <RightContent />}
title="熊猫运维系统" title="熊猫运维平台"
route={ route={
{ {
// routes: config.routes, // routes: config.routes,
......
...@@ -196,6 +196,7 @@ const InitDataBase = props => { ...@@ -196,6 +196,7 @@ const InitDataBase = props => {
}; };
// 点击表格回显到表单 // 点击表格回显到表单
const tableClick = item => { const tableClick = item => {
console.log(item)
let obj = { ...dbForm }; let obj = { ...dbForm };
Object.keys(obj).forEach(k => { Object.keys(obj).forEach(k => {
obj[k] = item[k]; obj[k] = item[k];
......
...@@ -77,6 +77,11 @@ const ManagementDataBase = () => { ...@@ -77,6 +77,11 @@ const ManagementDataBase = () => {
console.log('updatedb'); console.log('updatedb');
}; };
const handleLog = text => { const handleLog = text => {
let arr = []
arr.push(
text.split(/[(\r\n)\r\n]+/).map(item =>{
return (<p>${item}</p>)
}))
setModalVisible(true); setModalVisible(true);
setContent(text); setContent(text);
}; };
...@@ -155,6 +160,7 @@ const ManagementDataBase = () => { ...@@ -155,6 +160,7 @@ const ManagementDataBase = () => {
key: 'content', key: 'content',
ellipsis: true, ellipsis: true,
render: text => { render: text => {
return ( return (
<Button <Button
size='small' size='small'
...@@ -226,8 +232,11 @@ const ManagementDataBase = () => { ...@@ -226,8 +232,11 @@ const ManagementDataBase = () => {
onCancel={() => setModalVisible(false)} onCancel={() => setModalVisible(false)}
width="1000px" width="1000px"
bodyStyle={{ bodyStyle={{
minHeight:'100px' minHeight:'100px',
maxHeight:'600px',
overflowY:'scroll'
}} }}
style={{top:"40px"}}
footer={[ footer={[
<Button type='primary' onClick={() => setModalVisible(false)}>关闭窗口</Button>, <Button type='primary' onClick={() => setModalVisible(false)}>关闭窗口</Button>,
]} ]}
......
...@@ -182,6 +182,11 @@ const DefaultComponent = ()=> { ...@@ -182,6 +182,11 @@ const DefaultComponent = ()=> {
const btnLable = [ const btnLable = [
{label:'查找用户',handle:handleSearch ,config:{ type:'primary',danger:true} }, {label:'查找用户',handle:handleSearch ,config:{ type:'primary',danger:true} },
{label:'用户导入',handle:handleImport,config:{ type:'info',}}, {label:'用户导入',handle:handleImport,config:{ type:'info',}},
<<<<<<< Updated upstream
=======
{label:'新建用户',handle:'newHandle'},
{label:'批量关联',handle:'relHandle'}
>>>>>>> Stashed changes
] ]
return ( return (
...@@ -189,7 +194,11 @@ const DefaultComponent = ()=> { ...@@ -189,7 +194,11 @@ const DefaultComponent = ()=> {
<PageContainer> <PageContainer>
<Card> <Card>
<Row> <Row>
<<<<<<< Updated upstream
<Col span ={1}> <Col span ={1}>
=======
<Col span ={2}>
>>>>>>> Stashed changes
<div style={{height:"30px",lineHeight:"30px"}}> <div style={{height:"30px",lineHeight:"30px"}}>
机构选择 机构选择
</div> </div>
...@@ -211,6 +220,7 @@ const DefaultComponent = ()=> { ...@@ -211,6 +220,7 @@ const DefaultComponent = ()=> {
/> */} /> */}
</Col> </Col>
</Row> </Row>
<<<<<<< Updated upstream
<div style={{marginTop:'20px',textAlign:'center'}}> <div style={{marginTop:'20px',textAlign:'center'}}>
<Space> <Space>
{ {
...@@ -223,6 +233,20 @@ const DefaultComponent = ()=> { ...@@ -223,6 +233,20 @@ const DefaultComponent = ()=> {
} }
</Space> </Space>
</div> </div>
=======
</Card>
<Card>
<Space>
{
btnLable && btnLable.map( (item,index) => {
const { config} =item
return (
<Button key={index} {...config} onClick ={ ()=>{ item.handle && typeof item.handle === 'function' && item.handle()}}>{item.label}</Button>
)
})
}
</Space>
>>>>>>> Stashed changes
<TestModal <TestModal
title='用户选择' title='用户选择'
visible = {modalVisible} visible = {modalVisible}
......
...@@ -3,6 +3,8 @@ import ListCardItem from './listCardItem' ...@@ -3,6 +3,8 @@ import ListCardItem from './listCardItem'
import { get, post } from '../../services'; import { get, post } from '../../services';
import { orgTest} from '../../services/orgnazation/api' import { orgTest} from '../../services/orgnazation/api'
const ListCard = (props) =>{ const ListCard = (props) =>{
const { ouid } = props
console.log(ouid)
const [valueList, setValueList]=useState([]) const [valueList, setValueList]=useState([])
const [testList, setTestList] = useState([]) const [testList, setTestList] = useState([])
const { optionsList} = props const { optionsList} = props
...@@ -19,7 +21,11 @@ const ListCard = (props) =>{ ...@@ -19,7 +21,11 @@ const ListCard = (props) =>{
title:'默认组', title:'默认组',
id:'', id:'',
} }
get("/Cityinterface/rest/services/OMS.svc/U_GetUserListForBatchOper?OUID=24&_version=9999&_dc=1603781551787").then(res =>{ get("/Cityinterface/rest/services/OMS.svc/U_GetUserListForBatchOper",{
OUID:ouid||'',
_version:9999,
_dc:new Date().getTime()
}).then(res =>{
const list = [] const list = []
res && res.map(item =>{ res && res.map(item =>{
list.push({...defaultConfig,...item}) list.push({...defaultConfig,...item})
...@@ -30,7 +36,7 @@ const ListCard = (props) =>{ ...@@ -30,7 +36,7 @@ const ListCard = (props) =>{
orgTest().then(res =>{ orgTest().then(res =>{
console.log(res,'res') console.log(res,'res')
}) })
},[]) },[ouid])
return ( return (
<> <>
{ {
......
import React, { useState, useEffect} from 'react';
import { Row, Col, Tree, Card} from 'antd';
import { DownOutlined } from '@ant-design/icons';
import { PageContainer, GridContent } from '@ant-design/pro-layout';
import { getOUTree} from '@/services/userCenter/siteManage/api';
import ListCard from '@/pages/orgnazation/ListCard';
import styles from '@/pages/userCenter/siteManage/SiteManage.less'
const SiteManage = ()=>{
const [ treeData, setTreeData ] = useState([])
const [ ouid, setOuid ] = useState('')
//点击树的回调
const handleTreeSelect = (e) =>{
console.log(e)
let id = e[0]
setOuid(id)
}
useEffect(()=>{
getOUTree().then(res =>{
let arr = transTree(res)
setTreeData(arr)
})
},[])
const transTree = (val) =>{
let arr = val
return arr.map( item =>{
item.title = item.text
item.key = item.id
let obj = {}
if(Array.isArray(item.children) && item.children.length > 0){
transTree(item.children)
return obj = item
}else{
return item
}
})
}
return (
<PageContainer>
<GridContent>
<Row gutter={12}>
<Col lg={6} md={24}>
<Card className={ styles.cardBox}>
<Tree
showLine
showIcon={<DownOutlined />}
onSelect={(e)=> handleTreeSelect(e)}
treeData={treeData}
/>
</Card>
</Col>
<Col lg={18} md={24}>
<Card className={ styles.cardBox}>
<ListCard ouid={ouid}></ListCard>
</Card>
</Col>
</Row>
</GridContent>
</PageContainer>
)
}
export default SiteManage
.cardBox{
min-height: calc(100vh - 200px);
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ import InitDataBase from '../pages/database/InitDataBase'; ...@@ -18,7 +18,7 @@ import InitDataBase from '../pages/database/InitDataBase';
import ManagementDataBase from '../pages/database/ManagementDataBase'; import ManagementDataBase from '../pages/database/ManagementDataBase';
import UserManage from '../pages/userCenter/UserManage'; import UserManage from '../pages/userCenter/UserManage';
import RoleManage from '../pages/userCenter/RoleManage'; import RoleManage from '../pages/userCenter/RoleManage';
import SiteManage from '../pages/userCenter/SiteManage'; import SiteManage from '../pages/userCenter/siteManage/SiteManage';
// import DefaultComponent from '../pages/orgnazation/DefaultComponent'; // import DefaultComponent from '../pages/orgnazation/DefaultComponent';
import TestTable from '../pages/orgnazation/TestTable'; import TestTable from '../pages/orgnazation/TestTable';
const iconStyle = { verticalAlign: '0.125em' }; const iconStyle = { verticalAlign: '0.125em' };
......
import React from 'react';
import {
DatabaseOutlined,
UsergroupAddOutlined,
SettingOutlined,
HomeOutlined,
// AndroidOutlined,
// CommentOutlined,
CopyOutlined,
} from '@ant-design/icons';
const iconStyle = { verticalAlign: '0.125em' };
const menuConfig = [
{
path: '/dbm',
component: 'BasicLayout',
name: '数据库管理',
icon: <DatabaseOutlined style={iconStyle} />,
routes: [
{
path: '/dbm/dbInit',
name: '数据库初始化',
},
{
path: '/dbm/dbsm',
name: '数据库标准化管理',
},
],
},
{
path: '/userCenter',
component: 'BasicLayout',
name: '用户中心',
icon: <UsergroupAddOutlined style={iconStyle} />,
routes: [
{
path: '/userCenter/UserManage',
name: '用户管理',
},
{
path: '/userCenter/RoleManage',
name: '角色管理',
},
{
path: '/userCenter/SiteManage',
name: '站点管理',
},
{
path: '/userCenter/testTable',
name: '测试表格',
},
],
},
{
path: '/platformCenter',
component: 'BasicLayout',
name: '平台中心',
icon: <SettingOutlined style={iconStyle} />,
routes: [
{
path: '/platformCenter/gis',
name: 'GIS平台',
},
{
path: '/platformCenter/order',
name: '工单平台',
},
{
path: '/platformCenter/notify',
name: '消息平台',
},
{
path: '/platformCenter/iot',
name: '物联平台',
},
{
path: '/platformCenter/vedio',
name: '视频管理',
},
{
path: '/platformCenter/emq',
name: '宿主管理',
},
{
path: '/platformCenter/dictionary',
name: '数据字典',
},
],
},
{
path: '/productCenter',
component: 'BasicLayout',
name: '产品中心',
icon: <HomeOutlined style={iconStyle} />,
routes: [
{
path: '/productCenter/web',
name: 'web配置',
},
{
path: '/productCenter/app',
name: 'app配置',
},
{
path: '/productCenter/miniProgram',
name: '小程序配置',
},
],
},
{
path: '/log',
component: 'BasicLayout',
name: '日志管理',
icon: <CopyOutlined style={iconStyle} />,
routes: [
{
path: '/log/service',
name: '服务日志',
},
{
path: '/log/login',
name: '登录日志',
},
{
path: '/log/omsOperation',
name: '运维操作日志',
},
{
path: '/log/omsError',
name: '运维错误日志',
},
],
},
];
export default menuConfig;
import { get, post } from '@/services/index';
/*
** params
*/
// 获取机构树
export const getOUTree = params =>
get(
'/Cityinterface/rest/services/OMS.svc/U_GetOUTree?_version=9999&node=-1',
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