fix:修复提示词工坊相关功能 8
This commit is contained in:
@@ -233,6 +233,10 @@ export default function PromptWorkshop() {
|
|||||||
setIsSubmitModalOpen(false);
|
setIsSubmitModalOpen(false);
|
||||||
submitForm.resetFields();
|
submitForm.resetFields();
|
||||||
loadMySubmissions();
|
loadMySubmissions();
|
||||||
|
// 如果是服务端管理员,刷新待审核列表
|
||||||
|
if (isServerAdmin) {
|
||||||
|
loadAdminSubmissions();
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to submit:', error);
|
console.error('Failed to submit:', error);
|
||||||
message.error('提交失败');
|
message.error('提交失败');
|
||||||
@@ -247,6 +251,10 @@ export default function PromptWorkshop() {
|
|||||||
await promptWorkshopApi.withdrawSubmission(submissionId);
|
await promptWorkshopApi.withdrawSubmission(submissionId);
|
||||||
message.success('已撤回');
|
message.success('已撤回');
|
||||||
loadMySubmissions();
|
loadMySubmissions();
|
||||||
|
// 如果是服务端管理员,刷新待审核列表
|
||||||
|
if (isServerAdmin) {
|
||||||
|
loadAdminSubmissions();
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to withdraw:', error);
|
console.error('Failed to withdraw:', error);
|
||||||
message.error('撤回失败');
|
message.error('撤回失败');
|
||||||
@@ -261,11 +269,16 @@ export default function PromptWorkshop() {
|
|||||||
okText: '删除',
|
okText: '删除',
|
||||||
okType: 'danger',
|
okType: 'danger',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
|
centered: true,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
try {
|
try {
|
||||||
await promptWorkshopApi.deleteSubmission(submission.id);
|
await promptWorkshopApi.deleteSubmission(submission.id);
|
||||||
message.success('删除成功');
|
message.success('删除成功');
|
||||||
loadMySubmissions();
|
loadMySubmissions();
|
||||||
|
// 如果是服务端管理员,刷新相关列表
|
||||||
|
if (isServerAdmin) {
|
||||||
|
loadAdminSubmissions();
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to delete submission:', error);
|
console.error('Failed to delete submission:', error);
|
||||||
message.error('删除失败');
|
message.error('删除失败');
|
||||||
@@ -667,6 +680,7 @@ export default function PromptWorkshop() {
|
|||||||
okText: '删除',
|
okText: '删除',
|
||||||
okType: 'danger',
|
okType: 'danger',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
|
centered: true,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
try {
|
try {
|
||||||
await promptWorkshopApi.adminDeleteItem(item.id);
|
await promptWorkshopApi.adminDeleteItem(item.id);
|
||||||
@@ -736,8 +750,10 @@ export default function PromptWorkshop() {
|
|||||||
setReviewModalOpen(false);
|
setReviewModalOpen(false);
|
||||||
setReviewingSubmission(null);
|
setReviewingSubmission(null);
|
||||||
reviewForm.resetFields();
|
reviewForm.resetFields();
|
||||||
|
// 刷新所有相关数据
|
||||||
loadAdminSubmissions();
|
loadAdminSubmissions();
|
||||||
loadItems();
|
loadItems();
|
||||||
|
loadPublishedItems(); // 通过时会新增到已发布列表
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to review:', error);
|
console.error('Failed to review:', error);
|
||||||
message.error('审核失败');
|
message.error('审核失败');
|
||||||
@@ -1050,6 +1066,7 @@ export default function PromptWorkshop() {
|
|||||||
}}
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
width={isMobile ? '100%' : 600}
|
width={isMobile ? '100%' : 600}
|
||||||
|
centered
|
||||||
>
|
>
|
||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
@@ -1148,6 +1165,7 @@ export default function PromptWorkshop() {
|
|||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
width={isMobile ? '100%' : 700}
|
width={isMobile ? '100%' : 700}
|
||||||
|
centered
|
||||||
>
|
>
|
||||||
{detailItem && (
|
{detailItem && (
|
||||||
<div>
|
<div>
|
||||||
@@ -1211,6 +1229,7 @@ export default function PromptWorkshop() {
|
|||||||
}}
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
width={700}
|
width={700}
|
||||||
|
centered
|
||||||
>
|
>
|
||||||
{reviewingSubmission && (
|
{reviewingSubmission && (
|
||||||
<div>
|
<div>
|
||||||
@@ -1278,6 +1297,7 @@ export default function PromptWorkshop() {
|
|||||||
}}
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
width={600}
|
width={600}
|
||||||
|
centered
|
||||||
>
|
>
|
||||||
<Form
|
<Form
|
||||||
form={addOfficialForm}
|
form={addOfficialForm}
|
||||||
@@ -1347,6 +1367,7 @@ export default function PromptWorkshop() {
|
|||||||
}}
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
width={600}
|
width={600}
|
||||||
|
centered
|
||||||
>
|
>
|
||||||
<Form
|
<Form
|
||||||
form={editForm}
|
form={editForm}
|
||||||
|
|||||||
Reference in New Issue
Block a user