| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { Button, Space, Popconfirm, message, Modal, Input, Form, Avatar } from 'antd'; |
| | | import { getUserList, exportUserExcel, clearAllGold, batchUpdateIntegral, changeStatus } from './service'; |
| | | import { importFile, exportExcell } from '@/utils/utils'; |
| | | import { importFile, exportExcell, downLoad } from '@/utils/utils'; |
| | | import BatchUpdateIntegralModal from './components/BatchUpdateIntegralModal'; |
| | | import { history } from '@umijs/max'; |
| | | import { Access, useAccess } from 'umi'; |
| | |
| | | // 触发金币导入 |
| | | const triggerGoldImport = () => { |
| | | goldFileInputRef.current?.click(); |
| | | }; |
| | | |
| | | // 处理下载用户导入模板 |
| | | const handleDownloadUserTemplate = () => { |
| | | downLoad('/t-app-user/import-template_user', '用户导入模板.xlsx'); |
| | | }; |
| | | |
| | | // 处理下载金币导入模板 |
| | | const handleDownloadGoldTemplate = () => { |
| | | downLoad('/t-app-user/import-template_gold', '金币导入模板.xlsx'); |
| | | }; |
| | | |
| | | // 导出Excel |
| | |
| | | defaultCollapsed: false, |
| | | }} |
| | | toolBarRender={() => [ |
| | | <Access accessible={access.user_import || false}> |
| | | <Button |
| | | key="download-user-template" |
| | | onClick={handleDownloadUserTemplate} |
| | | > |
| | | 导入用户模板 |
| | | </Button> |
| | | </Access>, |
| | | <Access accessible={access.user_batchImportGold || false}> |
| | | <Button |
| | | key="download-gold-template" |
| | | onClick={handleDownloadGoldTemplate} |
| | | > |
| | | 导入金币模板 |
| | | </Button> |
| | | </Access>, |
| | | <input |
| | | ref={fileInputRef} |
| | | type="file" |