@liujitcn/kratos-admin-system 0.0.17 → 0.0.19
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/dist/package/declarations/src/api/system/base_user.d.ts +1 -1
- package/dist/package/declarations/src/rpc/base/v1/ai_session.d.ts +1 -1
- package/dist/package/declarations/src/rpc/base/v1/ai_tool.d.ts +1 -1
- package/dist/package/declarations/src/rpc/base/v1/enum.d.ts +43 -0
- package/dist/package/declarations/src/rpc/common/v1/analytics.d.ts +69 -0
- package/dist/package/declarations/src/rpc/common/v1/enum.d.ts +1 -50
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +2 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +29 -0
- package/dist/package/src/api/system/base_user.ts +1 -1
- package/dist/package/src/rpc/base/v1/ai_session.ts +1 -1
- package/dist/package/src/rpc/base/v1/ai_tool.ts +1 -1
- package/dist/package/src/rpc/base/v1/enum.ts +54 -0
- package/dist/package/src/rpc/common/v1/analytics.ts +85 -0
- package/dist/package/src/rpc/common/v1/enum.ts +1 -55
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +2 -1
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +38 -0
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +5 -5
- package/dist/package/src/views/ai/chat/index.vue +2 -2
- package/dist/package/src/views/ai/chat/message.ts +10 -10
- package/dist/package/src/views/base/config/index.vue +2 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { type BaseUserForm, type BaseUserService, type CreateBaseUserRequest, ty
|
|
|
2
2
|
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
3
3
|
import type { SelectOptionResponse } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
4
4
|
/** Admin用户服务 */
|
|
5
|
-
export declare class BaseUserServiceImpl implements Omit<BaseUserService, "SetBaseUserAppRole"> {
|
|
5
|
+
export declare class BaseUserServiceImpl implements Omit<BaseUserService, "SetBaseUserAppRole" | "SummaryBaseUser"> {
|
|
6
6
|
/** 查询用户下拉选择 */
|
|
7
7
|
OptionBaseUser(request: OptionBaseUserRequest): Promise<SelectOptionResponse>;
|
|
8
8
|
/** 查询用户列表 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AiMessageStatus, Terminal } from "../../common/v1/enum";
|
|
2
1
|
import type { Timestamp } from "../../google/protobuf/timestamp";
|
|
3
2
|
import type { AiToolCall } from "./ai_tool";
|
|
3
|
+
import type { AiMessageStatus, Terminal } from "./enum";
|
|
4
4
|
/** AI 助手消息列表查询条件 */
|
|
5
5
|
export interface ListAiMessageRequest {
|
|
6
6
|
/** 会话ID */
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** AI 助手消息状态 */
|
|
2
|
+
export declare enum AiMessageStatus {
|
|
3
|
+
/** UNKNOWN_AMS - 未知AI助手消息状态 */
|
|
4
|
+
UNKNOWN_AMS = 0,
|
|
5
|
+
/** GENERATING_AMS - 生成中 */
|
|
6
|
+
GENERATING_AMS = 1,
|
|
7
|
+
/** SUCCESS_AMS - 成功 */
|
|
8
|
+
SUCCESS_AMS = 2,
|
|
9
|
+
/** FAILED_AMS - 失败 */
|
|
10
|
+
FAILED_AMS = 3
|
|
11
|
+
}
|
|
12
|
+
/** 终端类型 */
|
|
13
|
+
export declare enum Terminal {
|
|
14
|
+
/** UNKNOWN_TERMINAL - 未知终端 */
|
|
15
|
+
UNKNOWN_TERMINAL = 0,
|
|
16
|
+
/** TERMINAL_APP - 移动端 */
|
|
17
|
+
TERMINAL_APP = 1,
|
|
18
|
+
/** TERMINAL_ADMIN - 管理端 */
|
|
19
|
+
TERMINAL_ADMIN = 2
|
|
20
|
+
}
|
|
21
|
+
/** 系统配置位置 */
|
|
22
|
+
export declare enum BaseConfigSite {
|
|
23
|
+
UNKNOWN_BCS = 0,
|
|
24
|
+
/** SYSTEM - 系统内使用 */
|
|
25
|
+
SYSTEM = 1,
|
|
26
|
+
/** ADMIN - 管理端 */
|
|
27
|
+
ADMIN = 2,
|
|
28
|
+
/** APP - 移动端 */
|
|
29
|
+
APP = 3
|
|
30
|
+
}
|
|
31
|
+
/** 密码加密场景枚举 */
|
|
32
|
+
export declare enum PasswordCryptoScene {
|
|
33
|
+
/** UNKNOWN_PCS - 未指定密码加密场景 */
|
|
34
|
+
UNKNOWN_PCS = 0,
|
|
35
|
+
/** LOGIN - 登录密码加密场景 */
|
|
36
|
+
LOGIN = 1,
|
|
37
|
+
/** CREATE_BASE_USER - 新增后台用户密码加密场景 */
|
|
38
|
+
CREATE_BASE_USER = 2,
|
|
39
|
+
/** RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景 */
|
|
40
|
+
RESET_BASE_USER_PASSWORD = 3,
|
|
41
|
+
/** UPDATE_USER_PASSWORD - 个人修改密码加密场景 */
|
|
42
|
+
UPDATE_USER_PASSWORD = 4
|
|
43
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** 分析时间类型。 */
|
|
2
|
+
export declare enum AnalyticsTimeType {
|
|
3
|
+
/** ANALYTICS_TIME_TYPE_UNSPECIFIED - 未指定统计时间类型,服务端按默认周维度处理。 */
|
|
4
|
+
ANALYTICS_TIME_TYPE_UNSPECIFIED = 0,
|
|
5
|
+
/** ANALYTICS_TIME_TYPE_WEEK - 按周统计。 */
|
|
6
|
+
ANALYTICS_TIME_TYPE_WEEK = 1,
|
|
7
|
+
/** ANALYTICS_TIME_TYPE_MONTH - 按月统计。 */
|
|
8
|
+
ANALYTICS_TIME_TYPE_MONTH = 2,
|
|
9
|
+
/** ANALYTICS_TIME_TYPE_YEAR - 按年统计。 */
|
|
10
|
+
ANALYTICS_TIME_TYPE_YEAR = 3
|
|
11
|
+
}
|
|
12
|
+
/** 分析图表系列类型。 */
|
|
13
|
+
export declare enum AnalyticsSeriesType {
|
|
14
|
+
/** ANALYTICS_SERIES_TYPE_UNSPECIFIED - 未指定图表系列类型。 */
|
|
15
|
+
ANALYTICS_SERIES_TYPE_UNSPECIFIED = 0,
|
|
16
|
+
/** ANALYTICS_SERIES_TYPE_BAR - 柱状图系列。 */
|
|
17
|
+
ANALYTICS_SERIES_TYPE_BAR = 1,
|
|
18
|
+
/** ANALYTICS_SERIES_TYPE_LINE - 折线图系列。 */
|
|
19
|
+
ANALYTICS_SERIES_TYPE_LINE = 2
|
|
20
|
+
}
|
|
21
|
+
/** 分析时间请求参数。 */
|
|
22
|
+
export interface AnalyticsTimeRequest {
|
|
23
|
+
/** 时间类型 */
|
|
24
|
+
time_type: AnalyticsTimeType;
|
|
25
|
+
}
|
|
26
|
+
/** 趋势分析系列。 */
|
|
27
|
+
export interface AnalyticsTrendSeries {
|
|
28
|
+
/** 系列名称 */
|
|
29
|
+
name: string;
|
|
30
|
+
/** 图表类型 */
|
|
31
|
+
type: AnalyticsSeriesType;
|
|
32
|
+
/** 数据数组 */
|
|
33
|
+
data: number[];
|
|
34
|
+
/** Y轴索引 */
|
|
35
|
+
y_axis_index: number;
|
|
36
|
+
}
|
|
37
|
+
/** 趋势分析响应。 */
|
|
38
|
+
export interface AnalyticsTrendResponse {
|
|
39
|
+
/** 坐标轴数据 */
|
|
40
|
+
axis: string[];
|
|
41
|
+
/** 系列列表 */
|
|
42
|
+
series: AnalyticsTrendSeries[];
|
|
43
|
+
/** Y轴名称列表 */
|
|
44
|
+
y_axis_names: string[];
|
|
45
|
+
}
|
|
46
|
+
/** 排行分析项。 */
|
|
47
|
+
export interface AnalyticsRankItem {
|
|
48
|
+
/** 名称 */
|
|
49
|
+
name: string;
|
|
50
|
+
/** 值 */
|
|
51
|
+
value: number;
|
|
52
|
+
}
|
|
53
|
+
/** 排行分析响应。 */
|
|
54
|
+
export interface AnalyticsRankResponse {
|
|
55
|
+
/** 排行列表 */
|
|
56
|
+
items: AnalyticsRankItem[];
|
|
57
|
+
}
|
|
58
|
+
/** 占比分析项。 */
|
|
59
|
+
export interface AnalyticsPieItem {
|
|
60
|
+
/** 名称 */
|
|
61
|
+
name: string;
|
|
62
|
+
/** 值 */
|
|
63
|
+
value: number;
|
|
64
|
+
}
|
|
65
|
+
/** 占比分析响应。 */
|
|
66
|
+
export interface AnalyticsPieResponse {
|
|
67
|
+
/** 饼图数据 */
|
|
68
|
+
items: AnalyticsPieItem[];
|
|
69
|
+
}
|
|
@@ -1,58 +1,9 @@
|
|
|
1
1
|
/** 状态 */
|
|
2
2
|
export declare enum Status {
|
|
3
|
+
/** UNKNOWN - 未知状态 */
|
|
3
4
|
UNKNOWN = 0,
|
|
4
5
|
/** ENABLE - 启用 */
|
|
5
6
|
ENABLE = 1,
|
|
6
7
|
/** DISABLE - 禁用 */
|
|
7
8
|
DISABLE = 2
|
|
8
9
|
}
|
|
9
|
-
/** 系统配置位置 */
|
|
10
|
-
export declare enum BaseConfigSite {
|
|
11
|
-
UNKNOWN_BCS = 0,
|
|
12
|
-
/** SYSTEM - 系统内使用 */
|
|
13
|
-
SYSTEM = 1,
|
|
14
|
-
/** ADMIN - 管理端 */
|
|
15
|
-
ADMIN = 2,
|
|
16
|
-
/** APP - 移动端 */
|
|
17
|
-
APP = 3
|
|
18
|
-
}
|
|
19
|
-
/** 密码加密场景枚举 */
|
|
20
|
-
export declare enum PasswordCryptoScene {
|
|
21
|
-
/** UNKNOWN_PCS - 未指定密码加密场景 */
|
|
22
|
-
UNKNOWN_PCS = 0,
|
|
23
|
-
/** LOGIN - 登录密码加密场景 */
|
|
24
|
-
LOGIN = 1,
|
|
25
|
-
/** CREATE_BASE_USER - 新增后台用户密码加密场景 */
|
|
26
|
-
CREATE_BASE_USER = 2,
|
|
27
|
-
/** RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景 */
|
|
28
|
-
RESET_BASE_USER_PASSWORD = 3,
|
|
29
|
-
/** UPDATE_USER_PASSWORD - 个人修改密码加密场景 */
|
|
30
|
-
UPDATE_USER_PASSWORD = 4
|
|
31
|
-
}
|
|
32
|
-
/** AI 助手消息状态 */
|
|
33
|
-
export declare enum AiMessageStatus {
|
|
34
|
-
/** UNKNOWN_AAMS - 未知AI助手消息状态 */
|
|
35
|
-
UNKNOWN_AAMS = 0,
|
|
36
|
-
/** GENERATING_AAMS - 生成中 */
|
|
37
|
-
GENERATING_AAMS = 1,
|
|
38
|
-
/** SUCCESS_AAMS - 成功 */
|
|
39
|
-
SUCCESS_AAMS = 2,
|
|
40
|
-
/** FAILED_AAMS - 失败 */
|
|
41
|
-
FAILED_AAMS = 3
|
|
42
|
-
}
|
|
43
|
-
/** 支付通知资源类型 */
|
|
44
|
-
export declare enum ResourceType {
|
|
45
|
-
/** TRANSACTION - 支付 */
|
|
46
|
-
TRANSACTION = 0,
|
|
47
|
-
/** REFUND - 退款 */
|
|
48
|
-
REFUND = 1
|
|
49
|
-
}
|
|
50
|
-
/** 终端类型 */
|
|
51
|
-
export declare enum Terminal {
|
|
52
|
-
/** TERMINAL_UNSPECIFIED - 未知终端 */
|
|
53
|
-
TERMINAL_UNSPECIFIED = 0,
|
|
54
|
-
/** TERMINAL_APP - 移动端 */
|
|
55
|
-
TERMINAL_APP = 1,
|
|
56
|
-
/** TERMINAL_ADMIN - 管理端 */
|
|
57
|
-
TERMINAL_ADMIN = 2
|
|
58
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BaseConfigSite
|
|
1
|
+
import type { BaseConfigSite } from "../../../base/v1/enum";
|
|
2
|
+
import type { Status } from "../../../common/v1/enum";
|
|
2
3
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
3
4
|
import type { BaseConfigType } from "../../common/v1/enum";
|
|
4
5
|
/** 系统配置分页查询条件 */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { AnalyticsTimeType } from "../../../common/v1/analytics";
|
|
1
2
|
import type { SelectOptionResponse } from "../../../common/v1/common";
|
|
2
3
|
import type { Status } from "../../../common/v1/enum";
|
|
3
4
|
import type { PasswordCrypto } from "../../../common/v1/types";
|
|
4
5
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
6
|
+
import type { Timestamp } from "../../../google/protobuf/timestamp";
|
|
5
7
|
import type { BaseUserGender } from "../../common/v1/enum";
|
|
6
8
|
/** 用户选项查询条件 */
|
|
7
9
|
export interface OptionBaseUserRequest {
|
|
@@ -157,6 +159,31 @@ export interface SetBaseUserAppRoleRequest {
|
|
|
157
159
|
/** 应用端角色编码 */
|
|
158
160
|
role_code: string;
|
|
159
161
|
}
|
|
162
|
+
/** 用户注册汇总查询条件 */
|
|
163
|
+
export interface SummaryBaseUserRequest {
|
|
164
|
+
/** 租户ID */
|
|
165
|
+
tenant_id?: number | undefined;
|
|
166
|
+
/** 开始时间 */
|
|
167
|
+
start_at: Timestamp | undefined;
|
|
168
|
+
/** 结束时间 */
|
|
169
|
+
end_at: Timestamp | undefined;
|
|
170
|
+
/** 统计时间类型 */
|
|
171
|
+
time_type: AnalyticsTimeType;
|
|
172
|
+
}
|
|
173
|
+
/** 用户注册汇总响应 */
|
|
174
|
+
export interface SummaryBaseUserResponse {
|
|
175
|
+
/** 用户总数 */
|
|
176
|
+
total: number;
|
|
177
|
+
/** 用户分组汇总 */
|
|
178
|
+
summaries: BaseUserSummaryItem[];
|
|
179
|
+
}
|
|
180
|
+
/** 用户注册分组汇总项 */
|
|
181
|
+
export interface BaseUserSummaryItem {
|
|
182
|
+
/** 分组序号 */
|
|
183
|
+
key: number;
|
|
184
|
+
/** 用户数 */
|
|
185
|
+
count: number;
|
|
186
|
+
}
|
|
160
187
|
/** Admin用户管理服务 */
|
|
161
188
|
export interface BaseUserService {
|
|
162
189
|
/** 查询用户下拉选择 */
|
|
@@ -179,4 +206,6 @@ export interface BaseUserService {
|
|
|
179
206
|
ResetBaseUserPassword(request: ResetBaseUserPasswordRequest): Promise<Empty>;
|
|
180
207
|
/** 设置基础用户应用端角色 */
|
|
181
208
|
SetBaseUserAppRole(request: SetBaseUserAppRoleRequest): Promise<Empty>;
|
|
209
|
+
/** 汇总用户注册数据 */
|
|
210
|
+
SummaryBaseUser(request: SummaryBaseUserRequest): Promise<SummaryBaseUserResponse>;
|
|
182
211
|
}
|
|
@@ -20,7 +20,7 @@ import type { SelectOptionResponse } from "@liujitcn/kratos-admin-system/rpc/com
|
|
|
20
20
|
const BASE_USER_URL = "/v1/admin/base/user";
|
|
21
21
|
|
|
22
22
|
/** Admin用户服务 */
|
|
23
|
-
export class BaseUserServiceImpl implements Omit<BaseUserService, "SetBaseUserAppRole"> {
|
|
23
|
+
export class BaseUserServiceImpl implements Omit<BaseUserService, "SetBaseUserAppRole" | "SummaryBaseUser"> {
|
|
24
24
|
/** 查询用户下拉选择 */
|
|
25
25
|
OptionBaseUser(request: OptionBaseUserRequest): Promise<SelectOptionResponse> {
|
|
26
26
|
return service<OptionBaseUserRequest, SelectOptionResponse>({
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
// source: base/v1/ai_session.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
import type { AiMessageStatus, Terminal } from "../../common/v1/enum";
|
|
9
8
|
import type { Timestamp } from "../../google/protobuf/timestamp";
|
|
10
9
|
import type { AiToolCall } from "./ai_tool";
|
|
10
|
+
import type { AiMessageStatus, Terminal } from "./enum";
|
|
11
11
|
|
|
12
12
|
/** AI 助手消息列表查询条件 */
|
|
13
13
|
export interface ListAiMessageRequest {
|
|
@@ -0,0 +1,54 @@
|
|
|
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/enum.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
/** AI 助手消息状态 */
|
|
10
|
+
export enum AiMessageStatus {
|
|
11
|
+
/** UNKNOWN_AMS - 未知AI助手消息状态 */
|
|
12
|
+
UNKNOWN_AMS = 0,
|
|
13
|
+
/** GENERATING_AMS - 生成中 */
|
|
14
|
+
GENERATING_AMS = 1,
|
|
15
|
+
/** SUCCESS_AMS - 成功 */
|
|
16
|
+
SUCCESS_AMS = 2,
|
|
17
|
+
/** FAILED_AMS - 失败 */
|
|
18
|
+
FAILED_AMS = 3,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 终端类型 */
|
|
22
|
+
export enum Terminal {
|
|
23
|
+
/** UNKNOWN_TERMINAL - 未知终端 */
|
|
24
|
+
UNKNOWN_TERMINAL = 0,
|
|
25
|
+
/** TERMINAL_APP - 移动端 */
|
|
26
|
+
TERMINAL_APP = 1,
|
|
27
|
+
/** TERMINAL_ADMIN - 管理端 */
|
|
28
|
+
TERMINAL_ADMIN = 2,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 系统配置位置 */
|
|
32
|
+
export enum BaseConfigSite {
|
|
33
|
+
UNKNOWN_BCS = 0,
|
|
34
|
+
/** SYSTEM - 系统内使用 */
|
|
35
|
+
SYSTEM = 1,
|
|
36
|
+
/** ADMIN - 管理端 */
|
|
37
|
+
ADMIN = 2,
|
|
38
|
+
/** APP - 移动端 */
|
|
39
|
+
APP = 3,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 密码加密场景枚举 */
|
|
43
|
+
export enum PasswordCryptoScene {
|
|
44
|
+
/** UNKNOWN_PCS - 未指定密码加密场景 */
|
|
45
|
+
UNKNOWN_PCS = 0,
|
|
46
|
+
/** LOGIN - 登录密码加密场景 */
|
|
47
|
+
LOGIN = 1,
|
|
48
|
+
/** CREATE_BASE_USER - 新增后台用户密码加密场景 */
|
|
49
|
+
CREATE_BASE_USER = 2,
|
|
50
|
+
/** RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景 */
|
|
51
|
+
RESET_BASE_USER_PASSWORD = 3,
|
|
52
|
+
/** UPDATE_USER_PASSWORD - 个人修改密码加密场景 */
|
|
53
|
+
UPDATE_USER_PASSWORD = 4,
|
|
54
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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: common/v1/analytics.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
/** 分析时间类型。 */
|
|
10
|
+
export enum AnalyticsTimeType {
|
|
11
|
+
/** ANALYTICS_TIME_TYPE_UNSPECIFIED - 未指定统计时间类型,服务端按默认周维度处理。 */
|
|
12
|
+
ANALYTICS_TIME_TYPE_UNSPECIFIED = 0,
|
|
13
|
+
/** ANALYTICS_TIME_TYPE_WEEK - 按周统计。 */
|
|
14
|
+
ANALYTICS_TIME_TYPE_WEEK = 1,
|
|
15
|
+
/** ANALYTICS_TIME_TYPE_MONTH - 按月统计。 */
|
|
16
|
+
ANALYTICS_TIME_TYPE_MONTH = 2,
|
|
17
|
+
/** ANALYTICS_TIME_TYPE_YEAR - 按年统计。 */
|
|
18
|
+
ANALYTICS_TIME_TYPE_YEAR = 3,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 分析图表系列类型。 */
|
|
22
|
+
export enum AnalyticsSeriesType {
|
|
23
|
+
/** ANALYTICS_SERIES_TYPE_UNSPECIFIED - 未指定图表系列类型。 */
|
|
24
|
+
ANALYTICS_SERIES_TYPE_UNSPECIFIED = 0,
|
|
25
|
+
/** ANALYTICS_SERIES_TYPE_BAR - 柱状图系列。 */
|
|
26
|
+
ANALYTICS_SERIES_TYPE_BAR = 1,
|
|
27
|
+
/** ANALYTICS_SERIES_TYPE_LINE - 折线图系列。 */
|
|
28
|
+
ANALYTICS_SERIES_TYPE_LINE = 2,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 分析时间请求参数。 */
|
|
32
|
+
export interface AnalyticsTimeRequest {
|
|
33
|
+
/** 时间类型 */
|
|
34
|
+
time_type: AnalyticsTimeType;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** 趋势分析系列。 */
|
|
38
|
+
export interface AnalyticsTrendSeries {
|
|
39
|
+
/** 系列名称 */
|
|
40
|
+
name: string;
|
|
41
|
+
/** 图表类型 */
|
|
42
|
+
type: AnalyticsSeriesType;
|
|
43
|
+
/** 数据数组 */
|
|
44
|
+
data: number[];
|
|
45
|
+
/** Y轴索引 */
|
|
46
|
+
y_axis_index: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** 趋势分析响应。 */
|
|
50
|
+
export interface AnalyticsTrendResponse {
|
|
51
|
+
/** 坐标轴数据 */
|
|
52
|
+
axis: string[];
|
|
53
|
+
/** 系列列表 */
|
|
54
|
+
series: AnalyticsTrendSeries[];
|
|
55
|
+
/** Y轴名称列表 */
|
|
56
|
+
y_axis_names: string[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** 排行分析项。 */
|
|
60
|
+
export interface AnalyticsRankItem {
|
|
61
|
+
/** 名称 */
|
|
62
|
+
name: string;
|
|
63
|
+
/** 值 */
|
|
64
|
+
value: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 排行分析响应。 */
|
|
68
|
+
export interface AnalyticsRankResponse {
|
|
69
|
+
/** 排行列表 */
|
|
70
|
+
items: AnalyticsRankItem[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** 占比分析项。 */
|
|
74
|
+
export interface AnalyticsPieItem {
|
|
75
|
+
/** 名称 */
|
|
76
|
+
name: string;
|
|
77
|
+
/** 值 */
|
|
78
|
+
value: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** 占比分析响应。 */
|
|
82
|
+
export interface AnalyticsPieResponse {
|
|
83
|
+
/** 饼图数据 */
|
|
84
|
+
items: AnalyticsPieItem[];
|
|
85
|
+
}
|
|
@@ -8,64 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
/** 状态 */
|
|
10
10
|
export enum Status {
|
|
11
|
+
/** UNKNOWN - 未知状态 */
|
|
11
12
|
UNKNOWN = 0,
|
|
12
13
|
/** ENABLE - 启用 */
|
|
13
14
|
ENABLE = 1,
|
|
14
15
|
/** DISABLE - 禁用 */
|
|
15
16
|
DISABLE = 2,
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
/** 系统配置位置 */
|
|
19
|
-
export enum BaseConfigSite {
|
|
20
|
-
UNKNOWN_BCS = 0,
|
|
21
|
-
/** SYSTEM - 系统内使用 */
|
|
22
|
-
SYSTEM = 1,
|
|
23
|
-
/** ADMIN - 管理端 */
|
|
24
|
-
ADMIN = 2,
|
|
25
|
-
/** APP - 移动端 */
|
|
26
|
-
APP = 3,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** 密码加密场景枚举 */
|
|
30
|
-
export enum PasswordCryptoScene {
|
|
31
|
-
/** UNKNOWN_PCS - 未指定密码加密场景 */
|
|
32
|
-
UNKNOWN_PCS = 0,
|
|
33
|
-
/** LOGIN - 登录密码加密场景 */
|
|
34
|
-
LOGIN = 1,
|
|
35
|
-
/** CREATE_BASE_USER - 新增后台用户密码加密场景 */
|
|
36
|
-
CREATE_BASE_USER = 2,
|
|
37
|
-
/** RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景 */
|
|
38
|
-
RESET_BASE_USER_PASSWORD = 3,
|
|
39
|
-
/** UPDATE_USER_PASSWORD - 个人修改密码加密场景 */
|
|
40
|
-
UPDATE_USER_PASSWORD = 4,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** AI 助手消息状态 */
|
|
44
|
-
export enum AiMessageStatus {
|
|
45
|
-
/** UNKNOWN_AAMS - 未知AI助手消息状态 */
|
|
46
|
-
UNKNOWN_AAMS = 0,
|
|
47
|
-
/** GENERATING_AAMS - 生成中 */
|
|
48
|
-
GENERATING_AAMS = 1,
|
|
49
|
-
/** SUCCESS_AAMS - 成功 */
|
|
50
|
-
SUCCESS_AAMS = 2,
|
|
51
|
-
/** FAILED_AAMS - 失败 */
|
|
52
|
-
FAILED_AAMS = 3,
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** 支付通知资源类型 */
|
|
56
|
-
export enum ResourceType {
|
|
57
|
-
/** TRANSACTION - 支付 */
|
|
58
|
-
TRANSACTION = 0,
|
|
59
|
-
/** REFUND - 退款 */
|
|
60
|
-
REFUND = 1,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** 终端类型 */
|
|
64
|
-
export enum Terminal {
|
|
65
|
-
/** TERMINAL_UNSPECIFIED - 未知终端 */
|
|
66
|
-
TERMINAL_UNSPECIFIED = 0,
|
|
67
|
-
/** TERMINAL_APP - 移动端 */
|
|
68
|
-
TERMINAL_APP = 1,
|
|
69
|
-
/** TERMINAL_ADMIN - 管理端 */
|
|
70
|
-
TERMINAL_ADMIN = 2,
|
|
71
|
-
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// source: system/admin/v1/base_config.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
import type { BaseConfigSite
|
|
8
|
+
import type { BaseConfigSite } from "../../../base/v1/enum";
|
|
9
|
+
import type { Status } from "../../../common/v1/enum";
|
|
9
10
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
10
11
|
import type { BaseConfigType } from "../../common/v1/enum";
|
|
11
12
|
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
// source: system/admin/v1/base_user.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
+
import type { AnalyticsTimeType } from "../../../common/v1/analytics";
|
|
8
9
|
import type { SelectOptionResponse } from "../../../common/v1/common";
|
|
9
10
|
import type { Status } from "../../../common/v1/enum";
|
|
10
11
|
import type { PasswordCrypto } from "../../../common/v1/types";
|
|
11
12
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
13
|
+
import type { Timestamp } from "../../../google/protobuf/timestamp";
|
|
12
14
|
import type { BaseUserGender } from "../../common/v1/enum";
|
|
13
15
|
|
|
14
16
|
/** 用户选项查询条件 */
|
|
@@ -189,6 +191,40 @@ export interface SetBaseUserAppRoleRequest {
|
|
|
189
191
|
role_code: string;
|
|
190
192
|
}
|
|
191
193
|
|
|
194
|
+
/** 用户注册汇总查询条件 */
|
|
195
|
+
export interface SummaryBaseUserRequest {
|
|
196
|
+
/** 租户ID */
|
|
197
|
+
tenant_id?:
|
|
198
|
+
| number
|
|
199
|
+
| undefined;
|
|
200
|
+
/** 开始时间 */
|
|
201
|
+
start_at:
|
|
202
|
+
| Timestamp
|
|
203
|
+
| undefined;
|
|
204
|
+
/** 结束时间 */
|
|
205
|
+
end_at:
|
|
206
|
+
| Timestamp
|
|
207
|
+
| undefined;
|
|
208
|
+
/** 统计时间类型 */
|
|
209
|
+
time_type: AnalyticsTimeType;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** 用户注册汇总响应 */
|
|
213
|
+
export interface SummaryBaseUserResponse {
|
|
214
|
+
/** 用户总数 */
|
|
215
|
+
total: number;
|
|
216
|
+
/** 用户分组汇总 */
|
|
217
|
+
summaries: BaseUserSummaryItem[];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** 用户注册分组汇总项 */
|
|
221
|
+
export interface BaseUserSummaryItem {
|
|
222
|
+
/** 分组序号 */
|
|
223
|
+
key: number;
|
|
224
|
+
/** 用户数 */
|
|
225
|
+
count: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
192
228
|
/** Admin用户管理服务 */
|
|
193
229
|
export interface BaseUserService {
|
|
194
230
|
/** 查询用户下拉选择 */
|
|
@@ -211,4 +247,6 @@ export interface BaseUserService {
|
|
|
211
247
|
ResetBaseUserPassword(request: ResetBaseUserPasswordRequest): Promise<Empty>;
|
|
212
248
|
/** 设置基础用户应用端角色 */
|
|
213
249
|
SetBaseUserAppRole(request: SetBaseUserAppRoleRequest): Promise<Empty>;
|
|
250
|
+
/** 汇总用户注册数据 */
|
|
251
|
+
SummaryBaseUser(request: SummaryBaseUserRequest): Promise<SummaryBaseUserResponse>;
|
|
214
252
|
}
|
|
@@ -328,7 +328,7 @@ import { ElMessage } from "element-plus";
|
|
|
328
328
|
import type { AiAction } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_message";
|
|
329
329
|
import { type AiAttachment, type AiSession } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
330
330
|
import type { AiShortcut, AiToolCall } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_tool";
|
|
331
|
-
import { AiMessageStatus } from "@liujitcn/kratos-admin-system/rpc/
|
|
331
|
+
import { AiMessageStatus } from "@liujitcn/kratos-admin-system/rpc/base/v1/enum";
|
|
332
332
|
import XSender from "./XSender.vue";
|
|
333
333
|
|
|
334
334
|
// AI Markdown 渲染器依赖较重,仅在真正出现助手消息时再加载。
|
|
@@ -665,14 +665,14 @@ function parseActionPayload(payload?: string) {
|
|
|
665
665
|
|
|
666
666
|
/** 根据消息角色返回可用操作。 */
|
|
667
667
|
function resolveMessageActions(item: ChatMessageItem) {
|
|
668
|
-
if (item.progressState === "streaming" || item.status === AiMessageStatus.
|
|
668
|
+
if (item.progressState === "streaming" || item.status === AiMessageStatus.GENERATING_AMS) return [];
|
|
669
669
|
|
|
670
670
|
const copyAction: MessageActionOption = { key: "copy" as const, label: "复制", icon: CopyDocument };
|
|
671
671
|
const deleteAction: MessageActionOption = { key: "delete" as const, label: "删除", icon: Delete };
|
|
672
672
|
const editAction: MessageActionOption = { key: "edit" as const, label: "编辑", icon: EditPen };
|
|
673
673
|
if (item.role === "user") {
|
|
674
674
|
const actions = isLastEditableUserMessage(item) ? [editAction, copyAction, deleteAction] : [copyAction, deleteAction];
|
|
675
|
-
if (item.status === AiMessageStatus.
|
|
675
|
+
if (item.status === AiMessageStatus.FAILED_AMS) {
|
|
676
676
|
return item.localOnly
|
|
677
677
|
? [{ key: "retry" as const, label: "重新发送", icon: Refresh }, copyAction, deleteAction]
|
|
678
678
|
: [{ key: "retry" as const, label: "重新发送", icon: Refresh }, ...actions];
|
|
@@ -681,7 +681,7 @@ function resolveMessageActions(item: ChatMessageItem) {
|
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
const actions: MessageActionOption[] = [{ key: "retry" as const, label: "重新生成", icon: Refresh }];
|
|
684
|
-
if (item.status === AiMessageStatus.
|
|
684
|
+
if (item.status === AiMessageStatus.SUCCESS_AMS) {
|
|
685
685
|
actions.push({ key: "branch" as const, label: "从此处创建分支会话", icon: BranchActionIcon });
|
|
686
686
|
actions.push({ key: "speak" as const, label: item.speaking ? "停止朗读" : "朗读", icon: SpeakActionIcon });
|
|
687
687
|
}
|
|
@@ -690,7 +690,7 @@ function resolveMessageActions(item: ChatMessageItem) {
|
|
|
690
690
|
|
|
691
691
|
/** 判断是否为需要渲染错误卡片的助手失败消息。 */
|
|
692
692
|
function isAIFailedMessage(item: ChatMessageItem) {
|
|
693
|
-
return item.role !== "user" && item.status === AiMessageStatus.
|
|
693
|
+
return item.role !== "user" && item.status === AiMessageStatus.FAILED_AMS;
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
/** 返回助手错误摘要,优先展示服务端可读错误。 */
|
|
@@ -51,7 +51,7 @@ import { defAiToolService } from "@liujitcn/kratos-admin-system/api/base/ai_tool
|
|
|
51
51
|
import type { AiAction } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_message";
|
|
52
52
|
import type { AiSession } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
53
53
|
import type { AiShortcut } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_tool";
|
|
54
|
-
import { AiMessageStatus, Terminal } from "@liujitcn/kratos-admin-system/rpc/
|
|
54
|
+
import { AiMessageStatus, Terminal } from "@liujitcn/kratos-admin-system/rpc/base/v1/enum";
|
|
55
55
|
import ChatPanel from "./components/ChatPanel.vue";
|
|
56
56
|
import SessionPanel from "./components/SessionPanel.vue";
|
|
57
57
|
import {
|
|
@@ -364,7 +364,7 @@ async function handleRetryMessage(item: ChatMessageItem) {
|
|
|
364
364
|
}
|
|
365
365
|
setSessionSending(sessionID, true);
|
|
366
366
|
if (item.role === "user") {
|
|
367
|
-
if (item.status !== AiMessageStatus.
|
|
367
|
+
if (item.status !== AiMessageStatus.FAILED_AMS) {
|
|
368
368
|
ElMessage.warning("只有发送失败的消息可以重新发送");
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type AiToken
|
|
8
8
|
} from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
|
|
9
9
|
import type { AiAction } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_message";
|
|
10
|
-
import { AiMessageStatus, Terminal } from "@liujitcn/kratos-admin-system/rpc/
|
|
10
|
+
import { AiMessageStatus, Terminal } from "@liujitcn/kratos-admin-system/rpc/base/v1/enum";
|
|
11
11
|
import type { AiStreamPayload, AIFlowBlock, ChatMessageItem, ReplySourceTag } from "./types";
|
|
12
12
|
|
|
13
13
|
const THINKING_MESSAGE_ID_PREFIX = "ai-thinking";
|
|
@@ -168,17 +168,17 @@ export function mapMessageItem(message: AiMessage, role: "user" | "ai"): ChatMes
|
|
|
168
168
|
step: role === "ai" ? outputContent.step : "",
|
|
169
169
|
blocksJson: role === "ai" ? outputContent.blocks_json : "",
|
|
170
170
|
blocks: role === "ai" ? markFlowBlocksDisabled(parseFlowBlocks(outputContent.blocks_json), String(message.id ?? "")) : [],
|
|
171
|
-
status: Number(message.status ?? AiMessageStatus.
|
|
171
|
+
status: Number(message.status ?? AiMessageStatus.SUCCESS_AMS),
|
|
172
172
|
token: normalizeToken(message.token),
|
|
173
173
|
tools: Array.isArray(message.tools) ? message.tools : [],
|
|
174
174
|
variant: role === "user" ? "filled" : "borderless",
|
|
175
175
|
shape: "corner",
|
|
176
176
|
progressState:
|
|
177
|
-
message.status === AiMessageStatus.
|
|
177
|
+
message.status === AiMessageStatus.GENERATING_AMS
|
|
178
178
|
? role === "user"
|
|
179
179
|
? "idle"
|
|
180
180
|
: "streaming"
|
|
181
|
-
: message.status === AiMessageStatus.
|
|
181
|
+
: message.status === AiMessageStatus.FAILED_AMS
|
|
182
182
|
? "failed"
|
|
183
183
|
: "idle",
|
|
184
184
|
maxWidth: role === "user" ? "380px" : "100%"
|
|
@@ -209,7 +209,7 @@ export function createLocalUserMessage(payload: { text: string; attachments: AiA
|
|
|
209
209
|
seconds: Math.floor(now.getTime() / 1000),
|
|
210
210
|
nanos: (now.getTime() % 1000) * 1_000_000
|
|
211
211
|
},
|
|
212
|
-
status: AiMessageStatus.
|
|
212
|
+
status: AiMessageStatus.GENERATING_AMS,
|
|
213
213
|
token: normalizeToken(),
|
|
214
214
|
tools: [],
|
|
215
215
|
first_token_ms: 0,
|
|
@@ -250,7 +250,7 @@ export function createThinkingMessage(options?: { sessionID?: string; messageID?
|
|
|
250
250
|
seconds: Math.floor(now.getTime() / 1000),
|
|
251
251
|
nanos: (now.getTime() % 1000) * 1_000_000
|
|
252
252
|
},
|
|
253
|
-
status: AiMessageStatus.
|
|
253
|
+
status: AiMessageStatus.GENERATING_AMS,
|
|
254
254
|
token: normalizeToken(),
|
|
255
255
|
tools: [],
|
|
256
256
|
first_token_ms: 0,
|
|
@@ -299,7 +299,7 @@ export function markAIMessageRegenerating(current: ChatMessageItem[], sessionID:
|
|
|
299
299
|
duration_ms: 0,
|
|
300
300
|
progressState: "streaming",
|
|
301
301
|
replySourceTag: { text: "思考中", tone: "info" },
|
|
302
|
-
status: AiMessageStatus.
|
|
302
|
+
status: AiMessageStatus.GENERATING_AMS,
|
|
303
303
|
streamKey
|
|
304
304
|
};
|
|
305
305
|
});
|
|
@@ -354,14 +354,14 @@ export function markThinkingMessageFailed(current: ChatMessageItem[], options?:
|
|
|
354
354
|
return {
|
|
355
355
|
...item,
|
|
356
356
|
progressState: "failed",
|
|
357
|
-
status: AiMessageStatus.
|
|
357
|
+
status: AiMessageStatus.FAILED_AMS
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
if (item.progressState !== "streaming") return item;
|
|
361
361
|
return {
|
|
362
362
|
...item,
|
|
363
363
|
progressState: "failed",
|
|
364
|
-
status: AiMessageStatus.
|
|
364
|
+
status: AiMessageStatus.FAILED_AMS,
|
|
365
365
|
content: "这次回复没有成功返回,你可以直接重试刚才的问题。",
|
|
366
366
|
replySourceTag: { text: "发送失败", tone: "warning" }
|
|
367
367
|
};
|
|
@@ -400,7 +400,7 @@ export function markStreamingError(current: ChatMessageItem[], payload: AiStream
|
|
|
400
400
|
return {
|
|
401
401
|
...item,
|
|
402
402
|
progressState: "failed",
|
|
403
|
-
status: AiMessageStatus.
|
|
403
|
+
status: AiMessageStatus.FAILED_AMS,
|
|
404
404
|
content: "这次回复没有成功返回,你可以直接重试刚才的问题。",
|
|
405
405
|
replySourceTag: { text: "发送失败", tone: "warning" }
|
|
406
406
|
};
|
|
@@ -63,7 +63,8 @@ import WangEditor from "@liujitcn/kratos-admin-core/components/WangEditor/index.
|
|
|
63
63
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
64
64
|
import { defBaseConfigService } from "@liujitcn/kratos-admin-system/api/system/base_config";
|
|
65
65
|
import type { BaseConfig, BaseConfigForm, PageBaseConfigRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_config";
|
|
66
|
-
import { BaseConfigSite
|
|
66
|
+
import { BaseConfigSite } from "@liujitcn/kratos-admin-system/rpc/base/v1/enum";
|
|
67
|
+
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
67
68
|
import { BaseConfigType } from "@liujitcn/kratos-admin-system/rpc/system/common/v1/enum";
|
|
68
69
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
69
70
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liujitcn/kratos-admin-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.19",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "kratos-admin system management module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"sortablejs": "^1.15.2",
|
|
16
16
|
"swagger-ui-dist": "^5.32.9",
|
|
17
17
|
"vue-element-plus-x": "^2.0.3",
|
|
18
|
-
"@liujitcn/kratos-admin-core": "0.0.
|
|
18
|
+
"@liujitcn/kratos-admin-core": "0.0.19"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@element-plus/icons-vue": "^2.3.1",
|