-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add empty dialog client Signed-off-by: ryjiang <[email protected]> * support empty data Signed-off-by: ryjiang <[email protected]> --------- Signed-off-by: ryjiang <[email protected]>
- Loading branch information
1 parent
c645a4a
commit c9863ed
Showing
20 changed files
with
175 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ const btnTrans = { | |
rename: '重命名', | ||
duplicate: '复制', | ||
export: '导出', | ||
empty: '清空数据' | ||
}; | ||
|
||
export default btnTrans; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { FC, useContext } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { rootContext } from '@/context'; | ||
import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate'; | ||
import { DataService } from '@/http'; | ||
import { EmptyDataProps } from './Types'; | ||
|
||
const EmptyDataDialog: FC<EmptyDataProps> = props => { | ||
const { cb, collectionName } = props; | ||
|
||
const { handleCloseDialog } = useContext(rootContext); | ||
const { t: dialogTrans } = useTranslation('dialog'); | ||
const { t: collectionTrans } = useTranslation('collection'); | ||
const { t: btnTrans } = useTranslation('btn'); | ||
|
||
const handleDelete = async () => { | ||
// duplicate | ||
DataService.emptyData(collectionName); | ||
// close dialog | ||
handleCloseDialog(); | ||
cb && cb(); | ||
}; | ||
|
||
return ( | ||
<DeleteTemplate | ||
label={btnTrans('empty')} | ||
title={dialogTrans('emptyTitle', { | ||
type: collectionTrans('collection'), | ||
})} | ||
compare={collectionName} | ||
text={collectionTrans('emptyDataDialogInfo')} | ||
handleDelete={handleDelete} | ||
/> | ||
); | ||
}; | ||
|
||
export default EmptyDataDialog; |
Oops, something went wrong.