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
a372d36a
Commit
a372d36a
authored
Nov 11, 2020
by
张烨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/test/maintenance
parents
a4cbcd3b
d3c28c62
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
371 additions
and
178 deletions
+371
-178
CurrentSolution.jsx
src/pages/database/CurrentSolution.jsx
+7
-6
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+149
-114
ManagementDataBase.jsx
src/pages/database/ManagementDataBase.jsx
+25
-19
SiteConfig.jsx
src/pages/mobileConfig/SiteConfig.jsx
+94
-11
index.js
src/pages/mobileConfig/index.js
+6
-2
AddModal.jsx
src/pages/userCenter/siteManage/AddModal.jsx
+1
-1
SiteManage.jsx
src/pages/userCenter/siteManage/SiteManage.jsx
+51
-4
SiteManage.less
src/pages/userCenter/siteManage/SiteManage.less
+3
-0
config.js
src/routes/config.js
+14
-6
api.js
src/services/database/api.js
+0
-1
api.js
src/services/mobileConfig/api.js
+21
-14
No files found.
src/pages/database/CurrentSolution.jsx
View file @
a372d36a
...
@@ -5,8 +5,8 @@ import { getSolutionList, changeSolution } from '@/services/database/api';
...
@@ -5,8 +5,8 @@ import { getSolutionList, changeSolution } from '@/services/database/api';
import
styles
from
'./CurrentSolution.less'
;
import
styles
from
'./CurrentSolution.less'
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
CurrentSolution
=
()
=>
{
const
CurrentSolution
=
()
=>
{
const
[
currentData
,
setCurrentData
]
=
useState
(
''
);
const
[
currentData
,
setCurrentData
]
=
useState
(
''
);
// 解决方案的值
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
dataList
,
setDataList
]
=
useState
([]);
// 下拉数组
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setLoading
(
true
);
setLoading
(
true
);
...
@@ -26,12 +26,13 @@ const CurrentSolution = () => {
...
@@ -26,12 +26,13 @@ const CurrentSolution = () => {
console
.
error
(
err
);
console
.
error
(
err
);
});
});
},
[]);
},
[]);
// 切换解决方案
const
handleSelect
=
e
=>
{
const
handleSelect
=
e
=>
{
setCurrentData
(
e
);
setCurrentData
(
e
);
};
};
// 提交配置信息
const
submit
=
params
=>
{
const
submit
=
params
=>
{
setLoading
(
true
);
setLoading
(
true
);
console
.
log
(
params
);
changeSolution
({
changeSolution
({
solution
:
currentData
,
solution
:
currentData
,
_version
:
9999
,
_version
:
9999
,
...
@@ -42,14 +43,14 @@ const CurrentSolution = () => {
...
@@ -42,14 +43,14 @@ const CurrentSolution = () => {
if
(
res
.
success
)
{
if
(
res
.
success
)
{
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
description
:
'切换成功'
,
description
:
res
.
message
||
'切换成功'
,
duration
:
3
,
duration
:
3
,
});
});
}
else
{
}
else
{
notification
.
error
({
notification
.
error
({
message
:
'提示'
,
message
:
'提示'
,
description
:
res
.
message
,
description
:
res
.
message
||
'切换失败'
,
duration
:
null
,
duration
:
10
,
});
});
}
}
})
})
...
...
src/pages/database/InitDataBase.jsx
View file @
a372d36a
...
@@ -12,6 +12,7 @@ import {
...
@@ -12,6 +12,7 @@ import {
Row
,
Row
,
Col
,
Col
,
Popconfirm
,
Popconfirm
,
Spin
,
}
from
'antd'
;
}
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'
;
...
@@ -47,9 +48,11 @@ const InitDataBase = props => {
...
@@ -47,9 +48,11 @@ const InitDataBase = props => {
const
[
desc
,
setDesc
]
=
useState
(
''
);
// 修改描述
const
[
desc
,
setDesc
]
=
useState
(
''
);
// 修改描述
const
[
allSqlDir
,
setAllSqulDir
]
=
useState
([]);
// 修改产品方案
const
[
allSqlDir
,
setAllSqulDir
]
=
useState
([]);
// 修改产品方案
const
[
defaultSqlDir
,
setDefaultSqlDir
]
=
useState
(
''
);
// 修改产品方案默认值
const
[
defaultSqlDir
,
setDefaultSqlDir
]
=
useState
(
''
);
// 修改产品方案默认值
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 修改秒速弹窗
const
[
initVisible
,
setInitVisible
]
=
useState
(
false
);
const
[
initVisible
,
setInitVisible
]
=
useState
(
false
);
// 数据库初始化弹窗
const
[
initContent
,
setInitContent
]
=
useState
(
''
);
const
[
initContent
,
setInitContent
]
=
useState
(
''
);
// 数据库初始化内容
const
[
initLoading
,
setInitLoading
]
=
useState
(
false
);
const
[
cardLoading
,
setCardLoading
]
=
useState
(
false
);
// 初始化card Loading
// 获取数据库链接记录
// 获取数据库链接记录
useEffect
(()
=>
{
useEffect
(()
=>
{
setTableLoading
(
true
);
setTableLoading
(
true
);
...
@@ -74,11 +77,13 @@ const InitDataBase = props => {
...
@@ -74,11 +77,13 @@ const InitDataBase = props => {
},
[
upData
]);
},
[
upData
]);
// 获取数据库配置信息
// 获取数据库配置信息
useEffect
(()
=>
{
useEffect
(()
=>
{
setCardLoading
(
true
);
get
(
`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`
,
{
get
(
`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`
,
{
_version
:
9999
,
_version
:
9999
,
dc
:
1603334559186
,
dc
:
1603334559186
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
success
)
{
let
obj
=
{};
let
obj
=
{};
Object
.
keys
(
dbForm
).
forEach
(
k
=>
{
Object
.
keys
(
dbForm
).
forEach
(
k
=>
{
...
@@ -91,47 +96,58 @@ const InitDataBase = props => {
...
@@ -91,47 +96,58 @@ const InitDataBase = props => {
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setCardLoading
(
false
);
console
.
error
(
err
);
console
.
error
(
err
);
});
});
},
[]);
},
[]);
// 数据库初始化
// 数据库初始化
const
initClick
=
()
=>
{
const
initClick
=
()
=>
{
setInitLoading
(
true
);
let
obj
=
form
.
getFieldsValue
();
let
obj
=
form
.
getFieldsValue
();
initDBv4
({
initDBv4
({
_version
:
9999
,
_version
:
9999
,
_dc
:
Date
.
now
(),
_dc
:
Date
.
now
(),
...
obj
,
...
obj
,
}).
then
(
res
=>
{
})
if
(
res
.
GetMe
)
{
.
then
(
res
=>
{
getInitDBLog
({
setInitLoading
(
false
);
_version
:
9999
,
if
(
res
.
GetMe
)
{
_dc
:
Date
.
now
(),
getInitDBLog
({
}).
then
(
res
=>
{
_version
:
9999
,
if
(
res
.
success
)
{
_dc
:
Date
.
now
(),
setInitVisible
(
true
);
}).
then
(
res
=>
{
setInitContent
(
res
.
content
);
if
(
res
.
success
)
{
}
setInitVisible
(
true
);
console
.
log
(
res
.
content
.
split
(
/
[
(
\r\n
)
\r\n]
+/
));
setInitContent
(
res
.
content
);
});
}
}
else
{
console
.
log
(
res
.
content
.
split
(
/
[
(
\r\n
)
\r\n]
+/
));
notification
.
error
({
});
message
:
'提示'
,
}
else
{
duration
:
3
,
notification
.
error
({
description
:
res
.
Say
.
Message
||
'初始化失败'
,
message
:
'提示'
,
});
duration
:
3
,
}
description
:
res
.
Say
.
Message
||
'初始化失败'
,
});
});
}
})
.
catch
(
err
=>
{
setInitLoading
(
false
);
console
.
log
(
err
);
});
};
};
const
onValuesChange
=
(
value
,
b
)
=>
{
const
onValuesChange
=
(
value
,
b
)
=>
{
form
.
setFieldsValue
(
value
);
form
.
setFieldsValue
(
value
);
};
};
const
onChange
=
value
=>
{
const
onChange
=
value
=>
{
console
.
log
(
value
);
const
{
length
}
=
value
;
form
.
setFieldsValue
({
form
.
setFieldsValue
({
dbName
:
value
,
dbName
:
value
[
length
-
1
]
,
});
});
};
};
// 保存连接
// 保存连接
const
onFinish
=
values
=>
{
const
onFinish
=
values
=>
{
setCardLoading
(
true
);
const
obj
=
values
;
const
obj
=
values
;
get
(
'/Cityinterface/rest/services/OMS.svc/S_SaveConnection'
,
{
get
(
'/Cityinterface/rest/services/OMS.svc/S_SaveConnection'
,
{
_version
:
9999
,
_version
:
9999
,
...
@@ -142,6 +158,7 @@ const InitDataBase = props => {
...
@@ -142,6 +158,7 @@ const InitDataBase = props => {
password
:
obj
.
password
,
password
:
obj
.
password
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
GetMe
===
true
)
{
if
(
res
.
GetMe
===
true
)
{
setUpData
(
upData
+
1
);
setUpData
(
upData
+
1
);
notification
.
success
({
notification
.
success
({
...
@@ -158,6 +175,7 @@ const InitDataBase = props => {
...
@@ -158,6 +175,7 @@ const InitDataBase = props => {
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setCardLoading
(
false
);
console
.
log
(
err
);
console
.
log
(
err
);
notification
.
error
({
notification
.
error
({
message
:
'提示'
,
message
:
'提示'
,
...
@@ -166,9 +184,10 @@ const InitDataBase = props => {
...
@@ -166,9 +184,10 @@ const InitDataBase = props => {
});
});
});
});
};
};
// 测试连接
const
onCheck
=
e
=>
{
const
onCheck
=
e
=>
{
// 测试连接
console
.
log
(
dbForm
);
console
.
log
(
dbForm
);
setCardLoading
(
true
);
const
obj
=
form
.
getFieldsValue
();
const
obj
=
form
.
getFieldsValue
();
get
(
'/Cityinterface/rest/services/OMS.svc/S_GetConnectionTest'
,
{
get
(
'/Cityinterface/rest/services/OMS.svc/S_GetConnectionTest'
,
{
_version
:
9999
,
_version
:
9999
,
...
@@ -179,6 +198,7 @@ const InitDataBase = props => {
...
@@ -179,6 +198,7 @@ const InitDataBase = props => {
password
:
obj
.
password
,
password
:
obj
.
password
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
GetMe
===
true
)
{
if
(
res
.
GetMe
===
true
)
{
notification
.
success
({
notification
.
success
({
message
:
'通知'
,
message
:
'通知'
,
...
@@ -194,6 +214,7 @@ const InitDataBase = props => {
...
@@ -194,6 +214,7 @@ const InitDataBase = props => {
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setCardLoading
(
false
);
console
.
log
(
err
);
console
.
log
(
err
);
notification
.
error
({
notification
.
error
({
message
:
'提示'
,
message
:
'提示'
,
...
@@ -390,97 +411,107 @@ const InitDataBase = props => {
...
@@ -390,97 +411,107 @@ const InitDataBase = props => {
<>
<>
<
PageContainer
>
<
PageContainer
>
<
Card
>
<
Card
>
<
div
className=
{
styles
.
tableTitle
}
>
数据库初始化
</
div
>
<
Spin
tip=
"loading..."
spinning=
{
cardLoading
}
>
<
Form
<
div
className=
{
styles
.
tableTitle
}
>
数据库初始化
</
div
>
className=
{
styles
.
mgTop20
}
<
Form
layout=
"horizontal"
className=
{
styles
.
mgTop20
}
labelAlign=
"left"
layout=
"horizontal"
labelCol=
{
{
span
:
3
}
}
labelAlign=
"left"
form=
{
form
}
labelCol=
{
{
span
:
3
}
}
onFinish=
{
onFinish
}
form=
{
form
}
onValuesChange=
{
onValuesChange
}
onFinish=
{
onFinish
}
>
onValuesChange=
{
onValuesChange
}
<
Form
.
Item
label=
{
`${formLables.ip}:`
}
name=
"ip"
>
>
<
Input
placeholder=
"请输入服务器名或IP地址"
/>
<
Form
.
Item
label=
{
`${formLables.ip}:`
}
name=
"ip"
>
</
Form
.
Item
>
<
Input
placeholder=
"请输入服务器名或IP地址"
/>
<
Form
.
Item
label=
{
`${formLables.userName}:`
}
name=
"userName"
>
</
Form
.
Item
>
<
Input
placeholder=
"请输入用户名称"
/>
<
Form
.
Item
label=
{
`${formLables.userName}:`
}
name=
"userName"
>
</
Form
.
Item
>
<
Input
placeholder=
"请输入用户名称"
/>
<
Form
.
Item
label=
{
`${formLables.password}:`
}
name=
"password"
>
</
Form
.
Item
>
<
Input
placeholder=
"请输入用户密码"
/>
<
Form
.
Item
label=
{
`${formLables.password}:`
}
name=
"password"
>
</
Form
.
Item
>
<
Input
placeholder=
"请输入用户密码"
/>
<
Form
.
Item
label=
{
`${formLables.dbName}:`
}
name=
"dbName"
>
</
Form
.
Item
>
<
Select
<
Form
.
Item
label=
{
`${formLables.dbName}:`
}
name=
"dbName"
>
showSearch
<
Select
placeholder=
"请选择数据库"
showSearch
optionFilterProp=
"children"
mode=
"tags"
onFocus=
{
()
=>
{
placeholder=
"请选择数据库"
selectFocus
();
optionFilterProp=
"children"
}
}
onFocus=
{
()
=>
{
onChange=
{
e
=>
{
selectFocus
();
onChange
(
e
);
}
}
}
}
onChange=
{
e
=>
{
// eslint-disable-next-line no-shadow
onChange
(
e
);
filterOption=
{
(
input
,
option
)
=>
}
}
option
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
// eslint-disable-next-line no-shadow
0
filterOption=
{
(
input
,
option
)
=>
{
}
console
.
log
(
option
);
>
return
(
{
option
&&
option
.
children
&&
option
.
length
>
0
&&
option
.
children
option
.
map
((
item
,
index
)
=>
(
.
toLowerCase
()
<
Option
value=
{
item
.
value
}
key=
{
index
}
>
.
indexOf
(
input
.
toLowerCase
())
>=
0
{
item
.
value
}
);
</
Option
>
}
}
))
}
>
</
Select
>
{
option
&&
</
Form
.
Item
>
option
.
length
>
0
&&
<
Form
.
Item
>
option
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
tCenter
}
>
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
+
index
}
>
<
Space
size=
"large"
className=
{
styles
.
btnBox
}
>
{
item
.
value
}
<
Space
>
</
Option
>
<
Button
onClick=
{
onCheck
}
>
测试连接
</
Button
>
))
}
<
Button
</
Select
>
type=
"primary"
</
Form
.
Item
>
htmlType=
"submit"
<
Form
.
Item
>
loading=
{
tableLoading
}
<
div
className=
{
styles
.
tCenter
}
>
>
<
Space
size=
"large"
className=
{
styles
.
btnBox
}
>
保存连接
<
Space
>
</
Button
>
<
Button
onClick=
{
onCheck
}
>
测试连接
</
Button
>
</
Space
>
<
Button
<
Space
>
type=
"primary"
<
Popconfirm
htmlType=
"submit"
title=
"是否执行数据库初始化"
loading=
{
tableLoading
}
okText=
"确认"
>
cancelText=
"取消"
保存连接
onConfirm=
{
()
=>
{
</
Button
>
initClick
();
</
Space
>
}
}
<
Space
>
>
<
Popconfirm
<
Button
type=
"primary"
>
数据库初始化
</
Button
>
title=
"是否执行数据库初始化"
</
Popconfirm
>
okText=
"确认"
{
defaultSqlDir
&&
(
cancelText=
"取消"
<
Select
onConfirm=
{
()
=>
{
placeholder=
"请选择解决方案"
initClick
();
style=
{
{
width
:
'200px'
}
}
defaultValue=
{
defaultSqlDir
}
onChange=
{
e
=>
{
handleSelect
(
e
);
}
}
}
}
>
>
{
allSqlDir
&&
<
Button
type=
"primary"
loading=
{
initLoading
}
>
allSqlDir
.
map
((
item
,
index
)
=>
(
数据库初始化
<
Option
value=
{
item
}
key=
{
index
}
>
</
Button
>
{
item
}
</
Popconfirm
>
</
Option
>
{
defaultSqlDir
&&
(
))
}
<
Select
</
Select
>
placeholder=
"请选择解决方案"
)
}
style=
{
{
width
:
'200px'
}
}
defaultValue=
{
defaultSqlDir
}
onChange=
{
e
=>
{
handleSelect
(
e
);
}
}
>
{
allSqlDir
&&
allSqlDir
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
}
key=
{
index
}
>
{
item
}
</
Option
>
))
}
</
Select
>
)
}
</
Space
>
</
Space
>
</
Space
>
</
Space
>
</
div
>
</
div
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
>
</
Form
>
</
Spin
>
</
Card
>
</
Card
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
Card
className=
{
styles
.
mgTop20
}
>
...
@@ -506,7 +537,11 @@ const InitDataBase = props => {
...
@@ -506,7 +537,11 @@ const InitDataBase = props => {
setInitVisible
(
false
);
setInitVisible
(
false
);
setInitContent
(
''
);
setInitContent
(
''
);
}
}
}
}
width=
"600px"
width=
"800px"
bodyStyle=
{
{
maxHeight
:
'600px'
,
overflowY
:
'scroll'
,
}
}
footer=
{
[
footer=
{
[
<
Button
<
Button
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
...
src/pages/database/ManagementDataBase.jsx
View file @
a372d36a
...
@@ -14,11 +14,12 @@ import styles from './ManagementDataBase.less';
...
@@ -14,11 +14,12 @@ import styles from './ManagementDataBase.less';
import
{
updateDateBase
}
from
'@/services/database/api'
;
import
{
updateDateBase
}
from
'@/services/database/api'
;
const
ManagementDataBase
=
()
=>
{
const
ManagementDataBase
=
()
=>
{
const
[
autoCheckList
,
setAutoCheckList
]
=
useState
([]);
const
[
autoCheckList
,
setAutoCheckList
]
=
useState
([]);
// 自动列表
const
[
checkList
,
setCheckList
]
=
useState
([]);
const
[
checkList
,
setCheckList
]
=
useState
([]);
// 手动列表
const
[
logList
,
setLogList
]
=
useState
([]);
const
[
logList
,
setLogList
]
=
useState
([]);
// 日志列表
const
[
checkFlag
,
setCheckFlag
]
=
useState
(
1
);
const
[
checkFlag
,
setCheckFlag
]
=
useState
(
1
);
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
);
const
[
upFlag
,
setUpFlag
]
=
useState
(
1
);
//
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
);
// 按钮loading
const
[
logLoading
,
setLogLoading
]
=
useState
(
false
);
const
[
logLoading
,
setLogLoading
]
=
useState
(
false
);
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 弹窗
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 弹窗
const
[
content
,
setContent
]
=
useState
(
null
);
const
[
content
,
setContent
]
=
useState
(
null
);
...
@@ -63,7 +64,6 @@ const ManagementDataBase = () => {
...
@@ -63,7 +64,6 @@ const ManagementDataBase = () => {
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setLogLoading
(
false
);
setLogLoading
(
false
);
console
.
log
(
res
);
if
(
res
)
{
if
(
res
)
{
let
arr
=
[];
let
arr
=
[];
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
...
@@ -77,18 +77,23 @@ const ManagementDataBase = () => {
...
@@ -77,18 +77,23 @@ const ManagementDataBase = () => {
setLogLoading
(
false
);
setLogLoading
(
false
);
console
.
error
(
err
);
console
.
error
(
err
);
});
});
},
[]);
},
[
upFlag
]);
// 检查功能
const
handleCheck
=
()
=>
{
const
handleCheck
=
()
=>
{
setCheckFlag
(
checkFlag
+
1
);
setCheckFlag
(
checkFlag
+
1
);
};
};
// 升级功能
const
handleUpdate
=
()
=>
{
const
handleUpdate
=
()
=>
{
setCheckLoading
(
true
);
updateDateBase
({
updateDateBase
({
_version
:
9999
,
_version
:
9999
,
_dc
:
Date
.
now
(),
_dc
:
Date
.
now
(),
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setCheckLoading
(
false
);
setCheckFlag
(
checkFlag
+
1
);
setCheckFlag
(
checkFlag
+
1
);
if
(
res
.
sucess
)
{
setUpFlag
(
upFlag
+
1
);
if
(
res
.
success
)
{
notification
.
success
({
notification
.
success
({
message
:
'通知'
,
message
:
'通知'
,
duration
:
3
,
duration
:
3
,
...
@@ -103,6 +108,7 @@ const ManagementDataBase = () => {
...
@@ -103,6 +108,7 @@ const ManagementDataBase = () => {
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setCheckLoading
(
false
);
console
.
error
(
err
);
console
.
error
(
err
);
});
});
};
};
...
@@ -229,7 +235,7 @@ const ManagementDataBase = () => {
...
@@ -229,7 +235,7 @@ const ManagementDataBase = () => {
handleUpdate
();
handleUpdate
();
}
}
}
}
>
>
<
Button
danger
type=
"primary"
>
<
Button
danger
type=
"primary"
loading=
{
checkLoading
}
>
升级
升级
</
Button
>
</
Button
>
</
Popconfirm
>
</
Popconfirm
>
...
@@ -237,27 +243,27 @@ const ManagementDataBase = () => {
...
@@ -237,27 +243,27 @@ const ManagementDataBase = () => {
</
div
>
</
div
>
</
Card
>
</
Card
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
div
className=
{
styles
.
tableTitle
}
>
<
div
className=
{
styles
.
tableTitle
}
>
数据库升级记录
</
div
>
表字段手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</
div
>
<
Table
<
Table
className=
{
styles
.
mgTop20
}
className=
{
styles
.
mgTop20
}
columns=
{
check
Columns
}
columns=
{
log
Columns
}
dataSource=
{
check
List
}
dataSource=
{
log
List
}
bordered
bordered
loading=
{
check
Loading
}
loading=
{
log
Loading
}
size=
"small"
size=
"small"
/>
/>
</
Card
>
</
Card
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
div
className=
{
styles
.
tableTitle
}
>
数据库升级记录
</
div
>
<
div
className=
{
styles
.
tableTitle
}
>
表字段手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</
div
>
<
Table
<
Table
className=
{
styles
.
mgTop20
}
className=
{
styles
.
mgTop20
}
columns=
{
log
Columns
}
columns=
{
check
Columns
}
dataSource=
{
log
List
}
dataSource=
{
check
List
}
bordered
bordered
loading=
{
log
Loading
}
loading=
{
check
Loading
}
size=
"small"
size=
"small"
/>
/>
</
Card
>
</
Card
>
...
...
src/pages/mobileConfig/SiteConfig.jsx
View file @
a372d36a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Select
,
Input
,
Button
,
Row
,
Col
,
Radio
}
from
'antd'
;
import
{
Form
,
Select
,
Input
,
Button
,
Row
,
Col
,
Radio
,
notification
,
}
from
'antd'
;
import
{
editWebsite
,
getWebsite
}
from
'@/services/mobileConfig/api'
;
import
{
editWebsite
,
getWebsite
}
from
'@/services/mobileConfig/api'
;
import
PicturesWall
from
'@/components/Upload/index'
;
const
{
Item
}
=
Form
;
const
{
Item
}
=
Form
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
SiteConfig
=
props
=>
{
const
SiteConfig
=
props
=>
{
const
{
submitCallback
}
=
props
;
const
[
config
,
setConfig
]
=
useState
(
''
);
// 网站配置信息
const
[
config
,
setConfig
]
=
useState
(
''
);
// 网站配置信息
const
[
loginList
,
setLoginList
]
=
useState
([
const
[
loginList
,
setLoginList
]
=
useState
([
{
text
:
'默认界面'
,
value
:
'default'
},
{
text
:
'默认界面'
,
value
:
'default'
},
...
@@ -22,16 +33,15 @@ const SiteConfig = props => {
...
@@ -22,16 +33,15 @@ const SiteConfig = props => {
labelCol
:
{
span
:
3
},
labelCol
:
{
span
:
3
},
wrapperCol
:
{
span
:
14
},
wrapperCol
:
{
span
:
14
},
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
getWebsite
({
getWebsite
({
_version
:
9999
,
_version
:
9999
,
_dc
:
Date
.
now
(),
_dc
:
Date
.
now
(),
title
:
'新运维测试小程序'
,
title
:
'新运维测试小程序
222
'
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
);
let
obj
=
{
...
form
.
getFieldsValue
()
};
let
obj
=
{
...
form
.
getFieldsValue
()
};
let
arr
=
Object
.
keys
({
...
form
.
getFieldsValue
()
});
let
arr
=
Object
.
keys
({
...
form
.
getFieldsValue
()
});
console
.
log
(
arr
);
arr
.
map
(
k
=>
{
arr
.
map
(
k
=>
{
obj
[
k
]
=
res
[
k
];
obj
[
k
]
=
res
[
k
];
});
});
...
@@ -42,22 +52,77 @@ const SiteConfig = props => {
...
@@ -42,22 +52,77 @@ const SiteConfig = props => {
const
radioChange
=
e
=>
{};
const
radioChange
=
e
=>
{};
// 提交选择
// 提交选择
const
submit
=
value
=>
{
const
submit
=
value
=>
{
console
.
log
(
form
.
getFieldsValue
());
form
.
validateFields
().
then
(
valid
=>
{
if
(
valid
)
{
const
obj
=
{
...
form
.
getFieldsValue
()
};
let
params
=
{
...
obj
,
mode
:
'single'
,
client
:
'miniapp'
};
editWebsite
(
params
,
{
headers
:
{
'content-type'
:
'application/x-www-form-urlencggoded;charset=UTF-8'
,
},
}).
then
(
res
=>
{
if
(
res
.
success
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'编辑成功'
,
});
submitCallback
();
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
||
'编辑失败'
,
});
}
console
.
log
(
res
,
'res'
);
});
}
});
};
};
return
(
return
(
<
Form
form=
{
form
}
{
...
layout
}
>
<
Form
form=
{
form
}
{
...
layout
}
>
<
Item
label=
"应用名称:"
name=
"title"
>
<
Item
label=
"应用名称:"
name=
"title"
rules=
{
[
{
required
:
true
,
message
:
'请输入应用名称'
,
},
]
}
>
<
Input
placeholder=
"请输入应用名称"
allowClear
/>
<
Input
placeholder=
"请输入应用名称"
allowClear
/>
</
Item
>
</
Item
>
<
Item
label=
"系统图标:"
name=
"shortcutIcon"
>
<
Item
label=
"系统图标:"
name=
"shortcutIcon"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统图标'
,
},
]
}
>
<
Input
placeholder=
"请输入系统图标名称"
allowClear
/>
<
Input
placeholder=
"请输入系统图标名称"
allowClear
/>
</
Item
>
</
Item
>
{
/* <Button type="primary">按路径选择</Button> */
}
{
/* <Button type="primary">按路径选择</Button> */
}
<
Item
label=
"系统图标预览:"
/>
<
Item
label=
"系统图标预览:"
>
<
Item
label=
"登陆页面:"
name=
"loginTemplate"
>
<
PicturesWall
maxLen=
{
3
}
/>
</
Item
>
<
Item
label=
"登陆页面:"
name=
"loginTemplate"
rules=
{
[
{
required
:
true
,
message
:
'请选择登陆页面'
,
},
]
}
>
<
Select
placeholder=
"请选择登陆页面"
>
<
Select
placeholder=
"请选择登陆页面"
>
{
loginList
&&
{
loginList
&&
loginList
.
map
((
item
,
index
)
=>
(
loginList
.
map
((
item
,
index
)
=>
(
...
@@ -67,7 +132,16 @@ const SiteConfig = props => {
...
@@ -67,7 +132,16 @@ const SiteConfig = props => {
))
}
))
}
</
Select
>
</
Select
>
</
Item
>
</
Item
>
<
Item
label=
"系统皮肤:"
name=
"theme"
>
<
Item
label=
"系统皮肤:"
name=
"theme"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统皮肤'
,
},
]
}
>
<
Select
placeholder=
"请选择系统皮肤"
>
<
Select
placeholder=
"请选择系统皮肤"
>
{
themeList
&&
{
themeList
&&
themeList
.
map
((
item
,
index
)
=>
(
themeList
.
map
((
item
,
index
)
=>
(
...
@@ -77,7 +151,16 @@ const SiteConfig = props => {
...
@@ -77,7 +151,16 @@ const SiteConfig = props => {
))
}
))
}
</
Select
>
</
Select
>
</
Item
>
</
Item
>
<
Item
label=
"系统风格:"
name=
"style"
>
<
Item
label=
"系统风格:"
name=
"style"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统风格'
,
},
]
}
>
<
Select
placeholder=
"请选择系统风格"
>
<
Select
placeholder=
"请选择系统风格"
>
{
styleList
&&
{
styleList
&&
styleList
.
map
((
item
,
index
)
=>
(
styleList
.
map
((
item
,
index
)
=>
(
...
...
src/pages/mobileConfig/index.js
View file @
a372d36a
...
@@ -6,6 +6,7 @@ import SiteConfig from './SiteConfig';
...
@@ -6,6 +6,7 @@ import SiteConfig from './SiteConfig';
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
const
MobileConfigPage
=
props
=>
{
const
MobileConfigPage
=
props
=>
{
const
[
activeKey
,
setActiveKey
]
=
useState
(
'0'
);
// tabs活动页
const
[
activeKey
,
setActiveKey
]
=
useState
(
'0'
);
// tabs活动页
const
[
flag
,
setFlag
]
=
useState
(
1
);
useEffect
(()
=>
{
useEffect
(()
=>
{
miniAppSiteTree
({
miniAppSiteTree
({
userMode
:
'admin'
,
userMode
:
'admin'
,
...
@@ -16,17 +17,20 @@ const MobileConfigPage = props => {
...
@@ -16,17 +17,20 @@ const MobileConfigPage = props => {
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
});
});
},
[]);
},
[
flag
]);
// 修改选中的tab
// 修改选中的tab
const
handleChange
=
key
=>
{
const
handleChange
=
key
=>
{
setActiveKey
(
key
);
setActiveKey
(
key
);
};
};
const
submitCallback
=
val
=>
{
setFlag
(
flag
+
1
);
};
return
(
return
(
<
PageContainer
>
<
PageContainer
>
<
Card
>
<
Card
>
<
Tabs
activeKey
=
{
activeKey
}
type
=
"card"
onChange
=
{
handleChange
}
>
<
Tabs
activeKey
=
{
activeKey
}
type
=
"card"
onChange
=
{
handleChange
}
>
<
TabPane
tab
=
"网站配置"
key
=
"0"
>
<
TabPane
tab
=
"网站配置"
key
=
"0"
>
<
SiteConfig
/>
<
SiteConfig
submitCallback
=
{
submitCallback
}
/
>
<
/TabPane
>
<
/TabPane
>
<
TabPane
tab
=
"菜单管理"
key
=
"1"
>
<
TabPane
tab
=
"菜单管理"
key
=
"1"
>
<
div
>
菜单管理
<
/div
>
<
div
>
菜单管理
<
/div
>
...
...
src/pages/userCenter/siteManage/AddModal.jsx
View file @
a372d36a
...
@@ -84,7 +84,7 @@ const AddModal = props => {
...
@@ -84,7 +84,7 @@ const AddModal = props => {
>
>
<
Input
placeholder=
"请输入站点名称"
/>
<
Input
placeholder=
"请输入站点名称"
/>
</
Item
>
</
Item
>
<
Item
label=
"站点类别"
>
all
</
Item
>
{
/* <Item label="站点类别">all</Item> */
}
<
Item
label=
"站点描述"
name=
"description"
>
<
Item
label=
"站点描述"
name=
"description"
>
<
Input
placeholder=
"请输入站点描述"
/>
<
Input
placeholder=
"请输入站点描述"
/>
</
Item
>
</
Item
>
...
...
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
a372d36a
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
Button
,
Button
,
notification
,
notification
,
Spin
,
Spin
,
Tabs
,
}
from
'antd'
;
}
from
'antd'
;
import
{
FileAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
}
from
'@ant-design/icons'
;
import
{
FileAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
}
from
'@ant-design/icons'
;
import
{
PageContainer
,
GridContent
}
from
'@ant-design/pro-layout'
;
import
{
PageContainer
,
GridContent
}
from
'@ant-design/pro-layout'
;
...
@@ -22,7 +23,9 @@ import qs from 'qs';
...
@@ -22,7 +23,9 @@ import qs from 'qs';
import
AddModal
from
'./AddModal'
;
import
AddModal
from
'./AddModal'
;
import
DelModal
from
'./DelModal'
;
import
DelModal
from
'./DelModal'
;
import
EditModal
from
'./EditModal'
;
import
EditModal
from
'./EditModal'
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
const
{
TabPane
}
=
Tabs
;
const
placeholder
=
'请输入人员姓名'
;
const
placeholder
=
'请输入人员姓名'
;
const
SiteManage
=
()
=>
{
const
SiteManage
=
()
=>
{
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 树结构数据
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 树结构数据
...
@@ -39,8 +42,8 @@ const SiteManage = () => {
...
@@ -39,8 +42,8 @@ const SiteManage = () => {
const
[
spinLoading
,
setSpinLoading
]
=
useState
(
false
);
const
[
spinLoading
,
setSpinLoading
]
=
useState
(
false
);
const
now
=
new
Date
().
getTime
();
const
now
=
new
Date
().
getTime
();
// 点击树的回调
// 点击树的回调
const
handleTreeSelect
=
e
=>
{
const
handleTreeSelect
=
(
e
,
info
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
,
info
);
let
id
=
e
[
0
];
let
id
=
e
[
0
];
if
(
id
)
{
if
(
id
)
{
setSaveTreeId
(
id
);
setSaveTreeId
(
id
);
...
@@ -110,7 +113,7 @@ const SiteManage = () => {
...
@@ -110,7 +113,7 @@ const SiteManage = () => {
};
};
// 站点删除
// 站点删除
const
handleDel
=
e
=>
{
const
handleDel
=
e
=>
{
setStationId
(
e
.
stationID
);
setStationId
(
e
);
setDelVisible
(
true
);
setDelVisible
(
true
);
};
};
// 编辑站点
// 编辑站点
...
@@ -199,6 +202,15 @@ const SiteManage = () => {
...
@@ -199,6 +202,15 @@ const SiteManage = () => {
spinning=
{
spinLoading
}
spinning=
{
spinLoading
}
style=
{
{
marginTop
:
'20px'
}
}
style=
{
{
marginTop
:
'20px'
}
}
>
>
{
/* <Tabs
tabPosition="left"
defaultValue="0"
type="card"
style={{ width: '100%' }}
>
<TabPane key="0" tab="tab1" />
<TabPane key="1" tab="tab2" />
</Tabs> */
}
<
Tree
<
Tree
showLine=
{
{
showLeafIcon
:
false
}
}
showLine=
{
{
showLeafIcon
:
false
}
}
showIcon
showIcon
...
@@ -226,7 +238,7 @@ const SiteManage = () => {
...
@@ -226,7 +238,7 @@ const SiteManage = () => {
</
Card
>
</
Card
>
</
Col
>
</
Col
>
<
Col
lg=
{
18
}
>
<
Col
lg=
{
18
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Row
align=
"middle"
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
...
@@ -238,7 +250,42 @@ const SiteManage = () => {
...
@@ -238,7 +250,42 @@ const SiteManage = () => {
enterButton
enterButton
/>
/>
</
Col
>
</
Col
>
<
Col
span=
{
3
}
/>
{
/* <Col span={2}>
<Button
type="primary"
onClick={() => {
handleAdd();
}}
>
新增
</Button>
</Col>
<Col span={2}>
<Button
type="primary"
onClick={() => {
handleEdit();
}}
disabled={!ouid}
>
编辑
</Button>
</Col>
<Col span={2}>
<Button
danger
onClick={() => {
handleDel(ouid);
}}
disabled={!ouid}
>
删除
</Button>
</Col> */
}
</
Row
>
</
Row
>
</
Card
>
<
Card
className=
{
styles
.
cardBoxR
}
>
{
ouid
&&
(
{
ouid
&&
(
<
ListCard
<
ListCard
ouid=
{
ouid
}
ouid=
{
ouid
}
...
...
src/pages/userCenter/siteManage/SiteManage.less
View file @
a372d36a
.cardBox{
.cardBox{
min-height: calc(100vh - 200px);
min-height: calc(100vh - 200px);
}
}
.cardBoxR{
min-height: calc(100vh - 292px);
}
.ant-tree-node-content-wrapper-open{
.ant-tree-node-content-wrapper-open{
display: flex;
display: flex;
align-items: center;
align-items: center;
...
...
src/routes/config.js
View file @
a372d36a
...
@@ -4,6 +4,7 @@ import {
...
@@ -4,6 +4,7 @@ import {
UsergroupAddOutlined
,
UsergroupAddOutlined
,
SettingOutlined
,
SettingOutlined
,
HomeOutlined
,
HomeOutlined
,
SolutionOutlined
,
// AndroidOutlined,
// AndroidOutlined,
// CommentOutlined,
// CommentOutlined,
CopyOutlined
,
CopyOutlined
,
...
@@ -55,6 +56,13 @@ export default {
...
@@ -55,6 +56,13 @@ export default {
path
:
'/'
,
path
:
'/'
,
component
:
BasicLayout
,
component
:
BasicLayout
,
routes
:
[
routes
:
[
{
path
:
'/solution'
,
name
:
'解决方案管理'
,
icon
:
<
SolutionOutlined
style
=
{
iconStyle
}
/>
,
authority
:
superAuthority
,
component
:
CurrentSolution
,
},
{
{
path
:
'/dbm'
,
path
:
'/dbm'
,
name
:
'数据库管理'
,
name
:
'数据库管理'
,
...
@@ -62,12 +70,12 @@ export default {
...
@@ -62,12 +70,12 @@ export default {
component
:
BlankLayout
,
component
:
BlankLayout
,
authority
:
adminAuthority
,
authority
:
adminAuthority
,
routes
:
[
routes
:
[
{
//
{
path
:
'/dbm/solution'
,
//
path: '/dbm/solution',
name
:
'数据库解决方案'
,
//
name: '数据库解决方案',
authority
:
superAuthority
,
//
authority: superAuthority,
component
:
CurrentSolution
,
//
component: CurrentSolution,
},
//
},
{
{
path
:
'/dbm/dbInit'
,
path
:
'/dbm/dbInit'
,
name
:
'数据库初始化'
,
name
:
'数据库初始化'
,
...
...
src/services/database/api.js
View file @
a372d36a
...
@@ -11,7 +11,6 @@ export const setTableSQLDirName = params =>
...
@@ -11,7 +11,6 @@ export const setTableSQLDirName = params =>
get
(
'/Cityinterface/rest/services/OMS.svc/S_SetTableSQLDirName'
,
params
);
get
(
'/Cityinterface/rest/services/OMS.svc/S_SetTableSQLDirName'
,
params
);
// 删除数据库连接记录
// 删除数据库连接记录
export
const
deleteConn
=
params
=>
export
const
deleteConn
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_DeleteConn'
,
params
);
get
(
'/Cityinterface/rest/services/OMS.svc/S_DeleteConn'
,
params
);
...
...
src/services/mobileConfig/api.js
View file @
a372d36a
import
{
get
,
post
}
from
'@/services/index'
;
import
{
get
,
post
}
from
'@/services/index'
;
import
qs
from
'qs'
;
/**
/**
* @param {*} params
* @param {*} params
...
@@ -14,19 +15,25 @@ export const miniAppSiteTree = params =>
...
@@ -14,19 +15,25 @@ export const miniAppSiteTree = params =>
export
const
getWebsite
=
params
=>
export
const
getWebsite
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/MiniApp_GetWebsite'
,
params
);
get
(
'/Cityinterface/rest/services/OMS.svc/MiniApp_GetWebsite'
,
params
);
/**
/**
* 编辑网站配置
*
* @param {*} params
* @param {*} params
* title:"节水平台",
* /**
* "shortcutIcon":"assets/images/icon/小程序logo/gck.png",
* 编辑小程序网站配置
"style":"default",
title:"节水平台",
"mode":"single",
"shortcutIcon":"assets/images/icon/小程序logo/gck.png",
"client":"miniapp",
"style":"default",
"loginTemplate":"default",
"mode":"single",
"theme":"default",
"client":"miniapp",
"cloudLogin":false
"loginTemplate":"default",
*/
"theme":"default",
export
const
editWebsite
=
params
=>
"cloudLogin":false
post
(
*/
export
const
editWebsite
=
(
params
,
options
)
=>
{
let
strParams
=
JSON
.
stringify
(
params
);
let
qsParams
=
qs
.
stringify
({
config
:
strParams
});
return
post
(
'/Cityinterface/rest/services/OMS.svc/MiniApp_EditWebsite?_version=9999'
,
'/Cityinterface/rest/services/OMS.svc/MiniApp_EditWebsite?_version=9999'
,
params
,
qsParams
,
options
,
);
);
};
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