@liujitcn/kratos-admin-system 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -0
- package/dist/package/declarations/index.d.ts +1 -0
- package/dist/package/declarations/src/ai.d.ts +10 -0
- package/dist/package/declarations/src/api/base/ai_message.d.ts +27 -0
- package/dist/package/declarations/src/api/base/ai_session.d.ts +17 -0
- package/dist/package/declarations/src/api/base/ai_tool.d.ts +7 -0
- package/dist/package/declarations/src/api/base/oauth.d.ts +13 -0
- package/dist/package/declarations/src/api/base/sse.d.ts +31 -0
- package/dist/package/declarations/src/api/system/auth.d.ts +17 -0
- package/dist/package/declarations/src/api/system/base_api.d.ts +22 -0
- package/dist/package/declarations/src/api/system/base_area.d.ts +19 -0
- package/dist/package/declarations/src/api/system/base_config.d.ts +20 -0
- package/dist/package/declarations/src/api/system/base_dept.d.ts +21 -0
- package/dist/package/declarations/src/api/system/base_dict.d.ts +32 -0
- package/dist/package/declarations/src/api/system/base_job.d.ts +28 -0
- package/dist/package/declarations/src/api/system/base_log.d.ts +9 -0
- package/dist/package/declarations/src/api/system/base_menu.d.ts +21 -0
- package/dist/package/declarations/src/api/system/base_migration.d.ts +10 -0
- package/dist/package/declarations/src/api/system/base_post.d.ts +21 -0
- package/dist/package/declarations/src/api/system/base_role.d.ts +23 -0
- package/dist/package/declarations/src/api/system/base_tenant.d.ts +21 -0
- package/dist/package/declarations/src/api/system/base_user.d.ts +23 -0
- package/dist/package/declarations/src/api/system/code_gen.d.ts +14 -0
- package/dist/package/declarations/src/api/system/code_gen_column.d.ts +12 -0
- package/dist/package/declarations/src/api/system/code_gen_proto.d.ts +10 -0
- package/dist/package/declarations/src/api/system/code_gen_sse.d.ts +8 -0
- package/dist/package/declarations/src/api/system/code_gen_table.d.ts +18 -0
- package/dist/package/declarations/src/api/system/project_document.d.ts +9 -0
- package/dist/package/declarations/src/components/Ai.vue.d.ts +3 -0
- package/dist/package/declarations/src/index.d.ts +3 -0
- package/dist/package/declarations/src/module.d.ts +2 -0
- package/dist/package/declarations/src/rpc/base/v1/ai_message.d.ts +82 -0
- package/dist/package/declarations/src/rpc/base/v1/ai_session.d.ts +176 -0
- package/dist/package/declarations/src/rpc/base/v1/ai_tool.d.ts +59 -0
- package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +167 -0
- package/dist/package/declarations/src/rpc/base/v1/sse.d.ts +13 -0
- package/dist/package/declarations/src/rpc/common/v1/common.d.ts +57 -0
- package/dist/package/declarations/src/rpc/common/v1/enum.d.ts +58 -0
- package/dist/package/declarations/src/rpc/common/v1/types.d.ts +60 -0
- package/dist/package/declarations/src/rpc/google/protobuf/empty.d.ts +11 -0
- package/dist/package/declarations/src/rpc/google/protobuf/timestamp.d.ts +107 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +156 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +193 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_area.d.ts +82 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +112 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dept.d.ts +112 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +215 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +177 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +87 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +151 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_migration.d.ts +64 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_post.d.ts +112 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_role.d.ts +128 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_tenant.d.ts +112 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +161 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +155 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +143 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_proto.d.ts +86 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +149 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/project_document.d.ts +64 -0
- package/dist/package/declarations/src/rpc/system/common/v1/enum.d.ts +67 -0
- package/dist/package/declarations/src/views/ai/chat/attachment.d.ts +14 -0
- package/dist/package/declarations/src/views/ai/chat/components/AiMarkdown.vue.d.ts +13 -0
- package/dist/package/declarations/src/views/ai/chat/components/ChatPanel.vue.d.ts +45 -0
- package/dist/package/declarations/src/views/ai/chat/components/SessionPanel.vue.d.ts +34 -0
- package/dist/package/declarations/src/views/ai/chat/components/XSender.vue.d.ts +12 -0
- package/dist/package/declarations/src/views/ai/chat/index.vue.d.ts +4 -0
- package/dist/package/declarations/src/views/ai/chat/message.d.ts +59 -0
- package/dist/package/declarations/src/views/ai/chat/stream.d.ts +10 -0
- package/dist/package/declarations/src/views/ai/chat/types.d.ts +115 -0
- package/dist/package/declarations/src/views/base/api/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/area/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/dept/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/dict/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/dict/item.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/job/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/job/log.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/menu/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/migration/index.vue.d.ts +4 -0
- package/dist/package/declarations/src/views/base/post/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/role/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/tenant/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/user/components/dept-tree.vue.d.ts +19 -0
- package/dist/package/declarations/src/views/base/user/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/profile/components/base.vue.d.ts +13 -0
- package/dist/package/declarations/src/views/profile/components/password.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/profile/components/security.vue.d.ts +15 -0
- package/dist/package/declarations/src/views/profile/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/api-doc/index.vue.d.ts +4 -0
- package/dist/package/declarations/src/views/tool/code-gen/code-preview/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/code-gen/columns/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/code-gen/columns/option-copy.d.ts +25 -0
- package/dist/package/declarations/src/views/tool/code-gen/components/CodeGenProgressDialog.vue.d.ts +16 -0
- package/dist/package/declarations/src/views/tool/code-gen/components/CodePreviewPane.vue.d.ts +9 -0
- package/dist/package/declarations/src/views/tool/code-gen/config.d.ts +32 -0
- package/dist/package/declarations/src/views/tool/code-gen/preview/capabilities.d.ts +20 -0
- package/dist/package/declarations/src/views/tool/code-gen/preview/data.d.ts +42 -0
- package/dist/package/declarations/src/views/tool/code-gen/preview/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/code-gen/proto/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/code-gen/table/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/project-doc/index.vue.d.ts +4 -0
- package/dist/package/src/ai.ts +16 -0
- package/dist/package/src/api/base/ai_message.ts +139 -0
- package/dist/package/src/api/base/ai_session.ts +77 -0
- package/dist/package/src/api/base/ai_tool.ts +22 -0
- package/dist/package/src/api/base/oauth.ts +47 -0
- package/dist/package/src/api/base/sse.ts +192 -0
- package/dist/package/src/api/system/auth.ts +65 -0
- package/dist/package/src/api/system/base_api.ts +95 -0
- package/dist/package/src/api/system/base_area.ts +73 -0
- package/dist/package/src/api/system/base_config.ts +82 -0
- package/dist/package/src/api/system/base_dept.ts +83 -0
- package/dist/package/src/api/system/base_dict.ts +144 -0
- package/dist/package/src/api/system/base_job.ts +125 -0
- package/dist/package/src/api/system/base_log.ts +32 -0
- package/dist/package/src/api/system/base_menu.ts +83 -0
- package/dist/package/src/api/system/base_migration.ts +35 -0
- package/dist/package/src/api/system/base_post.ts +83 -0
- package/dist/package/src/api/system/base_role.ts +93 -0
- package/dist/package/src/api/system/base_tenant.ts +83 -0
- package/dist/package/src/api/system/base_user.ts +93 -0
- package/dist/package/src/api/system/code_gen.ts +56 -0
- package/dist/package/src/api/system/code_gen_column.ts +43 -0
- package/dist/package/src/api/system/code_gen_proto.ts +32 -0
- package/dist/package/src/api/system/code_gen_sse.ts +33 -0
- package/dist/package/src/api/system/code_gen_table.ts +74 -0
- package/dist/package/src/api/system/project_document.ts +33 -0
- package/dist/package/src/components/Ai.vue +57 -0
- package/dist/package/src/index.ts +3 -0
- package/dist/package/src/module.ts +17 -0
- package/dist/package/src/rpc/base/v1/ai_message.ts +98 -0
- package/dist/package/src/rpc/base/v1/ai_session.ts +214 -0
- package/dist/package/src/rpc/base/v1/ai_tool.ts +74 -0
- package/dist/package/src/rpc/base/v1/oauth.ts +199 -0
- package/dist/package/src/rpc/base/v1/sse.ts +22 -0
- package/dist/package/src/rpc/common/v1/common.ts +71 -0
- package/dist/package/src/rpc/common/v1/enum.ts +71 -0
- package/dist/package/src/rpc/common/v1/types.ts +77 -0
- package/dist/package/src/rpc/google/protobuf/empty.ts +19 -0
- package/dist/package/src/rpc/google/protobuf/timestamp.ts +115 -0
- package/dist/package/src/rpc/system/admin/v1/auth.ts +208 -0
- package/dist/package/src/rpc/system/admin/v1/base_api.ts +241 -0
- package/dist/package/src/rpc/system/admin/v1/base_area.ts +105 -0
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +140 -0
- package/dist/package/src/rpc/system/admin/v1/base_dept.ts +140 -0
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +249 -0
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +206 -0
- package/dist/package/src/rpc/system/admin/v1/base_log.ts +101 -0
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +195 -0
- package/dist/package/src/rpc/system/admin/v1/base_migration.ts +81 -0
- package/dist/package/src/rpc/system/admin/v1/base_post.ts +134 -0
- package/dist/package/src/rpc/system/admin/v1/base_role.ts +151 -0
- package/dist/package/src/rpc/system/admin/v1/base_tenant.ts +134 -0
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +190 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +176 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +170 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_proto.ts +104 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +179 -0
- package/dist/package/src/rpc/system/admin/v1/project_document.ts +79 -0
- package/dist/package/src/rpc/system/common/v1/enum.ts +80 -0
- package/dist/package/src/typings/swagger-ui-dist.d.ts +28 -0
- package/dist/package/src/typings/x-markdown-vue.d.ts +1 -0
- package/dist/package/src/views/ai/chat/attachment.ts +65 -0
- package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +162 -0
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +1861 -0
- package/dist/package/src/views/ai/chat/components/SessionPanel.vue +316 -0
- package/dist/package/src/views/ai/chat/components/XSender.vue +554 -0
- package/dist/package/src/views/ai/chat/index.vue +848 -0
- package/dist/package/src/views/ai/chat/message.ts +416 -0
- package/dist/package/src/views/ai/chat/stream.ts +115 -0
- package/dist/package/src/views/ai/chat/types.ts +126 -0
- package/dist/package/src/views/base/api/index.vue +455 -0
- package/dist/package/src/views/base/area/index.vue +269 -0
- package/dist/package/src/views/base/config/index.vue +530 -0
- package/dist/package/src/views/base/dept/index.vue +461 -0
- package/dist/package/src/views/base/dict/index.vue +304 -0
- package/dist/package/src/views/base/dict/item.vue +373 -0
- package/dist/package/src/views/base/job/index.vue +535 -0
- package/dist/package/src/views/base/job/log.vue +202 -0
- package/dist/package/src/views/base/log/index.vue +317 -0
- package/dist/package/src/views/base/menu/index.vue +944 -0
- package/dist/package/src/views/base/migration/index.vue +791 -0
- package/dist/package/src/views/base/post/index.vue +324 -0
- package/dist/package/src/views/base/role/index.vue +684 -0
- package/dist/package/src/views/base/tenant/index.vue +328 -0
- package/dist/package/src/views/base/user/components/dept-tree.vue +75 -0
- package/dist/package/src/views/base/user/index.vue +783 -0
- package/dist/package/src/views/profile/components/base.vue +320 -0
- package/dist/package/src/views/profile/components/password.vue +269 -0
- package/dist/package/src/views/profile/components/security.vue +443 -0
- package/dist/package/src/views/profile/index.vue +199 -0
- package/dist/package/src/views/tool/api-doc/index.vue +275 -0
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +233 -0
- package/dist/package/src/views/tool/code-gen/columns/index.vue +1456 -0
- package/dist/package/src/views/tool/code-gen/columns/option-copy.ts +125 -0
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +328 -0
- package/dist/package/src/views/tool/code-gen/components/CodePreviewPane.vue +42 -0
- package/dist/package/src/views/tool/code-gen/config.ts +175 -0
- package/dist/package/src/views/tool/code-gen/preview/capabilities.ts +34 -0
- package/dist/package/src/views/tool/code-gen/preview/data.ts +331 -0
- package/dist/package/src/views/tool/code-gen/preview/index.vue +831 -0
- package/dist/package/src/views/tool/code-gen/proto/index.vue +703 -0
- package/dist/package/src/views/tool/code-gen/table/index.vue +864 -0
- package/dist/package/src/views/tool/project-doc/index.vue +561 -0
- package/package.json +60 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import service from "@liujitcn/kratos-admin-core/request";
|
|
2
|
+
import {
|
|
3
|
+
type CodeGenTableForm,
|
|
4
|
+
type CodeGenTableService,
|
|
5
|
+
type CreateCodeGenTableRequest,
|
|
6
|
+
type DeleteCodeGenTableRequest,
|
|
7
|
+
type GetCodeGenTableRequest,
|
|
8
|
+
type ListCodeGenDatabaseTableRequest,
|
|
9
|
+
type ListCodeGenDatabaseTableResponse,
|
|
10
|
+
type PageCodeGenTableRequest,
|
|
11
|
+
type PageCodeGenTableResponse,
|
|
12
|
+
type UpdateCodeGenTableRequest
|
|
13
|
+
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/code_gen_table";
|
|
14
|
+
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
15
|
+
|
|
16
|
+
const CODE_GEN_TABLE_URL = "/v1/admin/code-gen/table";
|
|
17
|
+
const CODE_GEN_DATABASE_TABLE_URL = "/v1/admin/code-gen/database/table";
|
|
18
|
+
|
|
19
|
+
/** Admin代码生成表配置服务。 */
|
|
20
|
+
export class CodeGenTableServiceImpl implements CodeGenTableService {
|
|
21
|
+
/** 查询数据库表列表。 */
|
|
22
|
+
ListCodeGenDatabaseTable(request: ListCodeGenDatabaseTableRequest): Promise<ListCodeGenDatabaseTableResponse> {
|
|
23
|
+
return service<ListCodeGenDatabaseTableRequest, ListCodeGenDatabaseTableResponse>({
|
|
24
|
+
url: CODE_GEN_DATABASE_TABLE_URL,
|
|
25
|
+
method: "get",
|
|
26
|
+
params: request
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 查询代码生成表配置分页列表。 */
|
|
31
|
+
PageCodeGenTable(request: PageCodeGenTableRequest): Promise<PageCodeGenTableResponse> {
|
|
32
|
+
return service<PageCodeGenTableRequest, PageCodeGenTableResponse>({
|
|
33
|
+
url: CODE_GEN_TABLE_URL,
|
|
34
|
+
method: "get",
|
|
35
|
+
params: request
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** 查询代码生成表配置。 */
|
|
40
|
+
GetCodeGenTable(request: GetCodeGenTableRequest): Promise<CodeGenTableForm> {
|
|
41
|
+
return service<GetCodeGenTableRequest, CodeGenTableForm>({
|
|
42
|
+
url: `${CODE_GEN_TABLE_URL}/${request.id}`,
|
|
43
|
+
method: "get"
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** 创建代码生成表配置。 */
|
|
48
|
+
CreateCodeGenTable(request: CreateCodeGenTableRequest): Promise<Empty> {
|
|
49
|
+
return service<CodeGenTableForm | undefined, Empty>({
|
|
50
|
+
url: CODE_GEN_TABLE_URL,
|
|
51
|
+
method: "post",
|
|
52
|
+
data: request.code_gen_table
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** 更新代码生成表配置。 */
|
|
57
|
+
UpdateCodeGenTable(request: UpdateCodeGenTableRequest): Promise<Empty> {
|
|
58
|
+
return service<CodeGenTableForm | undefined, Empty>({
|
|
59
|
+
url: `${CODE_GEN_TABLE_URL}/${request.id}`,
|
|
60
|
+
method: "put",
|
|
61
|
+
data: request.code_gen_table
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** 删除代码生成表配置。 */
|
|
66
|
+
DeleteCodeGenTable(request: DeleteCodeGenTableRequest): Promise<Empty> {
|
|
67
|
+
return service<DeleteCodeGenTableRequest, Empty>({
|
|
68
|
+
url: `${CODE_GEN_TABLE_URL}/${request.ids}`,
|
|
69
|
+
method: "delete"
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const defCodeGenTableService = new CodeGenTableServiceImpl();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import service from "@liujitcn/kratos-admin-core/request";
|
|
2
|
+
import type {
|
|
3
|
+
GetProjectDocumentRequest,
|
|
4
|
+
ProjectDocument,
|
|
5
|
+
ProjectDocumentService,
|
|
6
|
+
TreeProjectDocumentRequest,
|
|
7
|
+
TreeProjectDocumentResponse
|
|
8
|
+
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/project_document";
|
|
9
|
+
|
|
10
|
+
const PROJECT_DOCUMENT_URL = "/v1/admin/project-document";
|
|
11
|
+
const PROJECT_DOCUMENT_TREE_URL = `${PROJECT_DOCUMENT_URL}/tree`;
|
|
12
|
+
|
|
13
|
+
/** Admin项目文档服务。 */
|
|
14
|
+
export class ProjectDocumentServiceImpl implements ProjectDocumentService {
|
|
15
|
+
/** 查询项目文档树。 */
|
|
16
|
+
TreeProjectDocument(request: TreeProjectDocumentRequest): Promise<TreeProjectDocumentResponse> {
|
|
17
|
+
return service<TreeProjectDocumentRequest, TreeProjectDocumentResponse>({
|
|
18
|
+
url: PROJECT_DOCUMENT_TREE_URL,
|
|
19
|
+
method: "get",
|
|
20
|
+
params: request
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** 查询项目文档详情。 */
|
|
25
|
+
GetProjectDocument(request: GetProjectDocumentRequest): Promise<ProjectDocument> {
|
|
26
|
+
return service<GetProjectDocumentRequest, ProjectDocument>({
|
|
27
|
+
url: `${PROJECT_DOCUMENT_URL}/${request.id}`,
|
|
28
|
+
method: "get"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const defProjectDocumentService = new ProjectDocumentServiceImpl();
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-tooltip v-if="aiRoute" effect="dark" content="AI助手" placement="bottom" :show-after="200">
|
|
3
|
+
<button class="ai" type="button" aria-label="打开AI助手" @click="openAi">
|
|
4
|
+
<el-icon><ChatDotRound /></el-icon>
|
|
5
|
+
</button>
|
|
6
|
+
</el-tooltip>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { ChatDotRound } from "@element-plus/icons-vue";
|
|
11
|
+
import { computed } from "vue";
|
|
12
|
+
import { useRouter } from "vue-router";
|
|
13
|
+
import { useAuthStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
14
|
+
import { navigateTo } from "@liujitcn/kratos-admin-core/navigation";
|
|
15
|
+
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
const authStore = useAuthStore();
|
|
18
|
+
const aiRoute = computed(() => {
|
|
19
|
+
return authStore.flatMenuListGet.find(item => item.name === "AiChat" && item.path);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** 打开隐藏的 AI 助手页面。 */
|
|
23
|
+
async function openAi() {
|
|
24
|
+
if (!aiRoute.value?.path) return;
|
|
25
|
+
await navigateTo(router, aiRoute.value.path);
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style scoped lang="scss">
|
|
30
|
+
.ai {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: 24px;
|
|
35
|
+
height: 24px;
|
|
36
|
+
padding: 0;
|
|
37
|
+
color: inherit;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
background: transparent;
|
|
40
|
+
border: 0;
|
|
41
|
+
transition:
|
|
42
|
+
color 0.16s ease,
|
|
43
|
+
transform 0.16s ease;
|
|
44
|
+
.el-icon {
|
|
45
|
+
font-size: 24px;
|
|
46
|
+
}
|
|
47
|
+
&:hover {
|
|
48
|
+
color: var(--el-color-primary);
|
|
49
|
+
transform: translateY(-1px);
|
|
50
|
+
}
|
|
51
|
+
&:focus-visible {
|
|
52
|
+
outline: 2px solid var(--el-color-primary-light-5);
|
|
53
|
+
outline-offset: 4px;
|
|
54
|
+
border-radius: 4px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import { User } from "@element-plus/icons-vue";
|
|
3
|
+
import { defineAdminModule } from "@liujitcn/kratos-admin-core";
|
|
4
|
+
import Ai from "./components/Ai.vue";
|
|
5
|
+
|
|
6
|
+
const viewModules = import.meta.glob<{ default: Component }>("./views/**/*.vue");
|
|
7
|
+
|
|
8
|
+
/** System 管理端业务模块。 */
|
|
9
|
+
export const systemAdminModule = defineAdminModule({
|
|
10
|
+
name: "system",
|
|
11
|
+
views: viewModules,
|
|
12
|
+
headerTools: [{ name: "ai", component: Ai }],
|
|
13
|
+
userMenuActions: [{ name: "profile", label: "个人中心", menuName: "Profile", icon: User }],
|
|
14
|
+
routeOptions: {
|
|
15
|
+
Profile: { reuseTabAcrossQuery: true }
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: base/v1/ai_message.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import type { AiAttachment, AiMessage, AiSession } from "./ai_session";
|
|
9
|
+
|
|
10
|
+
/** AI 助手消息更新请求 */
|
|
11
|
+
export interface UpdateAiMessageRequest {
|
|
12
|
+
/** 会话ID */
|
|
13
|
+
session_id: string;
|
|
14
|
+
/** 消息ID */
|
|
15
|
+
message_id: string;
|
|
16
|
+
/** 更新后的消息内容 */
|
|
17
|
+
content: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** AI 助手消息发送响应 */
|
|
21
|
+
export interface SendAiMessageResponse {
|
|
22
|
+
/** 新增消息列表 */
|
|
23
|
+
messages: AiMessage[];
|
|
24
|
+
/** 最新会话信息 */
|
|
25
|
+
session: AiSession | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** AI 助手消息删除请求 */
|
|
29
|
+
export interface DeleteAiMessageRequest {
|
|
30
|
+
/** 会话ID */
|
|
31
|
+
session_id: string;
|
|
32
|
+
/** 消息ID */
|
|
33
|
+
message_id: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** AI 助手消息删除响应 */
|
|
37
|
+
export interface DeleteAiMessageResponse {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** AI 助手消息发送请求 */
|
|
41
|
+
export interface SendAiMessageRequest {
|
|
42
|
+
/** 会话ID */
|
|
43
|
+
session_id: string;
|
|
44
|
+
/** 消息内容 */
|
|
45
|
+
content: string;
|
|
46
|
+
/** 附件列表 */
|
|
47
|
+
attachments: AiAttachment[];
|
|
48
|
+
/** 助手动作 */
|
|
49
|
+
action: AiAction | undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** AI 助手失败消息重试请求 */
|
|
53
|
+
export interface RetryAiUserMessageRequest {
|
|
54
|
+
/** 会话ID */
|
|
55
|
+
session_id: string;
|
|
56
|
+
/** 失败消息ID */
|
|
57
|
+
message_id: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** AI 助手输出重新生成请求 */
|
|
61
|
+
export interface RegenerateAiMessageRequest {
|
|
62
|
+
/** 会话ID */
|
|
63
|
+
session_id: string;
|
|
64
|
+
/** 消息ID */
|
|
65
|
+
message_id: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** AI 助手动作 */
|
|
69
|
+
export interface AiAction {
|
|
70
|
+
/** 流程标识 */
|
|
71
|
+
flow: string;
|
|
72
|
+
/** 流程步骤 */
|
|
73
|
+
step: string;
|
|
74
|
+
/** 动作类型 */
|
|
75
|
+
type: string;
|
|
76
|
+
/** 动作负载JSON */
|
|
77
|
+
payload_json: string;
|
|
78
|
+
/** 动作来源消息ID */
|
|
79
|
+
source_message_id: string;
|
|
80
|
+
/** 动作唯一ID */
|
|
81
|
+
action_id: string;
|
|
82
|
+
/** 流程状态版本 */
|
|
83
|
+
flow_version: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Base AI 助手消息服务 */
|
|
87
|
+
export interface AiMessageService {
|
|
88
|
+
/** 更新 AI 助手消息并重新生成输出 */
|
|
89
|
+
UpdateAiMessage(request: UpdateAiMessageRequest): Promise<SendAiMessageResponse>;
|
|
90
|
+
/** 删除 AI 助手消息 */
|
|
91
|
+
DeleteAiMessage(request: DeleteAiMessageRequest): Promise<DeleteAiMessageResponse>;
|
|
92
|
+
/** 发送 AI 助手消息 */
|
|
93
|
+
SendAiMessage(request: SendAiMessageRequest): Promise<SendAiMessageResponse>;
|
|
94
|
+
/** 重试失败的 AI 助手消息 */
|
|
95
|
+
RetryAiUserMessage(request: RetryAiUserMessageRequest): Promise<SendAiMessageResponse>;
|
|
96
|
+
/** 重新生成 AI 助手输出 */
|
|
97
|
+
RegenerateAiMessage(request: RegenerateAiMessageRequest): Promise<SendAiMessageResponse>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: base/v1/ai_session.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import type { AiMessageStatus, Terminal } from "../../common/v1/enum";
|
|
9
|
+
import type { Timestamp } from "../../google/protobuf/timestamp";
|
|
10
|
+
import type { AiToolCall } from "./ai_tool";
|
|
11
|
+
|
|
12
|
+
/** AI 助手消息列表查询条件 */
|
|
13
|
+
export interface ListAiMessageRequest {
|
|
14
|
+
/** 会话ID */
|
|
15
|
+
session_id: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** AI 助手消息列表响应 */
|
|
19
|
+
export interface ListAiMessageResponse {
|
|
20
|
+
/** 消息列表 */
|
|
21
|
+
messages: AiMessage[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** AI 助手会话列表查询条件 */
|
|
25
|
+
export interface ListAiSessionRequest {
|
|
26
|
+
/** 终端类型:枚举【Terminal】 */
|
|
27
|
+
terminal: Terminal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** AI 助手会话列表响应 */
|
|
31
|
+
export interface ListAiSessionResponse {
|
|
32
|
+
/** 会话列表 */
|
|
33
|
+
sessions: AiSession[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** AI 助手会话创建请求 */
|
|
37
|
+
export interface CreateAiSessionRequest {
|
|
38
|
+
/** 会话标题 */
|
|
39
|
+
title: string;
|
|
40
|
+
/** 终端类型:枚举【Terminal】 */
|
|
41
|
+
terminal: Terminal;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** AI 助手会话创建响应 */
|
|
45
|
+
export interface CreateAiSessionResponse {
|
|
46
|
+
/** 会话信息 */
|
|
47
|
+
session: AiSession | undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** AI 助手分支会话创建请求 */
|
|
51
|
+
export interface CreateAiSessionBranchRequest {
|
|
52
|
+
/** 来源会话ID */
|
|
53
|
+
source_session_id: string;
|
|
54
|
+
/** 分支锚点消息ID */
|
|
55
|
+
anchor_message_id: string;
|
|
56
|
+
/** 分支会话标题 */
|
|
57
|
+
title: string;
|
|
58
|
+
/** 终端类型:枚举【Terminal】 */
|
|
59
|
+
terminal: Terminal;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** AI 助手分支会话创建响应 */
|
|
63
|
+
export interface CreateAiSessionBranchResponse {
|
|
64
|
+
/** 新会话信息 */
|
|
65
|
+
session:
|
|
66
|
+
| AiSession
|
|
67
|
+
| undefined;
|
|
68
|
+
/** 新会话消息列表 */
|
|
69
|
+
messages: AiMessage[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** AI 助手会话更新请求 */
|
|
73
|
+
export interface UpdateAiSessionRequest {
|
|
74
|
+
/** 会话ID */
|
|
75
|
+
id: string;
|
|
76
|
+
/** 会话标题 */
|
|
77
|
+
title: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** AI 助手会话更新响应 */
|
|
81
|
+
export interface UpdateAiSessionResponse {
|
|
82
|
+
/** 会话信息 */
|
|
83
|
+
session: AiSession | undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** AI 助手会话删除请求 */
|
|
87
|
+
export interface DeleteAiSessionRequest {
|
|
88
|
+
/** 会话ID */
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** AI 助手会话删除响应 */
|
|
93
|
+
export interface DeleteAiSessionResponse {
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** AI 助手会话 */
|
|
97
|
+
export interface AiSession {
|
|
98
|
+
/** 会话ID */
|
|
99
|
+
id: string;
|
|
100
|
+
/** 会话标题 */
|
|
101
|
+
title: string;
|
|
102
|
+
/** 会话摘要 */
|
|
103
|
+
summary: string;
|
|
104
|
+
/** 更新时间 */
|
|
105
|
+
updated_at:
|
|
106
|
+
| Timestamp
|
|
107
|
+
| undefined;
|
|
108
|
+
/** 终端类型:枚举【Terminal】 */
|
|
109
|
+
terminal: Terminal;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** AI 助手消息 */
|
|
113
|
+
export interface AiMessage {
|
|
114
|
+
/** 消息ID */
|
|
115
|
+
id: string;
|
|
116
|
+
/** 输入内容 */
|
|
117
|
+
input_content:
|
|
118
|
+
| AiInputContent
|
|
119
|
+
| undefined;
|
|
120
|
+
/** 输出内容 */
|
|
121
|
+
output_content:
|
|
122
|
+
| AiOutputContent
|
|
123
|
+
| undefined;
|
|
124
|
+
/** 附件列表 */
|
|
125
|
+
attachments: AiAttachment[];
|
|
126
|
+
/** 创建时间 */
|
|
127
|
+
created_at:
|
|
128
|
+
| Timestamp
|
|
129
|
+
| undefined;
|
|
130
|
+
/** 消息生成状态:枚举【AiMessageStatus】 */
|
|
131
|
+
status: AiMessageStatus;
|
|
132
|
+
/** Token 统计 */
|
|
133
|
+
token:
|
|
134
|
+
| AiToken
|
|
135
|
+
| undefined;
|
|
136
|
+
/** 本次消息使用的工具调用记录 */
|
|
137
|
+
tools: AiToolCall[];
|
|
138
|
+
/** 首 Token 耗时毫秒 */
|
|
139
|
+
first_token_ms: number;
|
|
140
|
+
/** 总耗时毫秒 */
|
|
141
|
+
duration_ms: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** AI 助手输入内容 */
|
|
145
|
+
export interface AiInputContent {
|
|
146
|
+
/** 内容类型 */
|
|
147
|
+
kind: string;
|
|
148
|
+
/** 内容正文 */
|
|
149
|
+
content: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** AI 助手输出内容 */
|
|
153
|
+
export interface AiOutputContent {
|
|
154
|
+
/** 内容类型 */
|
|
155
|
+
kind: string;
|
|
156
|
+
/** 内容正文 */
|
|
157
|
+
content: string;
|
|
158
|
+
/** 回复来源:llm/fallback */
|
|
159
|
+
reply_source: string;
|
|
160
|
+
/** 回复使用的模型名称 */
|
|
161
|
+
model: string;
|
|
162
|
+
/** 是否为降级回复 */
|
|
163
|
+
fallback: boolean;
|
|
164
|
+
/** 降级原因 */
|
|
165
|
+
fallback_reason: string;
|
|
166
|
+
/** 流程标识 */
|
|
167
|
+
flow: string;
|
|
168
|
+
/** 流程步骤 */
|
|
169
|
+
step: string;
|
|
170
|
+
/** 移动端结构化内容JSON */
|
|
171
|
+
blocks_json: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** AI 助手 Token 统计 */
|
|
175
|
+
export interface AiToken {
|
|
176
|
+
/** 输入 Token 数 */
|
|
177
|
+
input: number;
|
|
178
|
+
/** 输出 Token 数 */
|
|
179
|
+
output: number;
|
|
180
|
+
/** 缓存 Token 数 */
|
|
181
|
+
cache: number;
|
|
182
|
+
/** 总 Token 数 */
|
|
183
|
+
total: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** AI 助手附件 */
|
|
187
|
+
export interface AiAttachment {
|
|
188
|
+
/** 附件ID */
|
|
189
|
+
id: string;
|
|
190
|
+
/** 附件名称 */
|
|
191
|
+
name: string;
|
|
192
|
+
/** 附件大小 */
|
|
193
|
+
size: number;
|
|
194
|
+
/** 附件地址 */
|
|
195
|
+
url: string;
|
|
196
|
+
/** 附件 MIME 类型 */
|
|
197
|
+
mime_type: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Base AI 助手会话服务 */
|
|
201
|
+
export interface AiSessionService {
|
|
202
|
+
/** 查询 AI 助手消息列表 */
|
|
203
|
+
ListAiMessage(request: ListAiMessageRequest): Promise<ListAiMessageResponse>;
|
|
204
|
+
/** 查询 AI 助手会话列表 */
|
|
205
|
+
ListAiSession(request: ListAiSessionRequest): Promise<ListAiSessionResponse>;
|
|
206
|
+
/** 创建 AI 助手会话 */
|
|
207
|
+
CreateAiSession(request: CreateAiSessionRequest): Promise<CreateAiSessionResponse>;
|
|
208
|
+
/** 从指定消息创建 AI 助手分支会话 */
|
|
209
|
+
CreateAiSessionBranch(request: CreateAiSessionBranchRequest): Promise<CreateAiSessionBranchResponse>;
|
|
210
|
+
/** 更新 AI 助手会话 */
|
|
211
|
+
UpdateAiSession(request: UpdateAiSessionRequest): Promise<UpdateAiSessionResponse>;
|
|
212
|
+
/** 删除 AI 助手会话 */
|
|
213
|
+
DeleteAiSession(request: DeleteAiSessionRequest): Promise<DeleteAiSessionResponse>;
|
|
214
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: base/v1/ai_tool.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import type { Terminal } from "../../common/v1/enum";
|
|
9
|
+
|
|
10
|
+
/** AI 助手快捷入口列表查询条件 */
|
|
11
|
+
export interface ListAiShortcutRequest {
|
|
12
|
+
/** 终端类型:枚举【Terminal】 */
|
|
13
|
+
terminal: Terminal;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** AI 助手快捷入口列表响应 */
|
|
17
|
+
export interface ListAiShortcutResponse {
|
|
18
|
+
/** 快捷入口列表 */
|
|
19
|
+
shortcuts: AiShortcut[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** AI 助手快捷入口 */
|
|
23
|
+
export interface AiShortcut {
|
|
24
|
+
/** 快捷入口标识 */
|
|
25
|
+
key: string;
|
|
26
|
+
/** 展示标题 */
|
|
27
|
+
title: string;
|
|
28
|
+
/** 发送给助手的提示词 */
|
|
29
|
+
prompt: string;
|
|
30
|
+
/** 快捷入口动作 */
|
|
31
|
+
action:
|
|
32
|
+
| AiShortcutAction
|
|
33
|
+
| undefined;
|
|
34
|
+
/** 依赖工具列表 */
|
|
35
|
+
required_tools: string[];
|
|
36
|
+
/** 排序值 */
|
|
37
|
+
sort: number;
|
|
38
|
+
/** 分组名称 */
|
|
39
|
+
group: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** AI 助手快捷入口动作 */
|
|
43
|
+
export interface AiShortcutAction {
|
|
44
|
+
/** 流程标识 */
|
|
45
|
+
flow: string;
|
|
46
|
+
/** 流程步骤 */
|
|
47
|
+
step: string;
|
|
48
|
+
/** 动作类型 */
|
|
49
|
+
type: string;
|
|
50
|
+
/** 动作负载JSON */
|
|
51
|
+
payload_json: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** AI 助手工具调用记录 */
|
|
55
|
+
export interface AiToolCall {
|
|
56
|
+
/** 工具类型:function/server */
|
|
57
|
+
type: string;
|
|
58
|
+
/** 工具名称 */
|
|
59
|
+
name: string;
|
|
60
|
+
/** 工具展示名称 */
|
|
61
|
+
title: string;
|
|
62
|
+
/** 工具调用状态 */
|
|
63
|
+
status: string;
|
|
64
|
+
/** 工具原始入参JSON */
|
|
65
|
+
input: string;
|
|
66
|
+
/** 工具原始出参JSON */
|
|
67
|
+
output: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Base AI 助手工具服务 */
|
|
71
|
+
export interface AiToolService {
|
|
72
|
+
/** 查询 AI 助手快捷入口列表 */
|
|
73
|
+
ListAiShortcut(request: ListAiShortcutRequest): Promise<ListAiShortcutResponse>;
|
|
74
|
+
}
|