提交 7371bece 作者: ZhangLingKun

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

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