fix: 完善提示词管理页面的优化,数据库中添加相关字段来区分vlm和llm提示词。评查点设置中抽取设置的多模态抽取的类型通过查询数据库来返回数据。
This commit is contained in:
@@ -8,6 +8,7 @@ import { FilterPanel, FilterSelect, SearchFilter } from "~/components/ui/FilterP
|
||||
import { Table } from "~/components/ui/Table";
|
||||
import { Pagination } from "~/components/ui/Pagination";
|
||||
import { getPromptTemplates, deletePromptTemplate, type PromptTemplateUI } from "~/api/prompts/prompts";
|
||||
import { toastService } from "~/components/ui";
|
||||
|
||||
// 样式链接
|
||||
export function links() {
|
||||
@@ -65,7 +66,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
if (result.error) {
|
||||
console.error('获取提示词模板失败:', result.error);
|
||||
return Response.json(
|
||||
{
|
||||
{
|
||||
templates: [],
|
||||
total: 0,
|
||||
pageSize,
|
||||
@@ -75,10 +76,10 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
{ status: result.status || 500 }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// console.log(`成功加载${result.data?.templates.length || 0}条提示词模板数据`);
|
||||
|
||||
return Response.json({
|
||||
|
||||
return Response.json({
|
||||
templates: result.data?.templates || [],
|
||||
total: result.data?.total || 0,
|
||||
pageSize,
|
||||
@@ -218,10 +219,10 @@ export default function PromptsIndex() {
|
||||
useEffect(() => {
|
||||
if (fetcher.state === 'idle' && fetcher.data) {
|
||||
if (fetcher.data.success) {
|
||||
alert('删除成功!');
|
||||
window.location.reload();
|
||||
toastService.success('删除成功!');
|
||||
// Remix 会自动重新验证 loader 数据,无需手动刷新页面
|
||||
} else if (fetcher.data.error) {
|
||||
alert(`删除失败: ${fetcher.data.error}`);
|
||||
toastService.error(`删除失败: ${fetcher.data.error}`);
|
||||
}
|
||||
}
|
||||
}, [fetcher.state, fetcher.data]);
|
||||
|
||||
Reference in New Issue
Block a user