风采增加删除功能
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,
|
Modal,
|
||||||
Tag,
|
Tag,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Popconfirm,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
UploadOutlined,
|
UploadOutlined,
|
||||||
ArrowLeftOutlined,
|
ArrowLeftOutlined,
|
||||||
CameraOutlined,
|
CameraOutlined,
|
||||||
VideoCameraOutlined,
|
VideoCameraOutlined,
|
||||||
|
DeleteOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { history } from '@umijs/max';
|
import { history } from '@umijs/max';
|
||||||
import JobPortalHeader from '@/components/JobPortalHeader';
|
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 { getFileDisplayUrl } from '@/utils/fileUrl';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@@ -163,6 +165,20 @@ const ShowcasePage: React.FC = () => {
|
|||||||
return isValid;
|
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 = () => {
|
const handleBack = () => {
|
||||||
history.push('/job-portal/personal-center');
|
history.push('/job-portal/personal-center');
|
||||||
};
|
};
|
||||||
@@ -275,6 +291,24 @@ const ShowcasePage: React.FC = () => {
|
|||||||
</div>
|
</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>
|
</Card>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -11,15 +11,17 @@ import {
|
|||||||
Modal,
|
Modal,
|
||||||
Tag,
|
Tag,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Popconfirm,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
UploadOutlined,
|
UploadOutlined,
|
||||||
CameraOutlined,
|
CameraOutlined,
|
||||||
VideoCameraOutlined,
|
VideoCameraOutlined,
|
||||||
ArrowLeftOutlined,
|
ArrowLeftOutlined,
|
||||||
|
DeleteOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { history } from '@umijs/max';
|
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 { getFileDisplayUrl } from '@/utils/fileUrl';
|
||||||
import EnterpriseHeader from '@/components/EnterpriseHeader';
|
import EnterpriseHeader from '@/components/EnterpriseHeader';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@@ -163,6 +165,20 @@ const EnterpriseShowcase: React.FC = () => {
|
|||||||
return isValid;
|
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 (
|
return (
|
||||||
<div className="enterprise-showcase-page">
|
<div className="enterprise-showcase-page">
|
||||||
<EnterpriseHeader />
|
<EnterpriseHeader />
|
||||||
@@ -270,6 +286,24 @@ const EnterpriseShowcase: React.FC = () => {
|
|||||||
</div>
|
</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>
|
</Card>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -26,6 +26,22 @@ const statusValueEnum = {
|
|||||||
'2': { text: '已驳回', status: 'Error' },
|
'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 ShowcaseReview: React.FC = () => {
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
@@ -103,6 +119,7 @@ const ShowcaseReview: React.FC = () => {
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
|
position: 'relative',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setPreviewUrl(url);
|
setPreviewUrl(url);
|
||||||
@@ -135,10 +152,29 @@ const ShowcaseReview: React.FC = () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '上传用户ID',
|
title: '用户昵称',
|
||||||
dataIndex: 'bussinessid',
|
dataIndex: 'userName',
|
||||||
width: 120,
|
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: '审核状态',
|
title: '审核状态',
|
||||||
@@ -215,12 +251,14 @@ const ShowcaseReview: React.FC = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
search={{ labelWidth: 100 }}
|
search={{ labelWidth: 100 }}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
const { current, pageSize, bussinessid, reviewStatus } = params;
|
const { current, pageSize, reviewStatus, userName, userType, userPhone } = params;
|
||||||
const res = await getShowcaseReviewList({
|
const res = await getShowcaseReviewList({
|
||||||
current,
|
current,
|
||||||
pageSize,
|
pageSize,
|
||||||
bussinessid: bussinessid ? Number(bussinessid) : undefined,
|
|
||||||
reviewStatus,
|
reviewStatus,
|
||||||
|
userName,
|
||||||
|
userType,
|
||||||
|
userPhone,
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
data: res?.rows || [],
|
data: res?.rows || [],
|
||||||
|
|||||||
@@ -11,14 +11,20 @@ export interface ShowcaseReviewItem {
|
|||||||
reviewTime?: string;
|
reviewTime?: string;
|
||||||
createTime: string;
|
createTime: string;
|
||||||
updateTime?: string;
|
updateTime?: string;
|
||||||
|
/** JOIN app_user 查询字段 */
|
||||||
|
userName?: string; // 用户名称
|
||||||
|
userType?: string; // '0'=企业, '1'=求职者, '2'=网格员, '3'=政府人员
|
||||||
|
userPhone?: string; // 手机号码
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 风采审核列表查询参数 */
|
/** 风采审核列表查询参数 */
|
||||||
export interface ShowcaseReviewListParams {
|
export interface ShowcaseReviewListParams {
|
||||||
current?: number;
|
current?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
bussinessid?: number;
|
|
||||||
reviewStatus?: string;
|
reviewStatus?: string;
|
||||||
|
userName?: string;
|
||||||
|
userType?: string;
|
||||||
|
userPhone?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 风采审核操作参数 */
|
/** 风采审核操作参数 */
|
||||||
|
|||||||
@@ -161,3 +161,10 @@ export async function getShowcaseFileList(userId: number) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 删除我的风采文件 DELETE /app/file/{id} */
|
||||||
|
export async function deleteShowcaseFile(id: number) {
|
||||||
|
return request(`/app/file/${id}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user