Commit 6284bf37 authored by 文旺-丰林-DEV's avatar 文旺-丰林-DEV

add import user refresh user list

parent 9f1b5602
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
}, },
"Redis": { "Redis": {
"Configuration": "yg-redis-dev-wan.redis.rds.aliyuncs.com:6379,password=YG@redis!dev2022123,defaultDatabase=5" "Configuration": "yg-redis-dev-wan.redis.rds.aliyuncs.com:6379,password=YG@redis!dev2022123,defaultDatabase=5"
}, },
"Jwt": { "Jwt": {
"Audience": "BBM.ChatGLM", "Audience": "BBM.ChatGLM",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,13 +6,26 @@ import { ...@@ -6,13 +6,26 @@ import {
postResetUser, postResetUser,
postEditUser, postEditUser,
postExcelFile, postExcelFile,
postDowload postDowload,
} from '@/services/chatGLM/api'; } from '@/services/chatGLM/api';
import { PlusOutlined, UploadOutlined } from '@ant-design/icons'; import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
import type { ActionType } from '@ant-design/pro-components'; import type { ActionType } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components';
import { Button, Col, Divider, Form, Input, Modal, Radio, Row, Switch, message, Upload, Spin } from 'antd'; import {
Button,
Col,
Divider,
Form,
Input,
Modal,
Radio,
Row,
Switch,
message,
Upload,
Spin,
} from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
...@@ -22,7 +35,6 @@ import styles from './index.less'; ...@@ -22,7 +35,6 @@ import styles from './index.less';
import { Exclamtion } from '@/components/Icons/Icons'; import { Exclamtion } from '@/components/Icons/Icons';
import { LoadingOutlined } from '@ant-design/icons'; import { LoadingOutlined } from '@ant-design/icons';
const { Item } = Form; const { Item } = Form;
const { Password } = Input; const { Password } = Input;
const antIcon = <LoadingOutlined style={{ fontSize: 24 }} spin />; const antIcon = <LoadingOutlined style={{ fontSize: 24 }} spin />;
...@@ -179,7 +191,6 @@ const UserManage = () => { ...@@ -179,7 +191,6 @@ const UserManage = () => {
}, },
]; ];
const handleOk = () => { const handleOk = () => {
setIsModalAccountOpen(false); setIsModalAccountOpen(false);
}; };
...@@ -224,7 +235,7 @@ const UserManage = () => { ...@@ -224,7 +235,7 @@ const UserManage = () => {
const onHandleClickAccountFinish = (values: any) => { const onHandleClickAccountFinish = (values: any) => {
if (accountModalName === '添加账号') { if (accountModalName === '添加账号') {
alert("2"); alert('2');
createdAccount(values); createdAccount(values);
} }
if (accountModalName === '编辑账号') { if (accountModalName === '编辑账号') {
...@@ -284,16 +295,16 @@ const UserManage = () => { ...@@ -284,16 +295,16 @@ const UserManage = () => {
const handleUpload = (file) => { const handleUpload = (file) => {
setUploadButtonDisable(true); setUploadButtonDisable(true);
postExcelFile(file).then(res => { postExcelFile(file).then((res) => {
setUploadButtonDisable(false); setUploadButtonDisable(false);
actionRef.current?.reload();
message.success(`批量添加用户: 成功人数:${res.successNum} 失败人数:${res.failNum}人`); message.success(`批量添加用户: 成功人数:${res.successNum} 失败人数:${res.failNum}人`);
}) });
}; };
const downloadExcelTemplate = () => { const downloadExcelTemplate = () => {
postDowload(); postDowload();
} };
return ( return (
<PageContainer> <PageContainer>
...@@ -467,13 +478,18 @@ const UserManage = () => { ...@@ -467,13 +478,18 @@ const UserManage = () => {
headerTitle="账号列表" headerTitle="账号列表"
toolBarRender={() => [ toolBarRender={() => [
<Button> <Button>
<a href='https://baibaomen.oss-cn-hangzhou.aliyuncs.com/zhensheng/excelTemplate.xlsx'>批量添加用户Excel模板</a></Button>, <a href="https://baibaomen.oss-cn-hangzhou.aliyuncs.com/zhensheng/excelTemplate.xlsx">
<Upload 批量添加用户模板下载
beforeUpload={handleUpload} </a>
disabled={uploadButtonDisable} </Button>,
showUploadList={false} <Upload beforeUpload={handleUpload} disabled={uploadButtonDisable} showUploadList={false}>
> {uploadButtonDisable ? (
{uploadButtonDisable ? <Button><Loading /></Button> : <Button icon={<UploadOutlined />}>Excel表格添加账号</Button>} <Button>
<Loading />
</Button>
) : (
<Button icon={<UploadOutlined />}>批量添加账号</Button>
)}
</Upload>, </Upload>,
<Button <Button
key="button" key="button"
...@@ -485,11 +501,11 @@ const UserManage = () => { ...@@ -485,11 +501,11 @@ const UserManage = () => {
type="primary" type="primary"
> >
添加账号 添加账号
</Button> </Button>,
]} ]}
/> />
</PageContainer> </PageContainer>
); );
}; };
export default UserManage; export default UserManage;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment