Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
c48fe09a
Unverified
Commit
c48fe09a
authored
Jun 01, 2023
by
aiwenmo
Committed by
GitHub
Jun 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Optimization-2006][web] Optimize alert group through dva effect (#2007)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
824c28f6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
+19
-16
pom.xml
dinky-cdc/dinky-cdc-plus/pom.xml
+2
-2
index.tsx
dinky-web/src/pages/RegCenter/Alert/AlertGroup/index.tsx
+10
-5
service.ts
dinky-web/src/pages/RegCenter/Alert/AlertGroup/service.ts
+2
-8
model.ts
dinky-web/src/pages/RegCenter/Alert/AlertInstance/model.ts
+5
-1
No files found.
dinky-cdc/dinky-cdc-plus/pom.xml
View file @
c48fe09a
...
...
@@ -8,9 +8,9 @@
<version>
0.8.0
</version>
</parent>
<artifactId>
dinky-cdc-
dori
s
</artifactId>
<artifactId>
dinky-cdc-
plu
s
</artifactId>
<name>
Dinky : CDC:
Dori
s
</name>
<name>
Dinky : CDC:
Plu
s
</name>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
...
...
dinky-web/src/pages/RegCenter/Alert/AlertGroup/index.tsx
View file @
c48fe09a
...
...
@@ -27,8 +27,7 @@ import {l} from "@/utils/intl";
import
{
Alert
,
ALERT_TYPE
}
from
"@/types/RegCenter/data.d"
;
import
{
queryList
}
from
"@/services/api"
;
import
{
handleAddOrUpdate
,
handleRemoveById
,
updateEnabled
}
from
"@/services/BusinessCrud"
;
import
{
showAlertInstance
}
from
"@/pages/RegCenter/Alert/AlertGroup/service"
;
import
{
connect
}
from
"@umijs/max"
;
import
{
connect
,
Dispatch
}
from
"@umijs/max"
;
import
{
ProList
}
from
"@ant-design/pro-components"
;
import
{
API_CONSTANTS
,
PRO_LIST_CARD_OPTIONS
,
PROTABLE_OPTIONS_PUBLIC
,
SWITCH_OPTIONS
}
from
"@/services/constants"
;
import
{
getAlertIcon
}
from
"@/pages/RegCenter/Alert/AlertInstance/function"
;
...
...
@@ -40,7 +39,6 @@ const AlertGroupTableList: React.FC = (props: any) => {
/**
* state
*/
const
{
dispatch
}
=
props
;
const
[
modalVisible
,
handleModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
updateModalVisible
,
handleUpdateModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
formValues
,
setFormValues
]
=
useState
({});
...
...
@@ -64,7 +62,7 @@ const AlertGroupTableList: React.FC = (props: any) => {
*/
useEffect
(()
=>
{
queryAlertGroupList
();
showAlertInstance
(
dispatch
);
props
.
queryInstance
(
);
},
[
modalVisible
]);
/**
...
...
@@ -255,4 +253,11 @@ const AlertGroupTableList: React.FC = (props: any) => {
);
};
export default connect()(AlertGroupTableList);
const mapDispatchToProps = (dispatch: Dispatch) =
>
(
{
queryInstance
:
()
=>
dispatch
({
type
:
"Alert/queryInstance"
,
payload
:
{},
}),
}
);
export default connect(()=
>
(
{}
),mapDispatchToProps)(AlertGroupTableList);
dinky-web/src/pages/RegCenter/Alert/AlertGroup/service.ts
View file @
c48fe09a
...
...
@@ -20,13 +20,7 @@
import
{
getData
}
from
"@/services/api"
;
import
{
API_CONSTANTS
}
from
"@/services/constants"
;
export
function
showAlertInstance
(
dispatch
:
any
)
{
const
res
=
getData
(
API_CONSTANTS
.
ALERT_INSTANCE_LIST_ENABLE_ALL
);
res
.
then
((
result
)
=>
{
result
.
datas
&&
dispatch
&&
dispatch
({
type
:
"Alert/saveInstance"
,
payload
:
result
.
datas
,
});
});
export
function
showAlertInstance
()
{
return
getData
(
API_CONSTANTS
.
ALERT_INSTANCE_LIST_ENABLE_ALL
);
}
dinky-web/src/pages/RegCenter/Alert/AlertInstance/model.ts
View file @
c48fe09a
...
...
@@ -18,6 +18,7 @@
import
{
Reducer
}
from
"umi"
;
import
{
Alert
}
from
"@/types/RegCenter/data.d"
;
import
{
showAlertInstance
}
from
"@/pages/RegCenter/Alert/AlertGroup/service"
;
export
type
AlertStateType
=
{
instance
:
Alert
.
AlertInstance
[],
...
...
@@ -43,7 +44,10 @@ const AlertModel: AlertModelType = {
},
effects
:
{
*
queryInstance
({
},
{
call
,
put
})
{
const
{
datas
}
=
yield
call
(
showAlertInstance
);
yield
put
({
type
:
'saveInstance'
,
payload
:
datas
});
},
},
reducers
:
{
...
...
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