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

add import user refresh user list

parent 9f1b5602
......@@ -39,7 +39,6 @@
},
"Redis": {
"Configuration": "yg-redis-dev-wan.redis.rds.aliyuncs.com:6379,password=YG@redis!dev2022123,defaultDatabase=5"
},
"Jwt": {
"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 {
postResetUser,
postEditUser,
postExcelFile,
postDowload
postDowload,
} from '@/services/chatGLM/api';
import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
import type { ActionType } from '@ant-design/pro-components';
import { PageContainer } 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 { isEmpty } from 'lodash';
......@@ -22,7 +35,6 @@ import styles from './index.less';
import { Exclamtion } from '@/components/Icons/Icons';
import { LoadingOutlined } from '@ant-design/icons';
const { Item } = Form;
const { Password } = Input;
const antIcon = <LoadingOutlined style={{ fontSize: 24 }} spin />;
......@@ -179,7 +191,6 @@ const UserManage = () => {
},
];
const handleOk = () => {
setIsModalAccountOpen(false);
};
......@@ -224,7 +235,7 @@ const UserManage = () => {
const onHandleClickAccountFinish = (values: any) => {
if (accountModalName === '添加账号') {
alert("2");
alert('2');
createdAccount(values);
}
if (accountModalName === '编辑账号') {
......@@ -284,16 +295,16 @@ const UserManage = () => {
const handleUpload = (file) => {
setUploadButtonDisable(true);
postExcelFile(file).then(res => {
postExcelFile(file).then((res) => {
setUploadButtonDisable(false);
actionRef.current?.reload();
message.success(`批量添加用户: 成功人数:${res.successNum} 失败人数:${res.failNum}人`);
})
});
};
const downloadExcelTemplate = () => {
postDowload();
}
};
return (
<PageContainer>
......@@ -467,13 +478,18 @@ const UserManage = () => {
headerTitle="账号列表"
toolBarRender={() => [
<Button>
<a href='https://baibaomen.oss-cn-hangzhou.aliyuncs.com/zhensheng/excelTemplate.xlsx'>批量添加用户Excel模板</a></Button>,
<Upload
beforeUpload={handleUpload}
disabled={uploadButtonDisable}
showUploadList={false}
>
{uploadButtonDisable ? <Button><Loading /></Button> : <Button icon={<UploadOutlined />}>Excel表格添加账号</Button>}
<a href="https://baibaomen.oss-cn-hangzhou.aliyuncs.com/zhensheng/excelTemplate.xlsx">
批量添加用户模板下载
</a>
</Button>,
<Upload beforeUpload={handleUpload} disabled={uploadButtonDisable} showUploadList={false}>
{uploadButtonDisable ? (
<Button>
<Loading />
</Button>
) : (
<Button icon={<UploadOutlined />}>批量添加账号</Button>
)}
</Upload>,
<Button
key="button"
......@@ -485,11 +501,11 @@ const UserManage = () => {
type="primary"
>
添加账号
</Button>
</Button>,
]}
/>
</PageContainer>
);
};
export default UserManage;
\ No newline at end of file
export default UserManage;
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