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
564fbec2
Commit
564fbec2
authored
Aug 20, 2021
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 替换Web配置模块接口
parent
d05c0fc8
Pipeline
#33243
skipped with stages
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
30 deletions
+30
-30
webConfigForm.js
src/pages/webConfig/components/webConfigForm.js
+1
-1
index.js
src/pages/webConfig/index.js
+2
-2
webMenu.jsx
src/pages/webConfig/menuconfig/webMenu.jsx
+13
-9
api.js
src/services/intelligence/api.js
+3
-3
api.js
src/services/webConfig/api.js
+11
-15
No files found.
src/pages/webConfig/components/webConfigForm.js
View file @
564fbec2
...
...
@@ -43,7 +43,7 @@ const WebConfigForm = props => {
const
onGetLoginPages
=
()
=>
{
if
(
loginPages
.
length
===
0
)
{
getLoginPage
().
then
(
res
=>
setLoginPages
(
res
));
getLoginPage
().
then
(
res
=>
setLoginPages
(
res
.
data
));
}
};
...
...
src/pages/webConfig/index.js
View file @
564fbec2
...
...
@@ -44,7 +44,7 @@ const WebConfigPage = props => {
setLoading
(
true
);
updateModuleTree
(
userMode
||
'super'
,
canceled
);
getAllConfigName
().
then
(
res
=>
{
if
(
!
canceled
.
cancel
)
setConfigFiles
(
res
);
if
(
!
canceled
.
cancel
)
setConfigFiles
(
res
.
data
);
});
return
()
=>
{
canceled
.
cancel
=
true
;
...
...
@@ -105,7 +105,7 @@ const WebConfigPage = props => {
.
then
(
res
=>
{
setLoading
(
false
);
if
(
!
canceled
.
cancel
)
{
setConfigObj
(
res
);
setConfigObj
(
res
.
data
);
// setConfigObj(res.data);
if
(
webTitle
===
curWeb
.
text
)
{
setToEdit
(
res
);
...
...
src/pages/webConfig/menuconfig/webMenu.jsx
View file @
564fbec2
...
...
@@ -167,8 +167,8 @@ const MiniMenu = props => {
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
setInfo
({
...
res
});
if
(
res
.
code
===
0
)
{
setInfo
({
...
res
.
data
});
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -197,7 +197,7 @@ const MiniMenu = props => {
})
.
then
(
res
=>
{
setModalLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setDelVisible
(
false
);
setFlag
(
flag
+
1
);
setNodeType
(
''
);
...
...
@@ -275,7 +275,7 @@ const MiniMenu = props => {
})
.
then
(
res
=>
{
setSubmitLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setAddVisible
(
false
);
setAddTwoVisible
(
false
);
setFlag
(
flag
+
1
);
...
...
@@ -314,7 +314,7 @@ const MiniMenu = props => {
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setFlag
(
flag
+
1
);
// updateMenuTree('edit');
notification
.
success
({
...
...
@@ -336,16 +336,20 @@ const MiniMenu = props => {
setLoading
(
false
);
});
}
else
{
pEditWebMenu
({
// 新接口改为editWebMenu 原来为pEditWebMenu
editWebMenu
({
_dc
:
Date
.
now
(),
menuID
,
// subSystemValue,
...
obj
,
product
:
null
,
baseUrl
:
null
,
hideInMenu
:
null
,
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setFlag
(
flag
+
1
);
// updateMenuTree('edit');
notification
.
success
({
...
...
@@ -357,7 +361,7 @@ const MiniMenu = props => {
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
m
essage
||
'编辑失败'
,
description
:
res
.
m
sg
||
'编辑失败'
,
});
}
})
...
...
@@ -435,7 +439,7 @@ const MiniMenu = props => {
_version
:
9999
,
_dc
:
Date
.
now
(),
}).
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
// updateMenuTree();
setFlag
(
flag
+
1
);
}
else
{
...
...
src/services/intelligence/api.js
View file @
564fbec2
...
...
@@ -3,11 +3,11 @@ import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
// 获取任务列表
export
const
taskOptionsList
=
()
=>
get
(
`
/PandaCore/OMS
/AIConfig/TaskOptionsList`
);
get
(
`
${
PUBLISH_SERVICE
}
/AIConfig/TaskOptionsList`
);
// 获取设备类型
export
const
getIotDeviceType
=
()
=>
get
(
`
/PandaCore/OMS
/AIConfig/GetIotDeviceType`
);
get
(
`
${
PUBLISH_SERVICE
}
/AIConfig/GetIotDeviceType`
);
// 获取场景列表
export
const
algorithmList
=
()
=>
get
(
`/PandaCore/OMS/AIConfig/AlgorithmList`
);
...
...
@@ -42,7 +42,7 @@ export const deleteTaskOptions = params =>
// 预测列表
export
const
getPredictInfo
=
()
=>
get
(
`
/PandaCore/OMS
/AIConfig/GetPredictInfo`
);
get
(
`
${
PUBLISH_SERVICE
}
/AIConfig/GetPredictInfo`
);
// 预测新增
export
const
addPredictOptions
=
params
=>
...
...
src/services/webConfig/api.js
View file @
564fbec2
...
...
@@ -22,7 +22,7 @@ export const getWebThemes = () =>
* 获取登录模板下拉选项
*/
export
const
getLoginPage
=
()
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_
GetLoginPage`
,
{
query
:
''
});
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/
GetLoginPage`
,
{
query
:
''
});
/**
* 获取地图配置下拉选项
...
...
@@ -54,46 +54,42 @@ export const postEditWebConfig = (config, isAdd = false) => {
});
return
post
(
`
${
PUBLISH_SERVICE
}
/WebSite/
${
isAdd
?
'AddWebsite'
:
'
W4_
EditWebsite'
isAdd
?
'AddWebsite'
:
'EditWebsite'
}
?_version=9999`
,
qs
.
stringify
({
config
:
JSON
.
stringify
(
obj
)
}),
{
headers
:
{
'content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
},
},
{
config
:
obj
},
);
};
export
const
postAddWebSite
=
config
=>
postEditWebConfig
(
config
,
true
);
export
const
deleteWebsite
=
client
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_
DeleteWebsite?_version=9999`
,
{
client
});
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/
DeleteWebsite?_version=9999`
,
{
client
});
/**
* 获取配置文件下拉选项
*/
export
const
getAllConfigName
=
()
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_
GetAllConfigName?_version=9999`
);
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/
GetAllConfigName?_version=9999`
);
export
const
addWebMenu
=
param
=>
{
const
defaultConfig
=
{
pageUrl
:
''
};
// eslint-disable-next-line no-return-assign
Object
.
keys
(
param
).
forEach
(
k
=>
(
defaultConfig
[
k
]
=
param
[
k
]));
return
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_
AddMenu?_version=9999`
,
defaultConfig
);
return
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/
AddMenu?_version=9999`
,
defaultConfig
);
};
export
const
editWebMenu
=
param
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_EditMenu?_version=9999`
,
param
);
// get(`${CITY_SERVICE}/OMS.svc/W4_EditMenu?_version=9999`, param);
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/EditMenu?_version=9999`
,
param
);
export
const
pEditWebMenu
=
param
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/P_EditMenu?_version=9999`
,
param
);
export
const
deleteWebMenu
=
param
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_
DeleteMenu?_version=9999`
,
param
);
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/
DeleteMenu?_version=9999`
,
param
);
export
const
getWebMenuInfo
=
param
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/P_
GetMenuInfo?_version=9999`
,
param
);
get
(
`
${
PUBLISH_SERVICE
}
/PlatformCenter/
GetMenuInfo?_version=9999`
,
param
);
export
const
saveConfigContent
=
(
fileName
,
content
)
=>
post
(
...
...
@@ -113,7 +109,7 @@ export const getConfigContent = name =>
// 菜单拖拽
export
const
dragMenu
=
params
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/P_
DragMenu`
,
params
);
get
(
`
${
PUBLISH_SERVICE
}
/PlatformCenter/
DragMenu`
,
params
);
// 获取产品列表
export
const
getProductList
=
params
=>
...
...
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