Commit 9bf4df9c authored by Maofei94's avatar Maofei94

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

parent 4332da74
......@@ -48,9 +48,9 @@ const BasicLayout = props => {
style={{ height: '100vh' }}
onCollapse={handleMenuCollapse}
onMenuHeaderClick={() => {}}
footerRender={() => defaultFooterDom}
// footerRender={() => defaultFooterDom}
rightContentRender={() => <RightContent />}
title="熊猫运维系统"
title="熊猫运维平台"
route={
{
// routes: config.routes,
......
......@@ -196,6 +196,7 @@ const InitDataBase = props => {
};
// 点击表格回显到表单
const tableClick = item => {
console.log(item)
let obj = { ...dbForm };
Object.keys(obj).forEach(k => {
obj[k] = item[k];
......
......@@ -77,6 +77,11 @@ const ManagementDataBase = () => {
console.log('updatedb');
};
const handleLog = text => {
let arr = []
arr.push(
text.split(/[(\r\n)\r\n]+/).map(item =>{
return (<p>${item}</p>)
}))
setModalVisible(true);
setContent(text);
};
......@@ -155,6 +160,7 @@ const ManagementDataBase = () => {
key: 'content',
ellipsis: true,
render: text => {
return (
<Button
size='small'
......@@ -226,8 +232,11 @@ const ManagementDataBase = () => {
onCancel={() => setModalVisible(false)}
width="1000px"
bodyStyle={{
minHeight:'100px'
minHeight:'100px',
maxHeight:'600px',
overflowY:'scroll'
}}
style={{top:"40px"}}
footer={[
<Button type='primary' onClick={() => setModalVisible(false)}>关闭窗口</Button>,
]}
......
......@@ -182,6 +182,11 @@ const DefaultComponent = ()=> {
const btnLable = [
{label:'查找用户',handle:handleSearch ,config:{ type:'primary',danger:true} },
{label:'用户导入',handle:handleImport,config:{ type:'info',}},
<<<<<<< Updated upstream
=======
{label:'新建用户',handle:'newHandle'},
{label:'批量关联',handle:'relHandle'}
>>>>>>> Stashed changes
]
return (
......@@ -189,7 +194,11 @@ const DefaultComponent = ()=> {
<PageContainer>
<Card>
<Row>
<<<<<<< Updated upstream
<Col span ={1}>
=======
<Col span ={2}>
>>>>>>> Stashed changes
<div style={{height:"30px",lineHeight:"30px"}}>
机构选择
</div>
......@@ -211,6 +220,7 @@ const DefaultComponent = ()=> {
/> */}
</Col>
</Row>
<<<<<<< Updated upstream
<div style={{marginTop:'20px',textAlign:'center'}}>
<Space>
{
......@@ -223,6 +233,20 @@ const DefaultComponent = ()=> {
}
</Space>
</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
title='用户选择'
visible = {modalVisible}
......
......@@ -3,6 +3,8 @@ import ListCardItem from './listCardItem'
import { get, post } from '../../services';
import { orgTest} from '../../services/orgnazation/api'
const ListCard = (props) =>{
const { ouid } = props
console.log(ouid)
const [valueList, setValueList]=useState([])
const [testList, setTestList] = useState([])
const { optionsList} = props
......@@ -19,7 +21,11 @@ const ListCard = (props) =>{
title:'默认组',
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 = []
res && res.map(item =>{
list.push({...defaultConfig,...item})
......@@ -30,7 +36,7 @@ const ListCard = (props) =>{
orgTest().then(res =>{
console.log(res,'res')
})
},[])
},[ouid])
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';
import ManagementDataBase from '../pages/database/ManagementDataBase';
import UserManage from '../pages/userCenter/UserManage';
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 TestTable from '../pages/orgnazation/TestTable';
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