董国庆
2026-01-06 f13a77f3606057cd186c53a833e1bbe58175aafb
management/src/pages/user/list/index.jsx
@@ -2,7 +2,7 @@
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';
@@ -126,6 +126,16 @@
  // 触发金币导入
  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
@@ -350,6 +360,22 @@
          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"