新增文件上传页面,新增文件上传的公共组件(进度条,步骤条,上传区域)

This commit is contained in:
2025-03-31 19:53:26 +08:00
parent 65da73071d
commit 8fe88c1d15
19 changed files with 1492 additions and 32 deletions
+21 -13
View File
@@ -20,9 +20,22 @@ export const meta: MetaFunction = () => {
// 面包屑导航
export const handle = {
breadcrumb: "编辑提示词模板"
breadcrumb: (data:LoaderData) => {
if (data.mode === "edit") {
return "编辑提示词模板";
} else if (data.mode === "view") {
return "查看提示词模板";
} else {
return "新增提示词模板";
}
}
};
interface LoaderData {
template: PromptTemplate;
mode: string;
}
// 从模拟数据中获取模板
const getTemplateById = (id: string): PromptTemplate | undefined => {
// 与prompts._index.tsx中的模拟数据保持一致
@@ -87,6 +100,7 @@ const getTemplateById = (id: string): PromptTemplate | undefined => {
template_name: "采购合同-乙方资质抽取",
template_type: "Extraction",
description: "抽取采购合同中乙方的资质信息",
version: "v1.1",
status: "inactive",
created_by: "zhangsan",
@@ -417,10 +431,10 @@ export default function PromptsNew() {
<div>
<Link to="/prompts" className="mr-2">
<Button type="default" icon="ri-arrow-left-line">
</Button>
</Link>
{!isViewMode ? (
{!isViewMode && (
<Button
type="primary"
icon="ri-save-line"
@@ -429,12 +443,6 @@ export default function PromptsNew() {
>
{isSubmitting ? "保存中..." : "保存"}
</Button>
) : (
<Link to="/prompts">
<Button type="default" icon="ri-arrow-left-line">
</Button>
</Link>
)}
</div>
</div>
@@ -565,8 +573,8 @@ export default function PromptsNew() {
<div className="alert alert-warning mb-4">
<i className="ri-information-line"></i>
<div>
<div>使 <code>{"{varName}"}</code>使</div>
<div className="mt-1"><code>{"{docType}"}...</code></div>
<div>使 &#123;varName&#125;使</div>
<div className="mt-1">&#123;docType&#125;...</div>
</div>
</div>
@@ -595,7 +603,7 @@ export default function PromptsNew() {
<div className="alert alert-info mb-3">
<i className="ri-lightbulb-line"></i>
<div>
<div> <code>{"{varName}"}</code> 使</div>
<div> &#123;varName&#125; 使</div>
</div>
</div>
@@ -612,7 +620,7 @@ export default function PromptsNew() {
))
) : (
<div className="text-secondary text-sm italic" id="no-vars-message">
使 {"{变量名}"}
使 &#123;&#125;
</div>
)}
</div>