风采增加删除功能
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -11,16 +11,18 @@ import {
|
||||
Modal,
|
||||
Tag,
|
||||
Tooltip,
|
||||
Popconfirm,
|
||||
} from 'antd';
|
||||
import {
|
||||
UploadOutlined,
|
||||
ArrowLeftOutlined,
|
||||
CameraOutlined,
|
||||
VideoCameraOutlined,
|
||||
DeleteOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { history } from '@umijs/max';
|
||||
import JobPortalHeader from '@/components/JobPortalHeader';
|
||||
import { uploadShowcaseFile, getShowcaseFileList } from '@/services/jobportal/user';
|
||||
import { uploadShowcaseFile, getShowcaseFileList, deleteShowcaseFile } from '@/services/jobportal/user';
|
||||
import { getFileDisplayUrl } from '@/utils/fileUrl';
|
||||
import './index.less';
|
||||
|
||||
@@ -163,6 +165,20 @@ const ShowcasePage: React.FC = () => {
|
||||
return isValid;
|
||||
};
|
||||
|
||||
const handleDelete = async (item: ShowcaseItem) => {
|
||||
try {
|
||||
const resp = await deleteShowcaseFile(item.id);
|
||||
if (resp?.code === 200 || resp?.code === 0) {
|
||||
message.success('删除成功');
|
||||
await fetchFileList();
|
||||
} else {
|
||||
message.error(resp?.msg || '删除失败');
|
||||
}
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
history.push('/job-portal/personal-center');
|
||||
};
|
||||
@@ -275,6 +291,24 @@ const ShowcasePage: React.FC = () => {
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
<div style={{ marginTop: 12, textAlign: 'center' }}>
|
||||
<Popconfirm
|
||||
title="确定删除该文件吗?"
|
||||
description="删除后不可恢复"
|
||||
onConfirm={() => handleDelete(item)}
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
size="small"
|
||||
icon={<DeleteOutlined />}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -11,15 +11,17 @@ import {
|
||||
Modal,
|
||||
Tag,
|
||||
Tooltip,
|
||||
Popconfirm,
|
||||
} from 'antd';
|
||||
import {
|
||||
UploadOutlined,
|
||||
CameraOutlined,
|
||||
VideoCameraOutlined,
|
||||
ArrowLeftOutlined,
|
||||
DeleteOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { history } from '@umijs/max';
|
||||
import { uploadShowcaseFile, getShowcaseFileList } from '@/services/jobportal/user';
|
||||
import { uploadShowcaseFile, getShowcaseFileList, deleteShowcaseFile } from '@/services/jobportal/user';
|
||||
import { getFileDisplayUrl } from '@/utils/fileUrl';
|
||||
import EnterpriseHeader from '@/components/EnterpriseHeader';
|
||||
import './index.less';
|
||||
@@ -163,6 +165,20 @@ const EnterpriseShowcase: React.FC = () => {
|
||||
return isValid;
|
||||
};
|
||||
|
||||
const handleDelete = async (item: ShowcaseItem) => {
|
||||
try {
|
||||
const resp = await deleteShowcaseFile(item.id);
|
||||
if (resp?.code === 200 || resp?.code === 0) {
|
||||
message.success('删除成功');
|
||||
await fetchFileList();
|
||||
} else {
|
||||
message.error(resp?.msg || '删除失败');
|
||||
}
|
||||
} catch (error) {
|
||||
message.error('删除失败');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="enterprise-showcase-page">
|
||||
<EnterpriseHeader />
|
||||
@@ -270,6 +286,24 @@ const EnterpriseShowcase: React.FC = () => {
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
<div style={{ marginTop: 12, textAlign: 'center' }}>
|
||||
<Popconfirm
|
||||
title="确定删除该文件吗?"
|
||||
description="删除后不可恢复"
|
||||
onConfirm={() => handleDelete(item)}
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
size="small"
|
||||
icon={<DeleteOutlined />}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -26,6 +26,22 @@ const statusValueEnum = {
|
||||
'2': { text: '已驳回', status: 'Error' },
|
||||
};
|
||||
|
||||
const userTypeValueEnum = {
|
||||
'0': { text: '企业' },
|
||||
'1': { text: '求职者' },
|
||||
'2': { text: '网格员' },
|
||||
'3': { text: '政府人员' },
|
||||
'4': { text: '其他' },
|
||||
};
|
||||
|
||||
const userTypeColorMap: Record<string, string> = {
|
||||
'0': 'blue',
|
||||
'1': 'green',
|
||||
'2': 'orange',
|
||||
'3': 'purple',
|
||||
'4': 'default',
|
||||
};
|
||||
|
||||
const ShowcaseReview: React.FC = () => {
|
||||
const access = useAccess();
|
||||
const actionRef = useRef<ActionType>();
|
||||
@@ -103,6 +119,7 @@ const ShowcaseReview: React.FC = () => {
|
||||
justifyContent: 'center',
|
||||
cursor: 'pointer',
|
||||
borderRadius: 4,
|
||||
position: 'relative',
|
||||
}}
|
||||
onClick={() => {
|
||||
setPreviewUrl(url);
|
||||
@@ -135,10 +152,29 @@ const ShowcaseReview: React.FC = () => {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '上传用户ID',
|
||||
dataIndex: 'bussinessid',
|
||||
title: '用户昵称',
|
||||
dataIndex: 'userName',
|
||||
width: 120,
|
||||
fieldProps: { placeholder: '输入用户ID' },
|
||||
fieldProps: { placeholder: '输入用户昵称' },
|
||||
},
|
||||
{
|
||||
title: '用户类型',
|
||||
dataIndex: 'userType',
|
||||
width: 100,
|
||||
valueType: 'select',
|
||||
valueEnum: userTypeValueEnum,
|
||||
fieldProps: { placeholder: '选择用户类型' },
|
||||
render: (_, record) => {
|
||||
const text = userTypeValueEnum[record.userType || '']?.text || record.userType || '-';
|
||||
const color = userTypeColorMap[record.userType || ''] || 'default';
|
||||
return <Tag color={color}>{text}</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'userPhone',
|
||||
width: 130,
|
||||
fieldProps: { placeholder: '输入手机号码' },
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
@@ -215,12 +251,14 @@ const ShowcaseReview: React.FC = () => {
|
||||
rowKey="id"
|
||||
search={{ labelWidth: 100 }}
|
||||
request={async (params) => {
|
||||
const { current, pageSize, bussinessid, reviewStatus } = params;
|
||||
const { current, pageSize, reviewStatus, userName, userType, userPhone } = params;
|
||||
const res = await getShowcaseReviewList({
|
||||
current,
|
||||
pageSize,
|
||||
bussinessid: bussinessid ? Number(bussinessid) : undefined,
|
||||
reviewStatus,
|
||||
userName,
|
||||
userType,
|
||||
userPhone,
|
||||
});
|
||||
return {
|
||||
data: res?.rows || [],
|
||||
|
||||
Reference in New Issue
Block a user