Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
bb831ee4
Commit
bb831ee4
authored
Oct 23, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: fix lint
parent
7e3bce54
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
212 deletions
+194
-212
AuthorizedRoute.js
src/components/Authorized/AuthorizedRoute.js
+2
-1
PromiseRender.js
src/components/Authorized/PromiseRender.js
+1
-1
BasicLayout.js
src/layouts/BasicLayout.js
+4
-25
UserLayout.js
src/layouts/UserLayout.js
+1
-1
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+181
-182
config.js
src/routes/config.js
+5
-2
No files found.
src/components/Authorized/AuthorizedRoute.js
View file @
bb831ee4
import
React
from
'react'
;
//
import React from 'react';
const
AuthorizedRoute
=
({
const
AuthorizedRoute
=
({
component
,
component
,
render
,
render
,
authority
,
authority
,
redirectPath
,
redirectPath
,
// eslint-disable-next-line no-unused-vars
...
rest
...
rest
})
=>
{};
})
=>
{};
...
...
src/components/Authorized/PromiseRender.js
View file @
bb831ee4
...
@@ -24,7 +24,7 @@ export default class PromiseRender extends React.Component {
...
@@ -24,7 +24,7 @@ export default class PromiseRender extends React.Component {
}
}
setRenderComponent
(
props
)
{
setRenderComponent
(
props
)
{
const
o
n
=
this
.
checkIsInstantiation
(
props
.
ok
);
const
o
k
=
this
.
checkIsInstantiation
(
props
.
ok
);
const
error
=
this
.
checkIsInstantiation
(
props
.
error
);
const
error
=
this
.
checkIsInstantiation
(
props
.
error
);
props
.
promise
props
.
promise
.
then
(()
=>
{
.
then
(()
=>
{
...
...
src/layouts/BasicLayout.js
View file @
bb831ee4
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
axios
from
'axios'
;
import
{
matchRoutes
,
renderRoutes
}
from
'react-router-config'
;
import
{
matchRoutes
,
renderRoutes
}
from
'react-router-config'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
GithubOutlined
}
from
'@ant-design/icons'
;
import
ProLayout
,
{
DefaultFooter
}
from
'@ant-design/pro-layout'
;
import
ProLayout
,
{
DefaultFooter
}
from
'@ant-design/pro-layout'
;
import
logo
from
'../assets/logo.svg'
;
import
logo
from
'../assets/logo.svg'
;
...
@@ -22,27 +20,8 @@ import RightContent from '../components/GlobalHeader/RightContent';
...
@@ -22,27 +20,8 @@ import RightContent from '../components/GlobalHeader/RightContent';
const
defaultFooterDom
=
(
const
defaultFooterDom
=
(
<
DefaultFooter
<
DefaultFooter
copyright
=
{
`
${
new
Date
().
getFullYear
()}
蚂蚁金服体验技术部出品`
}
copyright
=
{
`
${
new
Date
().
getFullYear
()}
熊猫智慧水务技术委员会出品`
}
links
=
{[
links
=
{[]}
{
key
:
'Ant Design Pro'
,
title
:
'Ant Design Pro'
,
href
:
'https://pro.ant.design'
,
blankTarget
:
true
,
},
{
key
:
'github'
,
title
:
<
GithubOutlined
/>
,
href
:
'https://github.com/ant-design/ant-design-pro'
,
blankTarget
:
true
,
},
{
key
:
'Ant Design'
,
title
:
'Ant Design'
,
href
:
'https://ant.design'
,
blankTarget
:
true
,
},
]}
/
>
/
>
);
);
...
@@ -128,7 +107,7 @@ const BasicMenu = [
...
@@ -128,7 +107,7 @@ const BasicMenu = [
},
},
];
];
const
userMode
=
localStorage
.
getItem
(
'userMode'
);
const
userMode
=
localStorage
.
getItem
(
'userMode'
);
if
(
userMode
==
'common'
)
{
if
(
userMode
==
=
'common'
)
{
BasicMenu
.
shift
();
BasicMenu
.
shift
();
}
}
...
...
src/layouts/UserLayout.js
View file @
bb831ee4
...
@@ -21,7 +21,7 @@ const UserLayout = props => {
...
@@ -21,7 +21,7 @@ const UserLayout = props => {
// const { formatMessage } = useIntl();
// const { formatMessage } = useIntl();
const
{
breadcrumb
}
=
getMenuData
(
route
.
routes
);
const
{
breadcrumb
}
=
getMenuData
(
route
.
routes
);
const
title
=
getPageTitle
({
const
title
=
getPageTitle
({
pathname
:
location
.
pathname
,
pathname
:
window
.
location
.
pathname
,
// formatMessage,
// formatMessage,
breadcrumb
,
breadcrumb
,
...
props
,
...
props
,
...
...
src/pages/database/InitDataBase.jsx
View file @
bb831ee4
import
React
,{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
Table
,
Tag
,
Space
}
from
'antd'
;
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
Table
,
Tag
,
Space
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
get
,
post
}
from
'services'
;
import
{
get
,
post
}
from
'services'
;
const
InitDataBase
=
(
props
)
=>
{
const
InitDataBase
=
(
)
=>
{
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
();
const
{
Option
}
=
Select
const
{
Option
}
=
Select
;
const
onFinish
=
(
e
)
=>
{
const
onFinish
=
e
=>
{
console
.
log
(
e
)
console
.
log
(
e
);
}
};
const
[
dbForm
,
setDbForm
]
=
useState
({
const
[
dbForm
,
setDbForm
]
=
useState
({
ip
:
''
,
ip
:
''
,
dbName
:
''
,
dbName
:
''
,
password
:
''
,
password
:
''
,
userName
:
''
,
userName
:
''
,
inUse
:
''
,
inUse
:
''
,
});
const
[
data
,
setData
]
=
useState
([]);
const
url
=
window
.
location
.
host
;
console
.
log
(
window
.
location
.
host
);
useEffect
(()
=>
{
get
(
`/Cityinterface/rest/services/OMS.svc/S_GetConnRecord`
,
{
_version
:
9999
,
dc
:
1603334559186
,
})
})
const
[
data
,
setData
]
=
useState
([])
.
then
(
res
=>
{
const
url
=
window
.
location
.
host
if
(
res
.
length
>
0
)
{
console
.
log
(
window
.
location
.
host
)
let
arr
=
res
.
map
((
item
,
index
)
=>
{
useEffect
(
()
=>
{
item
.
key
=
index
;
get
(
`/Cityinterface/rest/services/OMS.svc/S_GetConnRecord`
,{
return
item
;
_version
:
9999
,
});
dc
:
1603334559186
setData
(
arr
);
}).
then
(
res
=>
{
}
if
(
res
.
length
>
0
){
})
let
arr
=
res
.
map
(
(
item
,
index
)
=>
{
.
catch
(
err
=>
{
item
.
key
=
index
console
.
error
(
err
);
return
item
});
})
},
[]);
setData
(
arr
)
useEffect
(()
=>
{
}
get
(
`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`
,
{
}).
catch
(
err
=>
{
_version
:
9999
,
console
.
error
(
err
)
dc
:
1603334559186
,
})
})
},[])
.
then
(
res
=>
{
useEffect
(
()
=>
{
// console.log(res);
get
(
`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`
,{
if
(
res
.
success
)
{
_version
:
9999
,
const
obj
=
{};
dc
:
1603334559186
for
(
const
k
in
dbForm
)
{
}).
then
(
res
=>
{
obj
[
k
]
=
res
[
k
];
console
.
log
(
res
)
}
if
(
res
.
success
){
form
.
setFieldsValue
(
obj
);
let
obj
=
{}
setDbForm
(
obj
);
for
(
let
k
in
dbForm
){
}
obj
[
k
]
=
res
[
k
]
})
}
.
catch
(
err
=>
{
form
.
setFieldsValue
(
obj
)
console
.
error
(
err
);
setDbForm
(
obj
)
});
}
},
[]);
}).
catch
(
err
=>
{
const
testChlick
=
()
=>
{};
console
.
error
(
err
)
const
onValuesChange
=
e
=>
{
})
form
.
setFieldsValue
(
e
);
},[])
};
const
testChlick
=
()
=>
{
const
onChange
=
e
=>
{
}
console
.
log
(
e
);
const
onValuesChange
=
(
e
)
=>
{
form
.
setFieldsValue
({
form
.
setFieldsValue
(
e
)
dbName
:
e
,
}
});
const
onChange
=
(
e
)
=>
{
};
console
.
log
(
e
)
const
onCheck
=
e
=>
{
form
.
setFieldsValue
({
console
.
log
(
dbForm
);
dbName
:
e
console
.
log
(
form
.
getFieldValue
());
})
};
}
const
option
=
[
const
onCheck
=
(
e
)
=>
{
{
console
.
log
(
dbForm
)
value
:
'jack'
,
console
.
log
(
form
.
getFieldValue
())
},
}
{
const
option
=
[
value
:
'jack1'
,
{
},
value
:
'jack'
,
{
value
:
'jack2'
,
},
},
{
];
value
:
'jack1'
,
const
columns
=
[
{
},
title
:
'服务器名或IP地址'
,
{
dataIndex
:
'ip'
,
value
:
'jack2'
,
key
:
'ip'
,
},
},
]
{
const
columns
=
[
title
:
'数据库名称'
,
{
dataIndex
:
'dbName'
,
title
:
'服务器名或IP地址'
,
key
:
'dbName'
,
dataIndex
:
'ip'
,
},
key
:
'ip'
,
{
},
title
:
'数据库用户名称'
,
{
dataIndex
:
'userName'
,
title
:
'数据库名称'
,
key
:
'userName'
,
dataIndex
:
'dbName'
,
},
key
:
'dbName'
,
{
},
title
:
'保存时间'
,
{
dataIndex
:
'saveTime'
,
title
:
'数据库用户名称'
,
key
:
'saveTime'
,
dataIndex
:
'userName'
,
},
key
:
'userName'
,
{
},
title
:
'描述'
,
{
dataIndex
:
'desc'
,
title
:
'保存时间'
,
key
:
'desc'
,
dataIndex
:
'saveTime'
,
},
key
:
'saveTime'
,
{
},
title
:
'修改描述'
,
{
dataIndex
:
'name'
,
title
:
'描述'
,
key
:
'name'
,
dataIndex
:
'desc'
,
render
:
()
=>
{
key
:
'desc'
,
return
<
button
>
修改描述
</
button
>;
},
},
{
},
title
:
'修改描述'
,
{
dataIndex
:
'name'
,
title
:
'删除'
,
key
:
'name'
,
dataIndex
:
'name'
,
render
:
()
=>
{
key
:
'name'
,
return
(
render
:
()
=>
{
<
button
>
修改描述
</
button
>
return
<
button
>
删除
</
button
>;
)
},
}
},
},
];
{
return
(
title
:
'删除'
,
<>
dataIndex
:
'name'
,
<
PageContainer
>
key
:
'name'
,
<
Card
>
render
:
()
=>
{
<
Form
return
(
layout=
"horizontal"
<
button
>
删除
</
button
>
labelAlign=
"left"
)
labelCol=
{
{
span
:
3
}
}
}
form=
{
form
}
},
onFinish=
{
onFinish
}
]
onValuesChange=
{
onValuesChange
}
return
(
>
<>
<
Form
.
Item
label=
"服务器名或IP地址:"
name=
"ip"
>
<
PageContainer
>
<
Input
placeholder=
"请输入"
/>
<
Card
>
</
Form
.
Item
>
<
Form
<
Form
.
Item
label=
"数据库用户名称:"
name=
"userName"
>
layout=
"horizontal"
<
Input
placeholder=
"请输入"
/>
labelAlign=
'left'
</
Form
.
Item
>
labelCol=
{
{
span
:
3
}
}
<
Form
.
Item
label=
"数据库用户密码:"
name=
"password"
>
form=
{
form
}
<
Input
placeholder=
"请输入"
/>
onFinish=
{
onFinish
}
</
Form
.
Item
>
onValuesChange=
{
onValuesChange
}
<
Form
.
Item
label=
"数据库名称:"
name=
"dbName"
>
>
<
Select
<
Form
.
Item
label=
"服务器名或IP地址:"
name=
'ip'
>
showSearch
<
Input
placeholder=
"请输入"
/>
placeholder=
"请选择"
</
Form
.
Item
>
optionFilterProp=
"children"
<
Form
.
Item
label=
"数据库用户名称:"
name=
'userName'
>
onChange=
{
onChange
}
<
Input
placeholder=
"请输入"
/>
filterOption=
{
(
input
,
option
)
=>
</
Form
.
Item
>
option
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
<
Form
.
Item
label=
"数据库用户密码:"
name
=
'
password
'
>
0
<
Input
placeholder=
"请输入"
/>
}
</
Form
.
Item
>
>
<
Form
.
Item
label=
"数据库名称:"
name
=
'
dbName
'
>
{
option
.
map
(
item
=>
{
<
Select
return
<
Option
value=
{
item
.
value
}
>
{
item
.
value
}
</
Option
>;
showSearch
})
}
placeholder=
"请选择"
</
Select
>
optionFilterProp=
"children"
</
Form
.
Item
>
onChange=
{
onChange
}
<
Form
.
Item
>
filterOption=
{
(
input
,
option
)
=>
<
Space
size=
"large"
>
option
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
<
Button
onClick=
{
onCheck
}
>
测试连接
</
Button
>
}
<
Button
htmlType=
"submit"
>
保存连接
</
Button
>
>
<
Button
htmlType=
"reset"
onClick=
{
testChlick
}
>
{
option
.
map
(
item
=>
{
数据库初始化
return
(<
Option
value=
{
item
.
value
}
>
{
item
.
value
}
</
Option
>)
</
Button
>
})
}
</
Space
>
</
Select
>
<
span
>
{
dbForm
.
inUse
}
</
span
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
>
{
/* <div className={`btnBox`}>
<
Space
size=
'large'
>
<
Button
onClick=
{
onCheck
}
>
测试连接
</
Button
>
<
Button
htmlType=
'submit'
>
保存连接
</
Button
>
<
Button
htmlType=
'reset'
onClick
=
{
testChlick
}
>
数据库初始化
</
Button
>
</
Space
>
<
span
>
{
dbForm
.
inUse
}
</
span
>
</
Form
.
Item
>
{
/* <div className={`btnBox`}>
<Button onClick={onCheck}>测试连接</Button>
<Button onClick={onCheck}>测试连接</Button>
<Button>保存连接</Button>
<Button>保存连接</Button>
<Button>数据库初始化</Button>
<Button>数据库初始化</Button>
<span>(产品方案(物联GCK))</span>
<span>(产品方案(物联GCK))</span>
</div> */
}
</div> */
}
</
Form
>
</
Form
>
</
Card
>
</
Card
>
<
Card
>
<
Card
>
<
Table
columns=
{
columns
}
dataSource=
{
data
}
bordered
/>
<
Table
columns=
{
columns
}
dataSource=
{
data
}
bordered
/>
</
Card
>
</
Card
>
</
PageContainer
>
</
PageContainer
>
</>
</>
)
);
}
}
;
export
default
connect
()(
InitDataBase
)
export
default
connect
()(
InitDataBase
);
\ No newline at end of file
src/routes/config.js
View file @
bb831ee4
...
@@ -3,6 +3,9 @@ import Login from '../pages/user/login';
...
@@ -3,6 +3,9 @@ import Login from '../pages/user/login';
import
BasicLayout
from
'../layouts/BasicLayout'
;
import
BasicLayout
from
'../layouts/BasicLayout'
;
import
Welcome
from
'../pages/Welcome'
;
import
Welcome
from
'../pages/Welcome'
;
import
RequestTest
from
'../pages/testPages/request'
;
import
RequestTest
from
'../pages/testPages/request'
;
import
InitDataBase
from
'../pages/database/InitDataBase'
;
import
ManagementDataBase
from
'../pages/database/ManagementDataBase'
;
export
default
{
export
default
{
routes
:
[
routes
:
[
{
{
...
@@ -34,12 +37,12 @@ export default {
...
@@ -34,12 +37,12 @@ export default {
{
{
path
:
'/dbm/dbInit'
,
path
:
'/dbm/dbInit'
,
name
:
'数据库初始化'
,
name
:
'数据库初始化'
,
component
:
Welcom
e
,
component
:
InitDataBas
e
,
},
},
{
{
path
:
'/dbm/dbsm'
,
path
:
'/dbm/dbsm'
,
name
:
'数据库标准化管理'
,
name
:
'数据库标准化管理'
,
component
:
Welcom
e
,
component
:
ManagementDataBas
e
,
},
},
{
{
path
:
'/ou/orgList'
,
path
:
'/ou/orgList'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment