Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
afef2f2c
Commit
afef2f2c
authored
Apr 09, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装notifaction
parent
9bf17f65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
index.js
src/util/index.js
+10
-1
index.jsx
src/view/Manage/Element/index.jsx
+2
-6
No files found.
src/util/index.js
View file @
afef2f2c
import
React
from
"react"
;
import
{
message
}
from
'antd'
;
import
{
message
,
notification
}
from
'antd'
;
import
{
Redirect
}
from
'react-router-dom'
;
import
{
dispatchLatest
,
action
}
from
'../model'
;
import
{
set_sess_state
}
from
"../model/reducer"
;
...
...
@@ -114,6 +114,15 @@ export const showMessage = function(action, content) {
}
}
export
const
showNotifaction
=
function
(
title
,
tip
)
{
notification
.
config
({
prefixCls
:
"yy-notification"
});
notification
.
open
({
message
:
title
||
'提示'
,
description
:
<
span
dangerouslySetInnerHTML
=
{{
__html
:
tip
||
''
}}
/>
,
duration
:
0
,
});
}
export
function
generateList
(
data
,
dataList
){
if
(
data
[
0
]
===
undefined
)
return
data
...
...
src/view/Manage/Element/index.jsx
View file @
afef2f2c
...
...
@@ -3,6 +3,7 @@ import { Button, Table, Pagination, notification } from 'antd';
import
{
dispatchLatest
}
from
'../../../model'
;
import
ImportModal
from
'./Component/ImportModal'
;
import
{
showNotifaction
}
from
'../../../util'
;
import
'./index.less'
;
const
Element
=
(
props
)
=>
{
...
...
@@ -84,12 +85,7 @@ const Element = (props) => {
}
if
(
tip
&&
tip
!==
''
)
{
notification
.
config
({
prefixCls
:
"yy-notification"
});
notification
.
open
({
message
:
'导入提示'
,
description
:
<
span
dangerouslySetInnerHTML=
{
{
__html
:
tip
||
''
}
}
/>,
duration
:
0
,
});
showNotifaction
(
'导入提示'
,
tip
);
}
}
...
...
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