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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
222 additions
and
64 deletions
+222
-64
CurrentSolution.jsx
src/pages/database/CurrentSolution.jsx
+7
-6
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+0
-0
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';
import
styles
from
'./CurrentSolution.less'
;
const
{
Option
}
=
Select
;
const
CurrentSolution
=
()
=>
{
const
[
currentData
,
setCurrentData
]
=
useState
(
''
);
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
currentData
,
setCurrentData
]
=
useState
(
''
);
// 解决方案的值
const
[
dataList
,
setDataList
]
=
useState
([]);
// 下拉数组
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
setLoading
(
true
);
...
...
@@ -26,12 +26,13 @@ const CurrentSolution = () => {
console
.
error
(
err
);
});
},
[]);
// 切换解决方案
const
handleSelect
=
e
=>
{
setCurrentData
(
e
);
};
// 提交配置信息
const
submit
=
params
=>
{
setLoading
(
true
);
console
.
log
(
params
);
changeSolution
({
solution
:
currentData
,
_version
:
9999
,
...
...
@@ -42,14 +43,14 @@ const CurrentSolution = () => {
if
(
res
.
success
)
{
notification
.
success
({
message
:
'提示'
,
description
:
'切换成功'
,
description
:
res
.
message
||
'切换成功'
,
duration
:
3
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
description
:
res
.
message
,
duration
:
null
,
description
:
res
.
message
||
'切换失败'
,
duration
:
10
,
});
}
})
...
...
src/pages/database/InitDataBase.jsx
View file @
a372d36a
This diff is collapsed.
Click to expand it.
src/pages/database/ManagementDataBase.jsx
View file @
a372d36a
...
...
@@ -14,11 +14,12 @@ import styles from './ManagementDataBase.less';
import
{
updateDateBase
}
from
'@/services/database/api'
;
const
ManagementDataBase
=
()
=>
{
const
[
autoCheckList
,
setAutoCheckList
]
=
useState
([]);
const
[
checkList
,
setCheckList
]
=
useState
([]);
const
[
logList
,
setLogList
]
=
useState
([]);
const
[
autoCheckList
,
setAutoCheckList
]
=
useState
([]);
// 自动列表
const
[
checkList
,
setCheckList
]
=
useState
([]);
// 手动列表
const
[
logList
,
setLogList
]
=
useState
([]);
// 日志列表
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
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 弹窗
const
[
content
,
setContent
]
=
useState
(
null
);
...
...
@@ -63,7 +64,6 @@ const ManagementDataBase = () => {
})
.
then
(
res
=>
{
setLogLoading
(
false
);
console
.
log
(
res
);
if
(
res
)
{
let
arr
=
[];
res
.
map
((
item
,
index
)
=>
{
...
...
@@ -77,18 +77,23 @@ const ManagementDataBase = () => {
setLogLoading
(
false
);
console
.
error
(
err
);
});
},
[]);
},
[
upFlag
]);
// 检查功能
const
handleCheck
=
()
=>
{
setCheckFlag
(
checkFlag
+
1
);
};
// 升级功能
const
handleUpdate
=
()
=>
{
setCheckLoading
(
true
);
updateDateBase
({
_version
:
9999
,
_dc
:
Date
.
now
(),
})
.
then
(
res
=>
{
setCheckLoading
(
false
);
setCheckFlag
(
checkFlag
+
1
);
if
(
res
.
sucess
)
{
setUpFlag
(
upFlag
+
1
);
if
(
res
.
success
)
{
notification
.
success
({
message
:
'通知'
,
duration
:
3
,
...
...
@@ -103,6 +108,7 @@ const ManagementDataBase = () => {
}
})
.
catch
(
err
=>
{
setCheckLoading
(
false
);
console
.
error
(
err
);
});
};
...
...
@@ -229,7 +235,7 @@ const ManagementDataBase = () => {
handleUpdate
();
}
}
>
<
Button
danger
type=
"primary"
>
<
Button
danger
type=
"primary"
loading=
{
checkLoading
}
>
升级
</
Button
>
</
Popconfirm
>
...
...
@@ -237,27 +243,27 @@ const ManagementDataBase = () => {
</
div
>
</
Card
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
div
className=
{
styles
.
tableTitle
}
>
表字段手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</
div
>
<
div
className=
{
styles
.
tableTitle
}
>
数据库升级记录
</
div
>
<
Table
className=
{
styles
.
mgTop20
}
columns=
{
check
Columns
}
dataSource=
{
check
List
}
columns=
{
log
Columns
}
dataSource=
{
log
List
}
bordered
loading=
{
check
Loading
}
loading=
{
log
Loading
}
size=
"small"
/>
</
Card
>
<
Card
className=
{
styles
.
mgTop20
}
>
<
div
className=
{
styles
.
tableTitle
}
>
数据库升级记录
</
div
>
<
div
className=
{
styles
.
tableTitle
}
>
表字段手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</
div
>
<
Table
className=
{
styles
.
mgTop20
}
columns=
{
log
Columns
}
dataSource=
{
log
List
}
columns=
{
check
Columns
}
dataSource=
{
check
List
}
bordered
loading=
{
log
Loading
}
loading=
{
check
Loading
}
size=
"small"
/>
</
Card
>
...
...
src/pages/mobileConfig/SiteConfig.jsx
View file @
a372d36a
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
PicturesWall
from
'@/components/Upload/index'
;
const
{
Item
}
=
Form
;
const
{
Option
}
=
Select
;
const
SiteConfig
=
props
=>
{
const
{
submitCallback
}
=
props
;
const
[
config
,
setConfig
]
=
useState
(
''
);
// 网站配置信息
const
[
loginList
,
setLoginList
]
=
useState
([
{
text
:
'默认界面'
,
value
:
'default'
},
...
...
@@ -22,16 +33,15 @@ const SiteConfig = props => {
labelCol
:
{
span
:
3
},
wrapperCol
:
{
span
:
14
},
};
useEffect
(()
=>
{
getWebsite
({
_version
:
9999
,
_dc
:
Date
.
now
(),
title
:
'新运维测试小程序'
,
title
:
'新运维测试小程序
222
'
,
}).
then
(
res
=>
{
console
.
log
(
res
);
let
obj
=
{
...
form
.
getFieldsValue
()
};
let
arr
=
Object
.
keys
({
...
form
.
getFieldsValue
()
});
console
.
log
(
arr
);
arr
.
map
(
k
=>
{
obj
[
k
]
=
res
[
k
];
});
...
...
@@ -42,22 +52,77 @@ const SiteConfig = props => {
const
radioChange
=
e
=>
{};
// 提交选择
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
(
<
Form
form=
{
form
}
{
...
layout
}
>
<
Item
label=
"应用名称:"
name=
"title"
>
<
Item
label=
"应用名称:"
name=
"title"
rules=
{
[
{
required
:
true
,
message
:
'请输入应用名称'
,
},
]
}
>
<
Input
placeholder=
"请输入应用名称"
allowClear
/>
</
Item
>
<
Item
label=
"系统图标:"
name=
"shortcutIcon"
>
<
Item
label=
"系统图标:"
name=
"shortcutIcon"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统图标'
,
},
]
}
>
<
Input
placeholder=
"请输入系统图标名称"
allowClear
/>
</
Item
>
{
/* <Button type="primary">按路径选择</Button> */
}
<
Item
label=
"系统图标预览:"
/>
<
Item
label=
"登陆页面:"
name=
"loginTemplate"
>
<
Item
label=
"系统图标预览:"
>
<
PicturesWall
maxLen=
{
3
}
/>
</
Item
>
<
Item
label=
"登陆页面:"
name=
"loginTemplate"
rules=
{
[
{
required
:
true
,
message
:
'请选择登陆页面'
,
},
]
}
>
<
Select
placeholder=
"请选择登陆页面"
>
{
loginList
&&
loginList
.
map
((
item
,
index
)
=>
(
...
...
@@ -67,7 +132,16 @@ const SiteConfig = props => {
))
}
</
Select
>
</
Item
>
<
Item
label=
"系统皮肤:"
name=
"theme"
>
<
Item
label=
"系统皮肤:"
name=
"theme"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统皮肤'
,
},
]
}
>
<
Select
placeholder=
"请选择系统皮肤"
>
{
themeList
&&
themeList
.
map
((
item
,
index
)
=>
(
...
...
@@ -77,7 +151,16 @@ const SiteConfig = props => {
))
}
</
Select
>
</
Item
>
<
Item
label=
"系统风格:"
name=
"style"
>
<
Item
label=
"系统风格:"
name=
"style"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统风格'
,
},
]
}
>
<
Select
placeholder=
"请选择系统风格"
>
{
styleList
&&
styleList
.
map
((
item
,
index
)
=>
(
...
...
src/pages/mobileConfig/index.js
View file @
a372d36a
...
...
@@ -6,6 +6,7 @@ import SiteConfig from './SiteConfig';
const
{
TabPane
}
=
Tabs
;
const
MobileConfigPage
=
props
=>
{
const
[
activeKey
,
setActiveKey
]
=
useState
(
'0'
);
// tabs活动页
const
[
flag
,
setFlag
]
=
useState
(
1
);
useEffect
(()
=>
{
miniAppSiteTree
({
userMode
:
'admin'
,
...
...
@@ -16,17 +17,20 @@ const MobileConfigPage = props => {
}).
then
(
res
=>
{
console
.
log
(
res
);
});
},
[]);
},
[
flag
]);
// 修改选中的tab
const
handleChange
=
key
=>
{
setActiveKey
(
key
);
};
const
submitCallback
=
val
=>
{
setFlag
(
flag
+
1
);
};
return
(
<
PageContainer
>
<
Card
>
<
Tabs
activeKey
=
{
activeKey
}
type
=
"card"
onChange
=
{
handleChange
}
>
<
TabPane
tab
=
"网站配置"
key
=
"0"
>
<
SiteConfig
/>
<
SiteConfig
submitCallback
=
{
submitCallback
}
/
>
<
/TabPane
>
<
TabPane
tab
=
"菜单管理"
key
=
"1"
>
<
div
>
菜单管理
<
/div
>
...
...
src/pages/userCenter/siteManage/AddModal.jsx
View file @
a372d36a
...
...
@@ -84,7 +84,7 @@ const AddModal = props => {
>
<
Input
placeholder=
"请输入站点名称"
/>
</
Item
>
<
Item
label=
"站点类别"
>
all
</
Item
>
{
/* <Item label="站点类别">all</Item> */
}
<
Item
label=
"站点描述"
name=
"description"
>
<
Input
placeholder=
"请输入站点描述"
/>
</
Item
>
...
...
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
a372d36a
...
...
@@ -9,6 +9,7 @@ import {
Button
,
notification
,
Spin
,
Tabs
,
}
from
'antd'
;
import
{
FileAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
}
from
'@ant-design/icons'
;
import
{
PageContainer
,
GridContent
}
from
'@ant-design/pro-layout'
;
...
...
@@ -22,7 +23,9 @@ import qs from 'qs';
import
AddModal
from
'./AddModal'
;
import
DelModal
from
'./DelModal'
;
import
EditModal
from
'./EditModal'
;
const
{
Search
}
=
Input
;
const
{
TabPane
}
=
Tabs
;
const
placeholder
=
'请输入人员姓名'
;
const
SiteManage
=
()
=>
{
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 树结构数据
...
...
@@ -39,8 +42,8 @@ const SiteManage = () => {
const
[
spinLoading
,
setSpinLoading
]
=
useState
(
false
);
const
now
=
new
Date
().
getTime
();
// 点击树的回调
const
handleTreeSelect
=
e
=>
{
console
.
log
(
e
);
const
handleTreeSelect
=
(
e
,
info
)
=>
{
console
.
log
(
e
,
info
);
let
id
=
e
[
0
];
if
(
id
)
{
setSaveTreeId
(
id
);
...
...
@@ -110,7 +113,7 @@ const SiteManage = () => {
};
// 站点删除
const
handleDel
=
e
=>
{
setStationId
(
e
.
stationID
);
setStationId
(
e
);
setDelVisible
(
true
);
};
// 编辑站点
...
...
@@ -199,6 +202,15 @@ const SiteManage = () => {
spinning=
{
spinLoading
}
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
showLine=
{
{
showLeafIcon
:
false
}
}
showIcon
...
...
@@ -226,7 +238,7 @@ const SiteManage = () => {
</
Card
>
</
Col
>
<
Col
lg=
{
18
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
8
}
>
...
...
@@ -238,7 +250,42 @@ const SiteManage = () => {
enterButton
/>
</
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
>
</
Card
>
<
Card
className=
{
styles
.
cardBoxR
}
>
{
ouid
&&
(
<
ListCard
ouid=
{
ouid
}
...
...
src/pages/userCenter/siteManage/SiteManage.less
View file @
a372d36a
.cardBox{
min-height: calc(100vh - 200px);
}
.cardBoxR{
min-height: calc(100vh - 292px);
}
.ant-tree-node-content-wrapper-open{
display: flex;
align-items: center;
...
...
src/routes/config.js
View file @
a372d36a
...
...
@@ -4,6 +4,7 @@ import {
UsergroupAddOutlined
,
SettingOutlined
,
HomeOutlined
,
SolutionOutlined
,
// AndroidOutlined,
// CommentOutlined,
CopyOutlined
,
...
...
@@ -55,6 +56,13 @@ export default {
path
:
'/'
,
component
:
BasicLayout
,
routes
:
[
{
path
:
'/solution'
,
name
:
'解决方案管理'
,
icon
:
<
SolutionOutlined
style
=
{
iconStyle
}
/>
,
authority
:
superAuthority
,
component
:
CurrentSolution
,
},
{
path
:
'/dbm'
,
name
:
'数据库管理'
,
...
...
@@ -62,12 +70,12 @@ export default {
component
:
BlankLayout
,
authority
:
adminAuthority
,
routes
:
[
{
path
:
'/dbm/solution'
,
name
:
'数据库解决方案'
,
authority
:
superAuthority
,
component
:
CurrentSolution
,
},
//
{
//
path: '/dbm/solution',
//
name: '数据库解决方案',
//
authority: superAuthority,
//
component: CurrentSolution,
//
},
{
path
:
'/dbm/dbInit'
,
name
:
'数据库初始化'
,
...
...
src/services/database/api.js
View file @
a372d36a
...
...
@@ -11,7 +11,6 @@ export const setTableSQLDirName = params =>
get
(
'/Cityinterface/rest/services/OMS.svc/S_SetTableSQLDirName'
,
params
);
// 删除数据库连接记录
export
const
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
qs
from
'qs'
;
/**
* @param {*} params
...
...
@@ -14,19 +15,25 @@ export const miniAppSiteTree = params =>
export
const
getWebsite
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/MiniApp_GetWebsite'
,
params
);
/**
* 编辑网站配置
* @param {*} params
* title:"节水平台",
* "shortcutIcon":"assets/images/icon/小程序logo/gck.png",
"style":"default",
"mode":"single",
"client":"miniapp",
"loginTemplate":"default",
"theme":"default",
"cloudLogin":false
*/
export
const
editWebsite
=
params
=>
post
(
*
* @param {*} params
* /**
* 编辑小程序网站配置
title:"节水平台",
"shortcutIcon":"assets/images/icon/小程序logo/gck.png",
"style":"default",
"mode":"single",
"client":"miniapp",
"loginTemplate":"default",
"theme":"default",
"cloudLogin":false
*/
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'
,
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