Commit c3ff8b48 authored by 张烨's avatar 张烨

merge: merge main repositry

parents bb831ee4 e126925f
......@@ -25,7 +25,6 @@
<div id="app"></div>
<!-- Open Sans Font -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet">
<!-- A lot of magic happens in this file. HtmlWebpackPlugin automatically injects all assets (e.g. bundle.js, main.css) with the correct HTML tags, which is why they are missing in this file. Don't add any assets here! (Check out webpack.dev.babel.js and webpack.prod.babel.js if you want to know more) -->
</body>
......
......@@ -4,10 +4,10 @@ import { matchRoutes, renderRoutes } from 'react-router-config';
import { Link } from 'react-router-dom';
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';
import menuConfig from '../routes/menuConfig';
import logo from '../assets/logo.svg';
import RightContent from '../components/GlobalHeader/RightContent';
// import config from '../routes/config';
// const noMatch = (
// <Result
......@@ -18,6 +18,7 @@ import RightContent from '../components/GlobalHeader/RightContent';
// />
// );
// eslint-disable-next-line no-unused-vars
const defaultFooterDom = (
<DefaultFooter
copyright={`${new Date().getFullYear()} 熊猫智慧水务技术委员会出品`}
......@@ -25,90 +26,9 @@ const defaultFooterDom = (
/>
);
const BasicMenu = [
{
path: '/dbm',
component: 'BasicLayout',
name: '数据库管理',
icon: 'icon-dashboard',
routes: [
{
path: '/dbm/dbInit',
name: '数据库初始化',
},
{
path: '/dbm/dbsm',
name: '数据库标准化管理',
},
],
},
{
path: '/ou',
component: 'BasicLayout',
name: '机构与用户管理',
icon: 'icon-dashboard',
routes: [
{
path: '/ou/orgList',
name: '机构列表',
},
],
},
{
path: '/basicConfig',
component: 'BasicLayout',
name: '基础通用配置',
icon: 'icon-dashboard',
},
{
path: '/web5',
component: 'BasicLayout',
name: 'Web5配置',
icon: 'icon-dashboard',
routes: [
{
path: '/web5/integration',
name: '集成网站',
},
{
path: '/web5/single',
name: '一般网站',
},
],
},
{
path: '/app',
component: 'BasicLayout',
name: '手持系统配置',
icon: 'icon-dashboard',
},
{
path: '/miniPro',
component: 'BasicLayout',
name: '小程序配置',
authority: ['admin', 'user'],
icon: 'icon-dashboard',
},
{
path: '/log',
component: 'BasicLayout',
name: '日志管理',
icon: 'icon-dashboard',
routes: [
{
path: '/log/service',
name: '服务日志',
},
{
path: '/log/login',
name: '登录日志',
},
],
},
];
const userMode = localStorage.getItem('userMode');
if (userMode === 'common') {
BasicMenu.shift();
menuConfig.shift();
}
const BasicLayout = props => {
......@@ -122,7 +42,7 @@ const BasicLayout = props => {
logo={logo}
onCollapse={handleMenuCollapse}
onMenuHeaderClick={() => {}}
footerRender={() => defaultFooterDom}
// footerRender={() => defaultFooterDom}
rightContentRender={() => <RightContent />}
route={
{
......@@ -132,7 +52,7 @@ const BasicLayout = props => {
location={{
pathname,
}}
menuDataRender={() => BasicMenu}
menuDataRender={() => menuConfig}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path) {
return defaultDom;
......
import React,{ useEffect, useState } from 'react';
import { Card, Form, Input, Button, Select, Table, Tag, Space } from 'antd';
import React, { useEffect, useState } from 'react';
import { Card, Form, Input, Button, Select, Table, Tag, Space } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import { connect } from 'react-redux';
import { get, post } from 'services';
const ManagementDataBase = () => {
const [autoCheckList, setAutoCheckList] = useState([])
const [checkList, setCheckList] = useState([])
const [logList, setLogList] = useState([])
//检查数据库表
useEffect( () => {
get(`/Cityinterface/rest/services/OMS.svc/TableCheck`,{
_version:9999,
_dc:new Date().getTime()
}).then(res =>{
console.log(res)
if(res.sucess){
const { list, messageList } = res
//自动检测列表
let arr = list.map((item,index) => {
item.key=index
return item
})
//手动检查列表
let arr2 = messageList.map((item,index) => {
item.key=index
return item
})
console.log(arr)
setAutoCheckList(arr)
setCheckList(arr2)
}
}).catch(err =>{
console.error(err)
})
},[])
//获取数据库升级记录
useEffect( () => {
get(`/Cityinterface/rest/services/OMS.svc/DatabaseStandard_GetLog`,{
_version:9999,
_dc:new Date().getTime()
}).then(res =>{
console.log(res)
if(res){
setLogList(res)
}
}).catch(err =>{
console.error(err)
})
},[])
const handleCheck = () =>{
console.log('check DB')
}
const handleUpdate = () =>{
console.log('updatedb')
}
const autoCheckColumns = [
{
title:'表名称',
dataIndex: 'tableName',
key: 'tableName',
},
{
title:'类型',
dataIndex: 'type',
key: 'type',
},
{
title:'差异比较',
dataIndex: 'message',
key: 'message',
},
];
const checkColumns = [
{
title:'表名称',
dataIndex: 'tableName',
key: 'tableName',
width:200
},
{
title:'类型',
dataIndex: 'type',
key: 'type',
},
{
title:'差异比较',
dataIndex: 'message',
key: 'message',
ellipsis:true,
// width:80
},
];
const logColumns = [
{
title:'登录名',
dataIndex: 'updateBy',
key: 'updateBy',
},
{
title:'数据库名称',
dataIndex: 'name',
key: 'name',
},
{
title:'数据库版本',
dataIndex: 'version',
key: 'version',
},
{
title:'数据库版本',
dataIndex: 'version',
key: 'version',
},
{
title:'升级时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
title:'版本日志',
dataIndex: 'despersion',
key: 'despersion',
},
{
title:'升级内容',
dataIndex: 'content',
key: 'content',
ellipsis:true,
},
]
return (
<>
<PageContainer>
<Card>
<Table columns={ autoCheckColumns } dataSource={autoCheckList} bordered></Table>
<Space>
<Button onClick= {handleCheck}>检查</Button>
<Button onClick= {handleUpdate}>升级</Button>
</Space>
</Card>
<Card>
<Table columns={ checkColumns } dataSource={checkList} bordered></Table>
</Card>
<Card>
<Table columns={ logColumns } dataSource={logList} bordered></Table>
</Card>
</PageContainer>
</>
)
}
export default ManagementDataBase
const [autoCheckList, setAutoCheckList] = useState([]);
const [checkList, setCheckList] = useState([]);
const [logList, setLogList] = useState([]);
// 检查数据库表
useEffect(() => {
get(`/Cityinterface/rest/services/OMS.svc/TableCheck`, {
_version: 9999,
_dc: new Date().getTime(),
})
.then(res => {
console.log(res);
if (res.sucess) {
const { list, messageList } = res;
//自动检测列表
let arr = list.map((item, index) => {
item.key = index;
return item;
});
//手动检查列表
let arr2 = messageList.map((item, index) => {
// eslint-disable-next-line no-param-reassign
item.key = index;
return item;
});
console.log(arr);
setAutoCheckList(arr);
setCheckList(arr2);
}
})
.catch(err => {
console.error(err);
});
}, []);
//获取数据库升级记录
useEffect(() => {
get(`/Cityinterface/rest/services/OMS.svc/DatabaseStandard_GetLog`, {
_version: 9999,
_dc: new Date().getTime(),
})
.then(res => {
console.log(res);
if (res) {
setLogList(res);
}
})
.catch(err => {
console.error(err);
});
}, []);
const handleCheck = () => {
console.log('check DB');
};
const handleUpdate = () => {
console.log('updatedb');
};
const autoCheckColumns = [
{
title: '表名称',
dataIndex: 'tableName',
key: 'tableName',
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
},
{
title: '差异比较',
dataIndex: 'message',
key: 'message',
},
];
const checkColumns = [
{
title: '表名称',
dataIndex: 'tableName',
key: 'tableName',
width: 200,
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
},
{
title: '差异比较',
dataIndex: 'message',
key: 'message',
ellipsis: true,
// width:80
},
];
const logColumns = [
{
title: '登录名',
dataIndex: 'updateBy',
key: 'updateBy',
},
{
title: '数据库名称',
dataIndex: 'name',
key: 'name',
},
{
title: '数据库版本',
dataIndex: 'version',
key: 'version',
},
{
title: '数据库版本',
dataIndex: 'version',
key: 'version',
},
{
title: '升级时间',
dataIndex: 'updateTime',
key: 'updateTime',
},
{
title: '版本日志',
dataIndex: 'despersion',
key: 'despersion',
},
{
title: '升级内容',
dataIndex: 'content',
key: 'content',
ellipsis: true,
},
];
return (
<>
<PageContainer>
<Card>
<Table
columns={autoCheckColumns}
dataSource={autoCheckList}
bordered
/>
<Space>
<Button onClick={handleCheck}>检查</Button>
<Button onClick={handleUpdate}>升级</Button>
</Space>
</Card>
<Card>
<Table columns={checkColumns} dataSource={checkList} bordered />
</Card>
<Card>
<Table columns={logColumns} dataSource={logList} bordered />
</Card>
</PageContainer>
</>
);
};
export default ManagementDataBase;
......@@ -2,9 +2,9 @@ import UserLayout from '../layouts/UserLayout';
import Login from '../pages/user/login';
import BasicLayout from '../layouts/BasicLayout';
import Welcome from '../pages/Welcome';
import RequestTest from '../pages/testPages/request';
import InitDataBase from '../pages/database/InitDataBase';
import ManagementDataBase from '../pages/database/ManagementDataBase';
// import OrgAndUser from '../pages/organization/OrgAndUser';
export default {
routes: [
......@@ -19,17 +19,6 @@ export default {
},
],
},
{
path: '/test',
component: UserLayout,
routes: [
{
name: '接口测试页',
path: '/test/request',
component: RequestTest,
},
],
},
{
path: '/',
component: BasicLayout,
......@@ -45,34 +34,53 @@ export default {
component: ManagementDataBase,
},
{
path: '/ou/orgList',
path: '/userCenter/orgList',
name: '机构列表',
component: Welcome,
},
{
path: '/basicConfig',
name: '基础通用配置',
path: '/platformCenter/gis',
name: 'GIS平台',
component: Welcome,
},
{
path: '/platformCenter/order',
name: '工单平台',
component: Welcome,
},
{
path: '/platformCenter/notify',
name: '消息平台',
component: Welcome,
},
{
path: '/platformCenter/vedio',
name: '视频管理',
component: Welcome,
},
{
path: '/web5/integration',
name: '集成网站',
path: '/platformCenter/emq',
name: '宿主管理',
component: Welcome,
},
{
path: '/web5/single',
name: '一般网站',
path: '/platformCenter/dictionary',
name: '数据字典',
component: Welcome,
},
{
path: '/app',
name: '手持系统配置',
path: '/productCenter/web',
name: 'web配置',
component: Welcome,
},
{
path: '/miniPro',
path: '/productCenter/app',
name: 'app配置',
component: Welcome,
},
{
path: '/productCenter/miniProgram',
name: '小程序配置',
authority: ['admin', 'user'],
component: Welcome,
},
{
......@@ -80,6 +88,26 @@ export default {
name: '日志管理',
component: Welcome,
},
{
path: '/log/service',
name: '服务日志',
component: Welcome,
},
{
path: '/log/login',
name: '登录日志',
component: Welcome,
},
{
path: '/log/omsOperation',
name: '运维操作日志',
component: Welcome,
},
{
path: '/log/omsError',
name: '运维错误日志',
component: Welcome,
},
],
},
],
......
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/orgList',
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/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;
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