From 10d6ce2b0dc64344f85362b25d85620a8ff98722 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Tue, 9 Jun 2026 17:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=90=E7=A4=BA=E8=AF=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D=E5=88=9B=E5=BB=BA=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD=EF=BC=8C=E8=B0=83=E6=95=B4=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E7=B1=BB=E5=9E=8B=E6=A0=87=E8=AF=86=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8F=90=E7=A4=BA=E8=AF=8D=E9=80=89=E6=8B=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=92=8C=E8=A1=A8=E5=8D=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 1 + src/api/settings/promptManager/index.ts | 31 +- .../creation/component/PromptSelector.vue | 296 +++++++++++++++++- src/views/settings/promptManager/index.vue | 8 +- 4 files changed, 321 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 97b6276..675c767 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -197,6 +197,7 @@ These rules capture long-term repository preferences confirmed by the user and s ### Communication and Risk Rules +- 默认使用中文进行回复、说明、提问与思考表达;如果用户明确要求使用其他语言,再按用户要求切换。 - Before changing code, confirm with the user when a change involves a rewrite, global side effects, unclear requirements, or a second attempt that still has not solved the issue. - After changes, explain what changed, why it was changed that way, and any remaining risks or points worth confirming. - When a requirement still depends on a meaningful assumption, ask the user first instead of silently choosing a direction. diff --git a/src/api/settings/promptManager/index.ts b/src/api/settings/promptManager/index.ts index bde9e3a..6d6f526 100644 --- a/src/api/settings/promptManager/index.ts +++ b/src/api/settings/promptManager/index.ts @@ -11,7 +11,7 @@ export interface PromptItem { deletedAt?: string | null; nodeType: string; prompt: string; - sourceType: number; // 0-自定义 1-公共 + sourceType: number; // 1-管理员 2-用户 } export interface PromptListResponse { @@ -32,6 +32,23 @@ export interface CreatePromptParams { sourceType: number; } +export interface CheckIsSuperAdminResponse { + isSuperAdmin: boolean; +} + +export interface CreatePromptResponse { + id?: number | string; + tenantId?: number; + creator?: string; + createdAt?: string; + updater?: string; + updatedAt?: string; + deletedAt?: string | null; + nodeType?: string; + prompt?: string; + sourceType?: number; +} + export interface UpdatePromptParams extends CreatePromptParams { id: number | string; } @@ -92,7 +109,7 @@ export function getMyPromptList(params: PromptListParams) { * 创建提示词 */ export function createPrompt(data: CreatePromptParams) { - return request({ + return request({ url: '/ai-agent/node/prompt/create', method: 'post', data, @@ -120,3 +137,13 @@ export function deletePrompt(id: number | string) { data: { id }, }); } + +/** + * 判断当前用户是否为超级管理员 + */ +export function checkIsSuperAdmin() { + return request({ + url: '/admin-go/api/v1/system/user/checkIsSuperAdmin', + method: 'get', + }); +} diff --git a/src/views/settings/creation/component/PromptSelector.vue b/src/views/settings/creation/component/PromptSelector.vue index d9ac241..1694ef4 100644 --- a/src/views/settings/creation/component/PromptSelector.vue +++ b/src/views/settings/creation/component/PromptSelector.vue @@ -16,6 +16,10 @@ 搜索 + + + 新增提示词 + @@ -27,11 +31,20 @@ - + + + + diff --git a/src/views/settings/promptManager/index.vue b/src/views/settings/promptManager/index.vue index 9257f8d..41d23c6 100644 --- a/src/views/settings/promptManager/index.vue +++ b/src/views/settings/promptManager/index.vue @@ -26,8 +26,8 @@ @@ -128,7 +128,7 @@ const nodeOptions = computed(() => { const createForm = reactive({ nodeType: '', prompt: '', - sourceType: 0 as number, + sourceType: 2 as number, }); // 加载节点库 @@ -269,7 +269,7 @@ const cancelCreate = () => { editId.value = null; createForm.nodeType = ''; createForm.prompt = ''; - createForm.sourceType = 0; + createForm.sourceType = 2; }; // 分页