提交 7371bece 作者: ZhangLingKun

功能:删除账号、课程上传文件大小

上级 5f3990ed
......@@ -64,7 +64,7 @@ export const Uploader: React.FC<PropsType> = (props) => {
return isType;
}
if (!isSize) {
message.error('文件最大2M,请压缩后上传!').then();
message.error(`文件最大${props.fileSize}M,请压缩后上传!`).then();
return isSize;
}
},
......
import { useEffect, useState } from 'react';
import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd';
import { Button, message, Modal, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal';
import { InterListType, InterReqType } from '~/api/interface';
import { listAppUserType } from '~/api/interface/customManageType';
import { CustomManageAPI } from '~/api';
import { CustomManageAPI, SystemManageAPI } from '~/api';
// 表格数据类型
type TableType = InterListType<listAppUserType>;
......@@ -24,6 +24,7 @@ const portTypeList = [
];
function CustomListView() {
const { confirm } = Modal;
// 等级标签列表
const [cooperationTagIdList, setCooperationTagIdList] = useState<
{ value: number; label: string }[]
......@@ -80,6 +81,23 @@ function CustomListView() {
// console.log(res.result);
}
};
// 删除用户
const handleDelete = (value: TableType[0]) => {
confirm({
title: '提示',
content: '是否删除该账号?',
onOk: async () => {
const res = await SystemManageAPI.removeBAccount({ userAccountId: value.id });
if (res && res.code === '200') {
message.success('删除成功');
paginationChange(
tableData.length === 1 ? pagination.current - 1 : pagination.current,
pagination.pageSize,
);
}
},
});
};
// componentDidMount
useEffect(() => {
query = {};
......@@ -188,7 +206,7 @@ function CustomListView() {
>
变更
</Button>
<Button type={'link'} danger>
<Button type={'link'} danger onClick={() => handleDelete(record)}>
删除
</Button>
</>
......
......@@ -155,6 +155,7 @@ const AddEditModal: React.FC<propType> = (props) => {
listType={'picture-card'}
fileUpload
fileLength={1}
fileSize={10}
onChange={(e) => form.setFieldValue('surfaceUrl', e[0].url)}
defaultFileList={data?.surfaceUrl ? [{ url: data?.surfaceUrl }] : []}
>
......@@ -177,7 +178,7 @@ const AddEditModal: React.FC<propType> = (props) => {
fileUpload
fileLength={1}
fileType={['video/mp4', 'video/avi', 'video/wmv', 'video/rmvb']}
fileSize={10}
fileSize={1024}
onChange={(e) => form.setFieldValue('videoUrl', e[0].url)}
defaultFileList={data?.videoUrl ? [{ url: data?.videoUrl }] : []}
>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论