smart-admin-web 10.10.1 → 10.12.0

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.
Files changed (43) hide show
  1. package/dist/api/index.d.ts +52 -1
  2. package/dist/api/index.js +151 -84
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/schema.d.ts +936 -15
  5. package/dist/assets/icons/ph-subset.json.js +7 -7
  6. package/dist/index.js +278 -274
  7. package/dist/lib/runtime.js +1 -1
  8. package/dist/locales/en-US.d.ts +144 -0
  9. package/dist/locales/en-US.js +146 -0
  10. package/dist/locales/en-US.js.map +1 -1
  11. package/dist/locales/zh-CN.d.ts +144 -0
  12. package/dist/locales/zh-CN.js +146 -0
  13. package/dist/locales/zh-CN.js.map +1 -1
  14. package/dist/router/viewRegistry.js +1 -1
  15. package/dist/router/viewRegistry.js.map +1 -1
  16. package/dist/style.css +1 -1
  17. package/dist/types/api.d.ts +166 -0
  18. package/dist/types/api.js +12 -9
  19. package/dist/types/api.js.map +1 -1
  20. package/dist/views/system/ai-model/components/ProviderCard.vue.d.ts +13 -0
  21. package/dist/views/system/ai-model/components/ProviderCard.vue.js +8 -0
  22. package/dist/views/system/ai-model/components/ProviderCard.vue.js.map +1 -0
  23. package/dist/views/system/ai-model/components/ProviderCard2.vue.js +230 -0
  24. package/dist/views/system/ai-model/components/ProviderCard2.vue.js.map +1 -0
  25. package/dist/views/system/ai-model/components/ProviderForm.vue.d.ts +18 -0
  26. package/dist/views/system/ai-model/components/ProviderForm.vue.js +8 -0
  27. package/dist/views/system/ai-model/components/ProviderForm.vue.js.map +1 -0
  28. package/dist/views/system/ai-model/components/ProviderForm2.vue.js +507 -0
  29. package/dist/views/system/ai-model/components/ProviderForm2.vue.js.map +1 -0
  30. package/dist/views/system/ai-model/index.vue.d.ts +3 -0
  31. package/dist/views/system/ai-model/index.vue.js +8 -0
  32. package/dist/views/system/ai-model/index.vue.js.map +1 -0
  33. package/dist/views/system/ai-model/index2.vue.js +134 -0
  34. package/dist/views/system/ai-model/index2.vue.js.map +1 -0
  35. package/dist/views/system/ai-model/presets.d.ts +14 -0
  36. package/dist/views/system/ai-model/presets.js +22 -0
  37. package/dist/views/system/ai-model/presets.js.map +1 -0
  38. package/dist/views/system/ai-usage/index.vue.d.ts +3 -0
  39. package/dist/views/system/ai-usage/index.vue.js +8 -0
  40. package/dist/views/system/ai-usage/index.vue.js.map +1 -0
  41. package/dist/views/system/ai-usage/index2.vue.js +423 -0
  42. package/dist/views/system/ai-usage/index2.vue.js.map +1 -0
  43. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { components } from './schema';
2
- import { AddUserInput, AddUserOutput, ChunkInitOutput, ConfigInput, CronPreviewOutput, DashboardSummary, DataScopeType, DictItem, DictItemInput, DictTypeInput, DuplicateStrategy, FileUploadOutput, ImportCommitResult, ImportPreview, ImportRow, JobDashboard, JobHandlersOutput, JobInput, LoginOutput, ModuleInput, ModuleRow, MyModulesOutput, MySessionItem, NoticeMineItem, NoticePublishInput, OnlineSessionItem, OrgInput, PermissionRouteItem, PositionInput, RoleInput, ServerInfoOutput, SysConfig, SysDictItem, SysDictType, SysExceptionLog, SysFile, SysJob, SysJobLog, SysLoginLog, SysNotice, SysOpLog, SysOrg, SysPosition, SysRole, SysRoleDataScope, UpdateUserInput, UserDetail, UserItem, UserProfile } from '../types/api';
2
+ import { AddUserInput, AddUserOutput, AiProviderAddInput, AiProviderPreset, AiProviderUpdateInput, AiProviderView, AiTestResult, AiUsageGroupBy, AiUsageSummary, AiUsageTrendPoint, ChunkInitOutput, ConfigInput, CronPreviewOutput, DashboardSummary, DataScopeType, DictItem, DictItemInput, DictTypeInput, DuplicateStrategy, FileUploadOutput, ImportCommitResult, ImportPreview, ImportRow, JobDashboard, JobHandlersOutput, JobInput, LoginOutput, ModuleInput, ModuleRow, MyModulesOutput, MySessionItem, NoticeMineItem, NoticePublishInput, OnlineSessionItem, OrgInput, PermissionRouteItem, PositionInput, RoleInput, ServerInfoOutput, SysAiUsageLog, SysConfig, SysDictItem, SysDictType, SysExceptionLog, SysFile, SysJob, SysJobLog, SysLoginLog, SysNotice, SysOpLog, SysOrg, SysPosition, SysRole, SysRoleDataScope, UpdateUserInput, UserDetail, UserItem, UserProfile } from '../types/api';
3
3
  import { MenuInput, MenuNode, MenuTreeNode } from '../types/menu';
4
4
  /** 业务错误(含后端 code / msgKey);视图 catch 后经 translateError 展示。 */
5
5
  export declare class ApiError extends Error {
@@ -670,3 +670,54 @@ export declare const recycleApi: {
670
670
  restore: (type: string, id: number) => Promise<boolean>;
671
671
  purge: (type: string, id: number) => Promise<boolean>;
672
672
  };
673
+ export declare const aiProviderApi: {
674
+ /** 厂商分页(含模型清单);搜索键 keyword/enabled → PascalCase 查询参。 */
675
+ page: (params: {
676
+ page: number;
677
+ pageSize: number;
678
+ keyword?: string;
679
+ enabled?: boolean;
680
+ }) => Promise<{
681
+ items: AiProviderView[];
682
+ total: number;
683
+ }>;
684
+ get: (id: number) => Promise<AiProviderView>;
685
+ /** 厂商预置清单(协议/BaseUrl/鉴权方式/起步模型),新增抽屉选预设用。 */
686
+ presets: () => Promise<AiProviderPreset[]>;
687
+ add: (body: AiProviderAddInput) => Promise<number>;
688
+ /** 更新入参没有 preset/protocol 字段——这两项创建后不可改,类型层面就不给改的机会。 */
689
+ update: (id: number, body: AiProviderUpdateInput) => Promise<boolean>;
690
+ /** 启用时若未配置 Key 会被后端拒绝(49004),调用方按 StatusSwitch 模式处理失败回弹。 */
691
+ setEnabled: (id: number, enabled: boolean) => Promise<boolean>;
692
+ remove: (id: number) => Promise<boolean>;
693
+ /** 测试连接:用库里当前配置发一条最小对话;失败原因在返回体里,不抛异常。 */
694
+ test: (id: number) => Promise<AiTestResult>;
695
+ };
696
+ interface AiUsageFilter {
697
+ from: string;
698
+ to: string;
699
+ providerCode?: string;
700
+ model?: string;
701
+ scene?: string;
702
+ userId?: number;
703
+ }
704
+ export declare const aiUsageApi: {
705
+ /** 区间总计 + 按维度分组聚合(groupBy 切换四个 Tab 共用这一个接口)。 */
706
+ summary: (params: AiUsageFilter & {
707
+ groupBy: AiUsageGroupBy;
708
+ }) => Promise<AiUsageSummary>;
709
+ /** 按天趋势;区间内无数据的日期后端已补 0,前端直接画连续折线。 */
710
+ trend: (params: AiUsageFilter) => Promise<AiUsageTrendPoint[]>;
711
+ /** 明细分页(不聚合);from/to 在这里是可选的(不筛日期就是全量分页)。 */
712
+ page: (params: Omit<AiUsageFilter, "from" | "to"> & {
713
+ page: number;
714
+ pageSize: number;
715
+ from?: string;
716
+ to?: string;
717
+ success?: boolean;
718
+ }) => Promise<{
719
+ items: SysAiUsageLog[];
720
+ total: number;
721
+ }>;
722
+ };
723
+ export {};
package/dist/api/index.js CHANGED
@@ -2,10 +2,10 @@ var b = Object.defineProperty;
2
2
  var P = (e, t, i) => t in e ? b(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
3
  var y = (e, t, i) => P(e, typeof t != "symbol" ? t + "" : t, i);
4
4
  import { client as s, LONG_TIMEOUT_MS as l } from "./client.js";
5
- import { runtime as f } from "../lib/runtime.js";
5
+ import { runtime as S } from "../lib/runtime.js";
6
6
  class u extends Error {
7
- constructor(i, o, n, r) {
8
- super(r ?? o ?? `Error ${i}`);
7
+ constructor(i, o, n, p) {
8
+ super(p ?? o ?? `Error ${i}`);
9
9
  y(this, "code");
10
10
  y(this, "msgKey");
11
11
  y(this, "args");
@@ -15,15 +15,15 @@ class u extends Error {
15
15
  function a(e) {
16
16
  const { data: t, error: i, response: o } = e;
17
17
  if (i != null) {
18
- const r = i;
19
- if (typeof r.code == "number")
20
- throw new u(r.code, r.msgKey, r.args, r.message);
21
18
  const p = i;
19
+ if (typeof p.code == "number")
20
+ throw new u(p.code, p.msgKey, p.args, p.message);
21
+ const h = i;
22
22
  throw new u(
23
23
  o.status,
24
24
  void 0,
25
25
  void 0,
26
- p.title ?? p.detail ?? o.statusText
26
+ h.title ?? h.detail ?? o.statusText
27
27
  );
28
28
  }
29
29
  const n = t ?? {};
@@ -31,37 +31,37 @@ function a(e) {
31
31
  throw new u(n.code, n.msgKey, n.args, n.message);
32
32
  return n.data;
33
33
  }
34
- function x(e, t, i) {
34
+ function U(e, t, i) {
35
35
  const o = s.request;
36
36
  return o(e, t, i === void 0 ? void 0 : { body: i }).then((n) => a(n));
37
37
  }
38
- const d = (e) => ({
38
+ const r = (e) => ({
39
39
  Current: e.page,
40
40
  Size: e.pageSize
41
- }), U = (e) => ({
42
- ...d(e),
41
+ }), x = (e) => ({
42
+ ...r(e),
43
43
  Keyword: e.keyword,
44
44
  Number: e.number,
45
45
  Name: e.name,
46
46
  SortField: e.sortField,
47
47
  SortOrder: e.sortOrder
48
- }), S = (e) => !e || e.length !== 2 ? { start: void 0, end: void 0 } : { start: e[0] || void 0, end: e[1] ? `${e[1]} 23:59:59` : void 0 };
49
- function h(e) {
48
+ }), f = (e) => !e || e.length !== 2 ? { start: void 0, end: void 0 } : { start: e[0] || void 0, end: e[1] ? `${e[1]} 23:59:59` : void 0 };
49
+ function d(e) {
50
50
  const t = a(e);
51
51
  return { items: t.items, total: t.total };
52
52
  }
53
- async function v(e) {
53
+ async function m(e) {
54
54
  const { data: t, error: i, response: o } = e;
55
55
  if (!o.ok) {
56
- const p = i ?? {};
57
- throw typeof p.code == "number" ? new u(p.code, p.msgKey, p.args, p.message) : new u(o.status, void 0, void 0, o.statusText);
56
+ const h = i ?? {};
57
+ throw typeof h.code == "number" ? new u(h.code, h.msgKey, h.args, h.message) : new u(o.status, void 0, void 0, o.statusText);
58
58
  }
59
- const n = t, r = o.headers.get("content-type") ?? "";
60
- if (r.includes("spreadsheet") || r.includes("octet-stream")) return n;
61
- if (r.includes("json") || r.includes("text/plain")) {
62
- const p = JSON.parse(await n.text());
63
- if (typeof p.code == "number" && p.code !== 0)
64
- throw new u(p.code, p.msgKey, p.args, p.message);
59
+ const n = t, p = o.headers.get("content-type") ?? "";
60
+ if (p.includes("spreadsheet") || p.includes("octet-stream")) return n;
61
+ if (p.includes("json") || p.includes("text/plain")) {
62
+ const h = JSON.parse(await n.text());
63
+ if (typeof h.code == "number" && h.code !== 0)
64
+ throw new u(h.code, h.msgKey, h.args, h.message);
65
65
  } else if (new Uint8Array(await n.slice(0, 1).arrayBuffer())[0] === 123) {
66
66
  const c = JSON.parse(await n.text());
67
67
  if (typeof c.code == "number" && c.code !== 0)
@@ -143,22 +143,22 @@ const C = {
143
143
  smsLoginSend: (e) => s.POST("/api/v1/auth/sms/send", { body: e }).then((t) => a(t)),
144
144
  /** 免密登录:手机号 + 短信码换令牌。 */
145
145
  smsLogin: (e) => s.POST("/api/v1/auth/sms/login", { body: e }).then((t) => a(t))
146
- }, D = {
146
+ }, I = {
147
147
  bindStart: (e) => s.POST("/api/v1/auth/mfa/bind/start", { body: e }).then((t) => a(t)),
148
148
  bindComplete: (e) => s.POST("/api/v1/auth/mfa/bind/complete", { body: e }).then((t) => a(t)),
149
149
  recovery: (e) => s.POST("/api/v1/auth/mfa/recovery", { body: e }).then((t) => a(t)),
150
150
  clear: (e) => s.POST("/api/v1/sys/mfa/clear", { body: e }).then((t) => a(t))
151
- }, N = {
151
+ }, q = {
152
152
  list: () => s.GET("/api/v1/sys/mfa/high-sensitivity", {}).then((e) => a(e)),
153
153
  add: (e) => s.POST("/api/v1/sys/mfa/high-sensitivity", { body: e }).then((t) => a(t)),
154
154
  remove: (e) => s.DELETE("/api/v1/sys/mfa/high-sensitivity/{id}", { params: { path: { id: e } } }).then((t) => a(t))
155
- }, k = {
155
+ }, D = {
156
156
  /** 登录页可用的外部登录方式(启用的);空数组 = 不显 SSO 区。 */
157
157
  providers: () => s.GET("/api/v1/auth/external/providers", {}).then((e) => a(e)),
158
158
  /** 管理端全量列表(含已禁用);系统配置「第三方登录」Tab。 */
159
159
  providersAll: () => s.GET("/api/v1/auth/external/providers/all", {}).then((e) => a(e)),
160
160
  /** 发起某 provider 登录的 URL(顶层浏览器导航,不走 fetch —— 后端 302 跳 IdP)。 */
161
- authorizeUrl: (e) => `${f.apiBase}/api/v1/auth/external/${encodeURIComponent(e)}/authorize`,
161
+ authorizeUrl: (e) => `${S.apiBase}/api/v1/auth/external/${encodeURIComponent(e)}/authorize`,
162
162
  /** 一次性票据换令牌(登录回调后);票据无效/过期/已用抛 40014。 */
163
163
  exchange: (e) => s.POST("/api/v1/auth/external/exchange", { body: { ticket: e } }).then((t) => a(t)),
164
164
  /** 认领未绑定 SSO 的 pending-link(账密登录后);票据无效 40014,已被他人绑 40017。 */
@@ -169,7 +169,7 @@ const C = {
169
169
  bindStart: (e) => s.POST("/api/v1/auth/external/{provider}/bind", { params: { path: { provider: e } } }).then((t) => a(t)),
170
170
  /** 解绑某 provider 的外部账号。 */
171
171
  unbind: (e) => s.DELETE("/api/v1/auth/external/{provider}/binding", { params: { path: { provider: e } } }).then((t) => a(t))
172
- }, I = {
172
+ }, k = {
173
173
  /** 工作台首页统计([ActiveSession]:任何登录用户可取,无需权限码)。 */
174
174
  summary: () => s.GET("/api/v1/dashboard/summary", {}).then((e) => a(e))
175
175
  }, L = {
@@ -186,7 +186,7 @@ const C = {
186
186
  updatePassword: (e) => s.PUT("/api/v1/personal/password", { body: e }).then((t) => a(t)),
187
187
  /** 当前用户权限码集合(= 规范化路由);喂给 authStore.permissionCodes 驱动 v-auth。超管返回空集。 */
188
188
  permissions: () => s.GET("/api/v1/personal/permissions", {}).then((e) => a(e))
189
- }, q = {
189
+ }, N = {
190
190
  /** 归一后端 PagedList<UserItem>({current,size,total,items}) → SmartTable fetcher 契约的 {items,total}。 */
191
191
  page: (e) => s.GET("/api/v1/sys/user/page", {
192
192
  // 查询参数名沿用后端 record 属性(PascalCase);ASP.NET 绑定大小写不敏感,类型要求 PascalCase。
@@ -194,7 +194,7 @@ const C = {
194
194
  // sortField/sortOrder:SmartTable 排序;后端按实体列白名单校验(非法忽略回退默认),见 PagedListExtensions.OrderBySafe。
195
195
  params: {
196
196
  query: {
197
- ...d(e),
197
+ ...r(e),
198
198
  Account: e.account,
199
199
  Name: e.name,
200
200
  OrgId: e.orgId,
@@ -203,7 +203,7 @@ const C = {
203
203
  SortOrder: e.sortOrder
204
204
  }
205
205
  }
206
- }).then((t) => h(t)),
206
+ }).then((t) => d(t)),
207
207
  /** 用户详情(含 roleIds,编辑回显 + 提交时原样带回避免清空角色)。 */
208
208
  detail: (e) => s.GET("/api/v1/sys/user/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
209
209
  /** 新增用户;返回新 Id + 实际生效的初始口令(留空 password 时后端随机生成,不接住就没人知道这个号的密码)。 */
@@ -221,7 +221,7 @@ const C = {
221
221
  setEnabled: (e, t) => s.PUT("/api/v1/sys/user/{id}/enabled", { params: { path: { id: e } }, body: { enabled: t } }).then((i) => a(i)),
222
222
  // ── 导入 / 导出 ──
223
223
  /** 下载用户导入模板(xlsx)。[ActiveSession],无需独立权限码。 */
224
- importTemplate: () => s.GET("/api/v1/sys/user/import/template", { parseAs: "blob" }).then((e) => v(e)),
224
+ importTemplate: () => s.GET("/api/v1/sys/user/import/template", { parseAs: "blob" }).then((e) => m(e)),
225
225
  /**
226
226
  * 上传 xlsx 预览校验。multipart:`file` + 可选 `mapping`(JSON 字符串:表头→列 Key)。
227
227
  * bodySerializer 建 FormData(与 fileApi.upload 同型)。
@@ -247,7 +247,7 @@ const C = {
247
247
  timeout: l,
248
248
  body: { rows: T(e) },
249
249
  parseAs: "blob"
250
- }).then((t) => v(t)),
250
+ }).then((t) => m(t)),
251
251
  /** 按策略提交导入(部分提交:有错行跳过;服务端重校验,不信任前端 Errors)。 */
252
252
  importCommit: (e, t = 0) => s.POST("/api/v1/sys/user/import/commit", {
253
253
  timeout: l,
@@ -272,7 +272,7 @@ const C = {
272
272
  }
273
273
  },
274
274
  parseAs: "blob"
275
- }).then((t) => v(t))
275
+ }).then((t) => m(t))
276
276
  }, R = {
277
277
  /** 全部机构(平铺,按 Sort、Id 排序)。前端 buildTree 拼树。下拉 / 树表复用。 */
278
278
  list: () => s.GET("/api/v1/sys/org/list", {}).then((e) => a(e)),
@@ -281,26 +281,26 @@ const C = {
281
281
  remove: (e) => s.DELETE("/api/v1/sys/org/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
282
282
  /** 复制机构子树(整支克隆挂到源节点同级),返回新根 Id。 */
283
283
  copy: (e, t) => s.POST("/api/v1/sys/org/{id}/copy", { params: { path: { id: e } }, body: t }).then((i) => a(i))
284
- }, j = {
284
+ }, F = {
285
285
  /** 职位分页;搜索键 name → PascalCase Name;sortField/sortOrder → 后端安全排序。下拉(拉大页)/ SmartTable 复用。 */
286
286
  page: (e) => s.GET("/api/v1/sys/position/page", {
287
287
  params: {
288
288
  query: {
289
- ...d(e),
289
+ ...r(e),
290
290
  Name: e.name,
291
291
  SortField: e.sortField,
292
292
  SortOrder: e.sortOrder
293
293
  }
294
294
  }
295
- }).then((t) => h(t)),
295
+ }).then((t) => d(t)),
296
296
  add: (e) => s.POST("/api/v1/sys/position/add", { body: e }).then((t) => a(t)),
297
297
  update: (e, t) => s.PUT("/api/v1/sys/position/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
298
298
  remove: (e) => s.DELETE("/api/v1/sys/position/{id}", { params: { path: { id: e } } }).then((t) => a(t))
299
299
  }, K = {
300
300
  /** 角色分页;搜索键 name → PascalCase Name。列表用 + 用户/授权页拉一大页当下拉源。 */
301
301
  page: (e) => s.GET("/api/v1/sys/role/page", {
302
- params: { query: { ...d(e), Name: e.name } }
303
- }).then((t) => h(t)),
302
+ params: { query: { ...r(e), Name: e.name } }
303
+ }).then((t) => d(t)),
304
304
  add: (e) => s.POST("/api/v1/sys/role/add", { body: e }).then((t) => a(t)),
305
305
  update: (e, t) => s.PUT("/api/v1/sys/role/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
306
306
  remove: (e) => s.DELETE("/api/v1/sys/role/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
@@ -318,7 +318,7 @@ const C = {
318
318
  getUsers: (e) => s.GET("/api/v1/sys/role/{id}/users", { params: { path: { id: e } } }).then((t) => a(t)),
319
319
  /** 全量设置角色关联的用户(空数组 = 收回全部)。 */
320
320
  setUsers: (e, t) => s.PUT("/api/v1/sys/role/users", { body: { roleId: e, userIds: t } }).then((i) => a(i))
321
- }, F = {
321
+ }, j = {
322
322
  list: () => s.GET("/api/v1/sys/module/list", {}).then((e) => a(e)),
323
323
  add: (e) => s.POST("/api/v1/sys/module/add", { body: e }).then((t) => a(t)),
324
324
  update: (e, t) => s.PUT("/api/v1/sys/module/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
@@ -328,14 +328,14 @@ const C = {
328
328
  page: (e) => s.GET("/api/v1/sys/config/page", {
329
329
  params: {
330
330
  query: {
331
- ...d(e),
331
+ ...r(e),
332
332
  ConfigKey: e.configKey,
333
333
  Name: e.name,
334
334
  GroupCode: e.groupCode,
335
335
  ExcludedGroupCodes: e.excludedGroupCodes
336
336
  }
337
337
  }
338
- }).then((t) => h(t)),
338
+ }).then((t) => d(t)),
339
339
  add: (e) => s.POST("/api/v1/sys/config", { body: e }).then((t) => a(t)),
340
340
  update: (e, t) => s.PUT("/api/v1/sys/config/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
341
341
  remove: (e) => s.DELETE("/api/v1/sys/config/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
@@ -363,8 +363,8 @@ const C = {
363
363
  (e) => a(e)
364
364
  )
365
365
  };
366
- function m(e) {
367
- const { start: t, end: i } = S(e);
366
+ function v(e) {
367
+ const { start: t, end: i } = f(e);
368
368
  return { StartTime: t, EndTime: i };
369
369
  }
370
370
  const B = {
@@ -372,28 +372,28 @@ const B = {
372
372
  loginPage: (e) => s.GET("/api/v1/sys/log/login/page", {
373
373
  params: {
374
374
  query: {
375
- ...d(e),
375
+ ...r(e),
376
376
  Account: e.account,
377
377
  Success: e.success,
378
- ...m(e.createTime)
378
+ ...v(e.createTime)
379
379
  }
380
380
  }
381
- }).then((t) => h(t)),
381
+ }).then((t) => d(t)),
382
382
  /** 清空登录日志(硬删,不可恢复)。 */
383
383
  loginClear: () => s.DELETE("/api/v1/sys/log/login", {}).then((e) => a(e)),
384
384
  /** 操作日志分页;操作名模糊 + 成败 + 操作人(精确)+ 接口路径(模糊)+ 时间范围——审计要能答"谁在什么时候干了什么"。 */
385
385
  opPage: (e) => s.GET("/api/v1/sys/log/op/page", {
386
386
  params: {
387
387
  query: {
388
- ...d(e),
388
+ ...r(e),
389
389
  Title: e.title,
390
390
  Success: e.success,
391
391
  OperatorId: e.operatorId,
392
392
  Path: e.path,
393
- ...m(e.createTime)
393
+ ...v(e.createTime)
394
394
  }
395
395
  }
396
- }).then((t) => h(t)),
396
+ }).then((t) => d(t)),
397
397
  /** 清空操作日志(硬删,不可恢复)。 */
398
398
  opClear: () => s.DELETE("/api/v1/sys/log/op", {}).then((e) => a(e)),
399
399
  /**
@@ -408,23 +408,23 @@ const B = {
408
408
  Success: e.success,
409
409
  OperatorId: e.operatorId,
410
410
  Path: e.path,
411
- ...m(e.createTime),
411
+ ...v(e.createTime),
412
412
  columns: e.columns
413
413
  }
414
414
  },
415
415
  parseAs: "blob"
416
- }).then((t) => v(t)),
416
+ }).then((t) => m(t)),
417
417
  /** 异常日志分页;接口路径模糊 + 异常类型模糊 + 时间范围。 */
418
418
  exceptionPage: (e) => s.GET("/api/v1/sys/log/exception/page", {
419
419
  params: {
420
420
  query: {
421
- ...d(e),
421
+ ...r(e),
422
422
  Path: e.path,
423
423
  ExceptionType: e.exceptionType,
424
- ...m(e.createTime)
424
+ ...v(e.createTime)
425
425
  }
426
426
  }
427
- }).then((t) => h(t)),
427
+ }).then((t) => d(t)),
428
428
  /** 清空异常日志(硬删,不可恢复)。 */
429
429
  exceptionClear: () => s.DELETE("/api/v1/sys/log/exception", {}).then((e) => a(e))
430
430
  }, M = {
@@ -454,8 +454,8 @@ const B = {
454
454
  }, _ = {
455
455
  /** 字典类型分页;搜索键 code/name → PascalCase Code/Name 查询参。 */
456
456
  typePage: (e) => s.GET("/api/v1/sys/dict/type/page", {
457
- params: { query: { ...d(e), Code: e.code, Name: e.name } }
458
- }).then((t) => h(t)),
457
+ params: { query: { ...r(e), Code: e.code, Name: e.name } }
458
+ }).then((t) => d(t)),
459
459
  typeAdd: (e) => s.POST("/api/v1/sys/dict/type", { body: e }).then((t) => a(t)),
460
460
  typeUpdate: (e, t) => s.PUT("/api/v1/sys/dict/type/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
461
461
  typeRemove: (e) => s.DELETE("/api/v1/sys/dict/type/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
@@ -473,8 +473,8 @@ const B = {
473
473
  }, H = {
474
474
  /** 文件分页;搜索键 originalName → 后端 FileName 模糊过滤。 */
475
475
  page: (e) => s.GET("/api/v1/sys/file/page", {
476
- params: { query: { ...d(e), FileName: e.originalName } }
477
- }).then((t) => h(t)),
476
+ params: { query: { ...r(e), FileName: e.originalName } }
477
+ }).then((t) => d(t)),
478
478
  /** 上传单个文件:bodySerializer 建 FormData(字段名 file),openapi-fetch 对 FormData 不注入 json header,浏览器自动补 boundary(client.ts 无需改)。 */
479
479
  upload: (e) => s.POST("/api/v1/sys/file/upload", {
480
480
  timeout: l,
@@ -505,30 +505,30 @@ const B = {
505
505
  timeout: l,
506
506
  body: { uploadId: e, index: t, chunk: i },
507
507
  bodySerializer: (o) => {
508
- const n = o, r = new FormData();
509
- return r.append("uploadId", n.uploadId), r.append("index", String(n.index)), r.append("chunk", n.chunk), r;
508
+ const n = o, p = new FormData();
509
+ return p.append("uploadId", n.uploadId), p.append("index", String(n.index)), p.append("chunk", n.chunk), p;
510
510
  }
511
511
  }).then((o) => a(o)),
512
512
  /** 完成:触发服务端合并 + 哈希校验 + 三道关 + 落库。 */
513
513
  chunkComplete: (e) => s.POST("/api/v1/sys/file/chunk/complete", { timeout: l, body: e }).then((t) => a(t))
514
514
  }, Q = {
515
515
  /** 在线会话分页(只读)。后端仅支持按 UserId 过滤,这里不带业务搜索。 */
516
- online: (e) => s.GET("/api/v1/sys/session/online", { params: { query: d(e) } }).then((t) => h(t)),
516
+ online: (e) => s.GET("/api/v1/sys/session/online", { params: { query: r(e) } }).then((t) => d(t)),
517
517
  /** 强制下线:按 sessionId 踢会话。 */
518
518
  kick: (e) => s.DELETE("/api/v1/sys/session/{sessionId}", { params: { path: { sessionId: e } } }).then((t) => a(t))
519
519
  }, V = {
520
520
  // ── 管理端 ──
521
521
  /** 管理端分页(全量);搜索键 title/type → PascalCase 查询参。 */
522
522
  page: (e) => s.GET("/api/v1/sys/notice/page", {
523
- params: { query: { ...d(e), Title: e.title, Type: e.type } }
524
- }).then((t) => h(t)),
523
+ params: { query: { ...r(e), Title: e.title, Type: e.type } }
524
+ }).then((t) => d(t)),
525
525
  publish: (e) => s.POST("/api/v1/sys/notice", { body: e }).then((t) => a(t)),
526
526
  remove: (e) => s.DELETE("/api/v1/sys/notice/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
527
527
  // ── 用户端(任何登录用户) ──
528
528
  /** 我的通知分页(含已读标记);onlyUnread 供"未读"页签用。 */
529
529
  mine: (e) => s.GET("/api/v1/sys/notice/mine", {
530
- params: { query: { ...d(e), OnlyUnread: e.onlyUnread } }
531
- }).then((t) => h(t)),
530
+ params: { query: { ...r(e), OnlyUnread: e.onlyUnread } }
531
+ }).then((t) => d(t)),
532
532
  /** 当前用户未读通知数(顶栏角标轮询)。 */
533
533
  unreadCount: () => s.GET("/api/v1/sys/notice/unread-count", {}).then((e) => a(e)),
534
534
  markRead: (e) => s.PUT("/api/v1/sys/notice/{id}/read", { params: { path: { id: e } } }).then((t) => a(t)),
@@ -545,7 +545,7 @@ const B = {
545
545
  page: (e) => s.GET("/api/v1/sys/job/page", {
546
546
  params: {
547
547
  query: {
548
- ...d(e),
548
+ ...r(e),
549
549
  Name: e.name,
550
550
  Status: e.status,
551
551
  HandlerKind: e.handlerKind,
@@ -553,7 +553,7 @@ const B = {
553
553
  SortOrder: e.sortOrder
554
554
  }
555
555
  }
556
- }).then((t) => h(t)),
556
+ }).then((t) => d(t)),
557
557
  add: (e) => s.POST("/api/v1/sys/job", { body: e }).then((t) => a(t)),
558
558
  update: (e, t) => s.PUT("/api/v1/sys/job/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
559
559
  remove: (e) => s.DELETE("/api/v1/sys/job/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
@@ -576,7 +576,7 @@ const B = {
576
576
  return s.GET("/api/v1/sys/job/log/page", {
577
577
  params: {
578
578
  query: {
579
- ...d(e),
579
+ ...r(e),
580
580
  JobId: e.jobId,
581
581
  RunStatus: e.runStatus,
582
582
  FireInstanceId: e.fireInstanceId,
@@ -584,7 +584,7 @@ const B = {
584
584
  StartTo: (i = e.startRange) != null && i[1] ? `${e.startRange[1]} 23:59:59` : void 0
585
585
  }
586
586
  }
587
- }).then((o) => h(o));
587
+ }).then((o) => d(o));
588
588
  },
589
589
  /** 终止一次执行(跨节点写终止旗标,目标节点最迟 KillPollSeconds 后停)。 */
590
590
  kill: (e) => s.POST("/api/v1/sys/job/log/{id}/kill", { params: { path: { id: e } } }).then((t) => a(t)),
@@ -594,45 +594,112 @@ const B = {
594
594
  dashboard: () => s.GET("/api/v1/sys/job/dashboard", {}).then((e) => a(e))
595
595
  }, Y = {
596
596
  page: (e) => (t) => s.GET("/api/v1/sys/recycle/{type}/page", {
597
- params: { path: { type: e }, query: d(t) }
598
- }).then((i) => h(i)),
597
+ params: { path: { type: e }, query: r(t) }
598
+ }).then((i) => d(i)),
599
599
  restore: (e, t) => s.POST("/api/v1/sys/recycle/{type}/{id}/restore", { params: { path: { type: e, id: t } } }).then((i) => a(i)),
600
600
  purge: (e, t) => s.DELETE("/api/v1/sys/recycle/{type}/{id}", { params: { path: { type: e, id: t } } }).then((i) => a(i))
601
+ }, Z = {
602
+ /** 厂商分页(含模型清单);搜索键 keyword/enabled → PascalCase 查询参。 */
603
+ page: (e) => s.GET("/api/v1/sys/ai/provider/page", {
604
+ params: {
605
+ query: {
606
+ ...r(e),
607
+ Keyword: e.keyword,
608
+ Enabled: e.enabled
609
+ }
610
+ }
611
+ }).then((t) => d(t)),
612
+ get: (e) => s.GET("/api/v1/sys/ai/provider/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
613
+ /** 厂商预置清单(协议/BaseUrl/鉴权方式/起步模型),新增抽屉选预设用。 */
614
+ presets: () => s.GET("/api/v1/sys/ai/provider/presets", {}).then((e) => a(e)),
615
+ add: (e) => s.POST("/api/v1/sys/ai/provider/add", { body: e }).then((t) => a(t)),
616
+ /** 更新入参没有 preset/protocol 字段——这两项创建后不可改,类型层面就不给改的机会。 */
617
+ update: (e, t) => s.PUT("/api/v1/sys/ai/provider/{id}", { params: { path: { id: e } }, body: t }).then((i) => a(i)),
618
+ /** 启用时若未配置 Key 会被后端拒绝(49004),调用方按 StatusSwitch 模式处理失败回弹。 */
619
+ setEnabled: (e, t) => s.PUT("/api/v1/sys/ai/provider/{id}/enabled", { params: { path: { id: e }, query: { enabled: t } } }).then((i) => a(i)),
620
+ remove: (e) => s.DELETE("/api/v1/sys/ai/provider/{id}", { params: { path: { id: e } } }).then((t) => a(t)),
621
+ /** 测试连接:用库里当前配置发一条最小对话;失败原因在返回体里,不抛异常。 */
622
+ test: (e) => s.POST("/api/v1/sys/ai/provider/{id}/test", { params: { path: { id: e } } }).then((t) => a(t))
623
+ }, ee = {
624
+ /** 区间总计 + 按维度分组聚合(groupBy 切换四个 Tab 共用这一个接口)。 */
625
+ summary: (e) => s.GET("/api/v1/sys/ai/usage/summary", {
626
+ params: {
627
+ query: {
628
+ From: e.from,
629
+ To: e.to,
630
+ ProviderCode: e.providerCode,
631
+ Model: e.model,
632
+ Scene: e.scene,
633
+ UserId: e.userId,
634
+ GroupBy: e.groupBy
635
+ }
636
+ }
637
+ }).then((t) => a(t)),
638
+ /** 按天趋势;区间内无数据的日期后端已补 0,前端直接画连续折线。 */
639
+ trend: (e) => s.GET("/api/v1/sys/ai/usage/trend", {
640
+ params: {
641
+ query: {
642
+ From: e.from,
643
+ To: e.to,
644
+ ProviderCode: e.providerCode,
645
+ Model: e.model,
646
+ Scene: e.scene,
647
+ UserId: e.userId
648
+ }
649
+ }
650
+ }).then((t) => a(t)),
651
+ /** 明细分页(不聚合);from/to 在这里是可选的(不筛日期就是全量分页)。 */
652
+ page: (e) => s.GET("/api/v1/sys/ai/usage/page", {
653
+ params: {
654
+ query: {
655
+ ...r(e),
656
+ From: e.from,
657
+ To: e.to,
658
+ ProviderCode: e.providerCode,
659
+ Model: e.model,
660
+ Scene: e.scene,
661
+ UserId: e.userId,
662
+ Success: e.success
663
+ }
664
+ }
665
+ }).then((t) => d(t))
601
666
  };
602
667
  export {
603
668
  u as ApiError,
669
+ Z as aiProviderApi,
670
+ ee as aiUsageApi,
604
671
  C as authApi,
605
672
  $ as cacheApi,
606
- x as callApi,
673
+ U as callApi,
607
674
  z as configApi,
608
- I as dashboardApi,
609
- S as dayRange,
675
+ k as dashboardApi,
676
+ f as dayRange,
610
677
  _ as dictAdminApi,
611
678
  J as dictApi,
612
- k as externalAuthApi,
679
+ D as externalAuthApi,
613
680
  H as fileApi,
614
- N as highSensApi,
681
+ q as highSensApi,
615
682
  X as jobApi,
616
- U as listQuery,
683
+ x as listQuery,
617
684
  B as logApi,
618
685
  W as menuApi,
619
- D as mfaApi,
620
- F as moduleApi,
686
+ I as mfaApi,
687
+ j as moduleApi,
621
688
  M as monitorApi,
622
689
  O as normalizeCommit,
623
690
  g as normalizePreview,
624
691
  V as noticeApi,
625
692
  R as orgApi,
626
- d as pageParams,
693
+ r as pageParams,
627
694
  L as personalApi,
628
- j as positionApi,
695
+ F as positionApi,
629
696
  Y as recycleApi,
630
697
  K as roleApi,
631
698
  Q as sessionApi,
632
- h as toPage,
699
+ d as toPage,
633
700
  T as toWireRows,
634
701
  a as unwrap,
635
- v as unwrapDownload,
636
- q as userApi
702
+ m as unwrapDownload,
703
+ N as userApi
637
704
  };
638
705
  //# sourceMappingURL=index.js.map