feat: 1.修改提示词模板的不用角色的操作权限。

2. 对接数据看板的数据。
3. 添加入口模块管理的页面。
This commit is contained in:
2025-11-21 17:16:07 +08:00
parent 3850d05bdd
commit dab0835605
13 changed files with 1877 additions and 297 deletions
+21 -34
View File
@@ -317,9 +317,9 @@ export default function PromptsNew() {
const newFormData = {
...template,
id: mode === "clone" ? "" : template.id,
template_name: mode === "clone" ? `${template.template_name} (副本)` : template.template_name,
version: mode === "clone" ? "v1.0" : template.version,
id: template.id,
template_name: template.template_name,
version: template.version,
variables: variablesJson
};
@@ -343,13 +343,11 @@ export default function PromptsNew() {
}
setIsViewMode(mode === "view");
if (mode === "view") {
setPageTitle("查看提示词模板");
} else if (mode === "edit") {
setPageTitle("编辑提示词模板");
} else if (mode === "clone") {
setPageTitle("复制创建提示词模板");
} else {
setPageTitle("新增提示词模板");
}
@@ -485,7 +483,7 @@ export default function PromptsNew() {
<div className="alert alert-info">
<i className="ri-information-line"></i>
<div>
<div>&quot;&quot;</div>
<div></div>
</div>
</div>
)}
@@ -780,33 +778,22 @@ export default function PromptsNew() {
</div>
{/* 底部按钮区域 */}
<div className="flex justify-between mt-6">
<div>
{isViewMode && (
<Link to={`/prompts/new?id=${formData.id}&mode=clone`}>
<button type="button" className="ant-btn ant-btn-default">
<i className="ri-file-copy-line"></i>
</button>
</Link>
)}
</div>
<div>
<Link to="/prompts" className="mr-2">
<button type="button" className="ant-btn ant-btn-default">
<i className="ri-close-line"></i>
</button>
</Link>
{!isViewMode && (
<button
form="template-form"
className="ant-btn ant-btn-primary"
disabled={isSubmitting}
id="save-btn-bottom"
>
<i className="ri-save-line"></i> {isSubmitting ? "保存中..." : "保存"}
</button>
)}
</div>
<div className="flex justify-end mt-6">
<Link to="/prompts" className="mr-2">
<button type="button" className="ant-btn ant-btn-default">
<i className="ri-close-line"></i>
</button>
</Link>
{!isViewMode && (
<button
form="template-form"
className="ant-btn ant-btn-primary"
disabled={isSubmitting}
id="save-btn-bottom"
>
<i className="ri-save-line"></i> {isSubmitting ? "保存中..." : "保存"}
</button>
)}
</div>
</Form>
</div>