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
5f0fc5d4
Commit
5f0fc5d4
authored
Jan 18, 2021
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 解决方案管理api替换
parent
fc549f49
Pipeline
#22607
passed with stages
in 17 minutes 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
9 deletions
+35
-9
CurrentSolution.jsx
src/pages/database/CurrentSolution.jsx
+33
-9
api.js
src/services/database/api.js
+2
-0
No files found.
src/pages/database/CurrentSolution.jsx
View file @
5f0fc5d4
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Select
,
Card
,
Row
,
Col
,
Button
,
Spin
,
notification
}
from
'antd'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
getSolutionList
,
changeSolution
}
from
'@/services/database/api'
;
import
{
getSolutionList
,
changeSolution
,
publishGetSolutionList
,
}
from
'@/services/database/api'
;
import
styles
from
'./CurrentSolution.less'
;
const
{
Option
}
=
Select
;
const
CurrentSolution
=
()
=>
{
const
[
currentData
,
setCurrentData
]
=
useState
(
''
);
// 解决方案的值
const
[
dataList
,
setDataList
]
=
useState
([]);
// 下拉数组
const
[
loading
,
setLoading
]
=
useState
(
false
);
// useEffect(() => {
// setLoading(true);
// getSolutionList({
// _version: 9999,
// _dc: new Date().getTime(),
// })
// .then(res => {
// setLoading(false);
// if (res.success) {
// setCurrentData(res.currentSolution);
// setDataList(res.solutions);
// }
// })
// .catch(err => {
// setLoading(false);
// console.error(err);
// });
// }, []);
useEffect
(()
=>
{
newGetSolution
();
},
[]);
const
newGetSolution
=
()
=>
{
setLoading
(
true
);
g
etSolutionList
({
publishG
etSolutionList
({
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
setCurrentData
(
res
.
currentSolution
);
setDataList
(
res
.
solutions
);
if
(
res
.
code
===
0
)
{
const
{
currentSolution
,
solutions
}
=
res
.
data
;
setCurrentData
(
currentSolution
);
setDataList
(
solutions
);
}
})
.
catch
(
err
=>
{
.
finally
(()
=>
{
setLoading
(
false
);
console
.
error
(
err
);
});
}
,
[])
;
};
// 切换解决方案
const
handleSelect
=
e
=>
{
setCurrentData
(
e
);
...
...
src/services/database/api.js
View file @
5f0fc5d4
...
...
@@ -70,6 +70,8 @@ export const deleteConn = params =>
export
const
getSolutionList
=
params
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_GetSolutionList`
,
params
);
export
const
publishGetSolutionList
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/PlatformCenter/GetSolutionList`
,
params
);
// 切换解决方案
export
const
changeSolution
=
params
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/W4_ChangeSolution`
,
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