@ximatai/muyun-web-app 0.26.13 → 0.26.14

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 (64) hide show
  1. package/dist/{BusinessActivityLogView-UC4rH4Fn.js → BusinessActivityLogView-BUg5WTm-.js} +1 -1
  2. package/dist/BusinessLogListDrawer-BOTE_7aT.js +825 -0
  3. package/dist/{LoginAuditLogView-Cjrp8MKX.js → LoginAuditLogView-DBNtvmIy.js} +1 -1
  4. package/dist/{ModuleActionManagementView-Dkb35QXc.js → ModuleActionManagementView-Bq1VO51Y.js} +165 -165
  5. package/dist/{ModuleGovernanceView-Dx43QvGf.js → ModuleGovernanceView-B8u4_erd.js} +3570 -2877
  6. package/dist/{RequestErrorLogView-WnGvMWiF.js → RequestErrorLogView-BrtH3ptj.js} +1 -1
  7. package/dist/{RoleDetailWorkspaceView-DPDb_QOn.js → RoleDetailWorkspaceView-6LW3tLA1.js} +276 -276
  8. package/dist/{RuntimeLogView-BRl4ZDkU.js → RuntimeLogView-s3X5CdHB.js} +47 -80
  9. package/dist/index.css +1 -1
  10. package/dist/index.js +400 -400
  11. package/dist/{moduleGovernanceWorkspaceView-4V_UW-Bt.js → moduleGovernanceWorkspaceView-BRgJbUjJ.js} +2 -2
  12. package/dist/{platform-components-1cvOeHmo.js → platform-components-Dt859Hbr.js} +3449 -2676
  13. package/dist/platform-workbench-DfqFnlm-.js +14701 -0
  14. package/dist/{http-B0TC0pJB.js → sse-mGbuCAax.js} +41 -11
  15. package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +218 -8
  16. package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +230 -18
  17. package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +2 -2
  18. package/dist/types/dynamic-page-runtime/assistantRecordEditorPolicy.d.ts +6 -0
  19. package/dist/types/dynamic-page-runtime/composables/useModulePageListSession.d.ts +1 -0
  20. package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +2 -0
  21. package/dist/types/dynamic-page-runtime/index.d.ts +1 -0
  22. package/dist/types/dynamic-page-runtime/modulePageAssistantScope.d.ts +8 -0
  23. package/dist/types/dynamic-page-runtime/modulePageAssistantSurface.d.ts +6 -0
  24. package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +110 -5
  25. package/dist/types/dynamic-page-runtime/useTenantScopeController.d.ts +1 -0
  26. package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +8 -0
  27. package/dist/types/platform-components/QueryValueEditor.vue.d.ts +1 -1
  28. package/dist/types/platform-components/RecordDetailFields.vue.d.ts +1 -1
  29. package/dist/types/platform-components/RecordFormFields.vue.d.ts +1 -1
  30. package/dist/types/platform-components/RecordQueryListCell.vue.d.ts +1 -1
  31. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +8 -0
  32. package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +5 -2
  33. package/dist/types/platform-components/index.d.ts +4 -1
  34. package/dist/types/platform-components/querySettlementController.d.ts +5 -0
  35. package/dist/types/platform-components/recordQueryListColumnModel.d.ts +7 -0
  36. package/dist/types/platform-components/recordQueryListQueryController.d.ts +36 -0
  37. package/dist/types/platform-components/recordTreeQueryController.d.ts +18 -0
  38. package/dist/types/platform-components/referencePickerModel.d.ts +2 -0
  39. package/dist/types/platform-workbench/AssistantMarkdownContent.vue.d.ts +6 -0
  40. package/dist/types/platform-workbench/AssistantSelectionCard.vue.d.ts +15 -0
  41. package/dist/types/platform-workbench/Workbench.vue.d.ts +7 -2
  42. package/dist/types/platform-workbench/WorkbenchAssistantPanel.vue.d.ts +12 -0
  43. package/dist/types/platform-workbench/assistantMarkdown.d.ts +1 -0
  44. package/dist/types/platform-workbench/index.d.ts +1 -0
  45. package/dist/types/platform-workbench/workbenchAssistantCapabilities.d.ts +3 -0
  46. package/dist/types/views/BusinessLogRetentionControl.vue.d.ts +7 -0
  47. package/dist/types/views/businessLogClient.d.ts +3 -0
  48. package/dist/types/views/businessLogRetentionClient.d.ts +25 -0
  49. package/dist/types/views/metadataGovernanceAssistantSurface.d.ts +122 -0
  50. package/dist/types/views/metadataModelChangeSetClient.d.ts +36 -0
  51. package/dist/types/views/metadataNaming.d.ts +4 -0
  52. package/dist/types/views/runtimeLogSse.d.ts +3 -13
  53. package/dist/types/vue-ui-antdv/components/UiTextArea.vue.d.ts +2 -0
  54. package/dist/types/web-contracts/assistant.d.ts +59 -0
  55. package/dist/types/web-contracts/index.d.ts +1 -0
  56. package/dist/types/web-core/assistantRuntime.d.ts +77 -0
  57. package/dist/types/web-core/assistantSurface.d.ts +92 -0
  58. package/dist/types/web-core/assistantTurnClient.d.ts +8 -0
  59. package/dist/types/web-core/index.d.ts +4 -0
  60. package/dist/types/web-core/sse.d.ts +9 -0
  61. package/dist/{workspaceViews-CCg6V0pr.js → workspaceViews-DijY4n32.js} +554 -554
  62. package/package.json +1 -1
  63. package/dist/BusinessLogListDrawer-BtaXVJKz.js +0 -564
  64. package/dist/platform-workbench-Cu14Xd9d.js +0 -10299
@@ -0,0 +1,825 @@
1
+ import { $t as e, A as t, Bt as n, Jt as r, Lt as i, Mt as a, Tn as o, Ut as s, Vt as c, Wt as l, dn as u, hn as d, m as f, ot as p, p as m, vn as h, zt as g } from "./platform-components-Dt859Hbr.js";
2
+ import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, normalizeClass as E, openBlock as D, ref as O, renderList as k, toDisplayString as A, unref as j, withCtx as M } from "vue";
3
+ //#region src/views/businessLogClient.ts
4
+ var N = {
5
+ activity: "/platform.business_activity_log",
6
+ "request-error": "/platform.request_error_log",
7
+ login: "/iam.login_audit_log"
8
+ };
9
+ function P(e, t) {
10
+ let n = N[t];
11
+ return {
12
+ async detail(t) {
13
+ return z(await e.request({ path: `${n}/${encodeURIComponent(t)}` }));
14
+ },
15
+ async operatorCandidates(t) {
16
+ return F(await e.request({
17
+ method: "POST",
18
+ path: `${n}/operator-candidates/query`,
19
+ body: {
20
+ keyword: t.keyword,
21
+ selectedIds: t.selectedIds,
22
+ tenantId: t.tenantId,
23
+ organizationId: t.organizationId,
24
+ departmentId: t.departmentId,
25
+ page: {
26
+ pageNum: t.pageNum ?? 1,
27
+ pageSize: t.pageSize ?? 20
28
+ }
29
+ }
30
+ }));
31
+ },
32
+ ...t === "activity" ? {
33
+ actionStatistics: async (t) => V(await e.request({
34
+ method: "POST",
35
+ path: `${n}/statistics/actions`,
36
+ body: t
37
+ })),
38
+ pageAccessStatistics: async (t) => V(await e.request({
39
+ method: "POST",
40
+ path: `${n}/statistics/page-access`,
41
+ body: t
42
+ }))
43
+ } : {},
44
+ ...t === "request-error" ? { diagnostic: async (t) => {
45
+ let r = await e.request({ path: `${n}/${encodeURIComponent(t)}/diagnostic` });
46
+ return W(W(r).diagnostic ?? r);
47
+ } } : {}
48
+ };
49
+ }
50
+ function F(e) {
51
+ let t = W(e);
52
+ return {
53
+ records: R(t.records),
54
+ selectedRecords: R(t.selectedRecords),
55
+ total: q(t.total),
56
+ navigation: I(t.navigation)
57
+ };
58
+ }
59
+ function I(e) {
60
+ let t = W(e);
61
+ if (Object.keys(t).length) return {
62
+ showTenantNavigation: J(t.showTenantNavigation) === !0,
63
+ tenants: L(t.tenants),
64
+ organizations: L(t.organizations),
65
+ departments: L(t.departments)
66
+ };
67
+ }
68
+ function L(e) {
69
+ return Array.isArray(e) ? e.flatMap((e) => {
70
+ let t = W(e), n = K(t.id);
71
+ return n ? [{
72
+ id: n,
73
+ title: K(t.title) ?? n,
74
+ tenantId: K(t.tenantId),
75
+ organizationId: K(t.organizationId)
76
+ }] : [];
77
+ }) : [];
78
+ }
79
+ function R(e) {
80
+ if (!Array.isArray(e)) return [];
81
+ let t = [];
82
+ for (let n of e) {
83
+ let e = W(n), r = K(e.id);
84
+ if (!r) continue;
85
+ let i = {
86
+ id: r,
87
+ title: K(e.title) ?? r
88
+ };
89
+ [
90
+ "account",
91
+ "employeeName",
92
+ "organizationId",
93
+ "organizationName",
94
+ "departmentId",
95
+ "departmentName"
96
+ ].forEach((t) => {
97
+ let n = K(e[t]);
98
+ n && (i[t] = n);
99
+ }), t.push(i);
100
+ }
101
+ return t;
102
+ }
103
+ function z(e) {
104
+ let t = W(e), n = W(t.event ?? t.record ?? e);
105
+ return {
106
+ ...n,
107
+ eventId: K(n.eventId ?? n.id) ?? "",
108
+ eventType: K(n.eventType ?? n.type) ?? "",
109
+ occurredAt: K(n.occurredAt),
110
+ capturedAt: K(n.capturedAt),
111
+ traceId: K(n.traceId),
112
+ tenantId: K(n.tenantId),
113
+ operatorId: K(n.operatorId),
114
+ operatorOrganizationId: K(n.operatorOrganizationId),
115
+ operatorIdentity: ee(n),
116
+ moduleAlias: K(n.moduleAlias),
117
+ actionCode: K(n.actionCode),
118
+ entityAlias: K(n.entityAlias ?? W(n.details).entityAlias),
119
+ recordId: K(n.recordId ?? W(n.details).recordId),
120
+ mutationSource: K(n.mutationSource ?? W(n.details).mutationSource),
121
+ outcome: K(n.outcome ?? n.result ?? W(n.details).outcome),
122
+ loginAccount: B(n, W(n.details)),
123
+ summary: H(n, W(n.details)),
124
+ details: G(n.details)
125
+ };
126
+ }
127
+ function B(e, t) {
128
+ return K(e.loginAccount) ?? K(t.confirmedAccount) ?? K(t.claimedAccount);
129
+ }
130
+ function V(e) {
131
+ let t = W(e);
132
+ return Array.isArray(t.pages) ? {
133
+ items: t.pages.map((e) => {
134
+ let t = W(e);
135
+ return {
136
+ key: K(t.pageKey) ?? "unknown-page",
137
+ title: K(t.pageKey) ?? "未知页面",
138
+ count: q(t.accessCount)
139
+ };
140
+ }),
141
+ complete: J(t.complete)
142
+ } : {
143
+ items: [
144
+ ["executionCount", "执行次数"],
145
+ ["successCount", "成功次数"],
146
+ ["failureCount", "失败次数"],
147
+ ["rejectedCount", "拒绝次数"],
148
+ ["knownDurationCount", "含耗时记录数"],
149
+ ["totalDurationMillis", "累计耗时(毫秒)"],
150
+ ["knownAffectedRecordCount", "含影响数记录数"],
151
+ ["totalAffectedRecordCount", "累计影响记录数"]
152
+ ].map(([e, n]) => ({
153
+ key: e,
154
+ title: n,
155
+ count: q(t[e])
156
+ })),
157
+ complete: J(t.complete)
158
+ };
159
+ }
160
+ function H(e, t) {
161
+ return K(e.summary ?? e.message ?? e.description) ?? U(t.message) ?? U(t.responseSummary) ?? K(t.reasonCode) ?? K(t.failureStage) ?? K(t.pageKey) ?? K(t.errorCode) ?? K(t.authenticationMethod);
162
+ }
163
+ function U(e) {
164
+ return K(e) ?? K(W(e).value);
165
+ }
166
+ function ee(e) {
167
+ let t = W(e.operatorIdentity), n = K(t.employeeName), r = K(t.username), i = K(t.organizationId), a = K(t.organizationName), o = K(t.departmentId), s = K(t.departmentName);
168
+ return n || r || i || a || o || s ? {
169
+ employeeName: n,
170
+ username: r,
171
+ organizationId: i,
172
+ organizationName: a,
173
+ departmentId: o,
174
+ departmentName: s
175
+ } : void 0;
176
+ }
177
+ function W(e) {
178
+ return typeof e == "object" && e && !Array.isArray(e) ? e : {};
179
+ }
180
+ function G(e) {
181
+ let t = W(e);
182
+ return Object.keys(t).length > 0 ? t : void 0;
183
+ }
184
+ function K(e) {
185
+ return typeof e == "string" && e.length > 0 ? e : void 0;
186
+ }
187
+ function q(e) {
188
+ return typeof e == "number" && Number.isFinite(e) ? e : 0;
189
+ }
190
+ function J(e) {
191
+ return typeof e == "boolean" ? e : void 0;
192
+ }
193
+ //#endregion
194
+ //#region src/views/businessLogRetentionClient.ts
195
+ function te(e) {
196
+ let t = "/platform.business_log_retention";
197
+ return {
198
+ async policies() {
199
+ let n = await e.request({ path: `${t}/policies` });
200
+ return Array.isArray(n) ? n : [];
201
+ },
202
+ async update(n) {
203
+ return await e.request({
204
+ method: "POST",
205
+ path: `${t}/policies/${n.eventType}`,
206
+ body: {
207
+ automaticCleanupEnabled: n.automaticCleanupEnabled,
208
+ retentionDays: n.retentionDays,
209
+ version: n.version
210
+ }
211
+ });
212
+ },
213
+ async purge(n, r) {
214
+ return await e.request({
215
+ method: "POST",
216
+ path: `${t}/policies/${n}/purge`,
217
+ body: { retentionDays: r }
218
+ });
219
+ }
220
+ };
221
+ }
222
+ //#endregion
223
+ //#region src/views/BusinessLogRetentionControl.vue?vue&type=script&setup=true&lang.ts
224
+ var ne = {
225
+ key: 3,
226
+ class: "business-log-retention-control__policies"
227
+ }, Y = { key: 0 }, re = { class: "business-log-retention-control__automatic-cleanup" }, X = { class: "business-log-retention-control__content" }, ie = { class: "business-log-retention-control__retention-days" }, ae = { class: "business-log-retention-control__retention-row" }, oe = {
228
+ key: 0,
229
+ class: "business-log-retention-control__validation"
230
+ }, se = /*#__PURE__*/ h(/* @__PURE__ */ T({
231
+ name: "BusinessLogRetentionControl",
232
+ __name: "BusinessLogRetentionControl",
233
+ props: { eventTypes: {} },
234
+ setup(t) {
235
+ let i = t, f = o({
236
+ moduleAlias: "platform.business_log_retention",
237
+ runtimeAccess: "VIEW"
238
+ }), m = te(f.http), h = O(!1), T = O([]), E = O({}), N = O(!1), P = O(), F = O(), I = O(), L = v(() => f.can("viewRetentionPolicies") === !0), R = v(() => f.can("configureRetentionPolicy") === !0), z = v(() => f.can("purgeExpiredLogs") === !0), B = v(() => F.value !== void 0 || I.value !== void 0), V = v(() => {
239
+ let e = new Set(i.eventTypes);
240
+ return T.value.filter((t) => e.has(t.eventType));
241
+ }), H = v(() => V.value.some(J));
242
+ async function U() {
243
+ L.value && (h.value = !0, await ee());
244
+ }
245
+ async function ee() {
246
+ N.value = !0, P.value = void 0;
247
+ try {
248
+ let e = await m.policies(), t = new Set(i.eventTypes), n = e.filter((e) => t.has(e.eventType));
249
+ T.value = n.map((e) => ({ ...e })), E.value = Object.fromEntries(n.map((e) => [e.eventType, { ...e }]));
250
+ } catch (e) {
251
+ P.value = ce(e), a(e, {
252
+ source: "business-log-retention",
253
+ phase: "load"
254
+ });
255
+ } finally {
256
+ N.value = !1;
257
+ }
258
+ }
259
+ async function W() {
260
+ return B.value ? (g("自动清理操作正在执行,请稍候。"), !1) : !H.value || c({
261
+ title: "放弃未保存的自动清理设置?",
262
+ content: "关闭后,本次未保存的自动清理和保留天数修改将丢失。"
263
+ });
264
+ }
265
+ async function G(e) {
266
+ if (Z(e.retentionDays) && J(e) && !B.value) {
267
+ F.value = e.eventType;
268
+ try {
269
+ q(await m.update(e)), n(`${Q(e.eventType)}自动清理设置已保存`);
270
+ } catch (e) {
271
+ a(e, {
272
+ source: "business-log-retention",
273
+ phase: "action"
274
+ });
275
+ } finally {
276
+ F.value = void 0;
277
+ }
278
+ }
279
+ }
280
+ async function K(e) {
281
+ if (Z(e.retentionDays) && !B.value && await c({
282
+ title: `立即清理${Q(e.eventType)}`,
283
+ content: `将删除严格早于 ${e.retentionDays} 天的日志。本次清理不会保存对保留天数的修改,且操作不可恢复。`,
284
+ requiredText: `清理${Q(e.eventType)}`,
285
+ danger: !0
286
+ })) {
287
+ I.value = e.eventType;
288
+ try {
289
+ let t = await m.purge(e.eventType, e.retentionDays);
290
+ if (t.result.status === "ALREADY_RUNNING") {
291
+ g("已有日志清理任务正在运行,本次未执行。");
292
+ return;
293
+ }
294
+ n(t.result.status === "BATCH_LIMIT_REACHED" ? `本轮已清理 ${t.result.deletedCount} 条,剩余数据将在后续批次继续处理` : `已清理 ${t.result.deletedCount} 条${Q(e.eventType)}`);
295
+ } catch (e) {
296
+ a(e, {
297
+ source: "business-log-retention",
298
+ phase: "action"
299
+ });
300
+ } finally {
301
+ I.value = void 0;
302
+ }
303
+ }
304
+ }
305
+ function q(e) {
306
+ E.value = {
307
+ ...E.value,
308
+ [e.eventType]: { ...e }
309
+ }, T.value = T.value.map((t) => t.eventType === e.eventType ? { ...e } : t);
310
+ }
311
+ function J(e) {
312
+ let t = E.value[e.eventType];
313
+ return !t || t.retentionDays !== e.retentionDays || t.automaticCleanupEnabled !== e.automaticCleanupEnabled;
314
+ }
315
+ function se(e, t) {
316
+ e.retentionDays = Number(t);
317
+ }
318
+ function Z(e) {
319
+ return Number.isInteger(e) && e >= 1 && e <= 36500;
320
+ }
321
+ function Q(e) {
322
+ return {
323
+ LOGIN: "登录日志",
324
+ ACTION: "动作日志",
325
+ REQUEST_ERROR: "异常日志",
326
+ PAGE_ACCESS: "页面访问日志"
327
+ }[e];
328
+ }
329
+ function ce(e) {
330
+ return e instanceof Error ? e.message : "自动清理设置加载失败。";
331
+ }
332
+ return (t, n) => (D(), x(_, null, [L.value ? (D(), y(j(d), {
333
+ key: 0,
334
+ onClick: U
335
+ }, {
336
+ default: M(() => [...n[1] ||= [C("自动清理", -1)]]),
337
+ _: 1
338
+ })) : b("v-if", !0), w(j(p), {
339
+ open: h.value,
340
+ title: "自动清理",
341
+ subtitle: "配置当前日志类型的自动清理和保留期限。",
342
+ width: "standard",
343
+ scope: "viewport",
344
+ "before-close": W,
345
+ onClose: n[0] ||= (e) => h.value = !1
346
+ }, {
347
+ default: M(() => [N.value ? (D(), y(j(l), {
348
+ key: 0,
349
+ tip: "加载自动清理设置"
350
+ })) : P.value ? (D(), y(j(s), {
351
+ key: 1,
352
+ title: "自动清理设置不可用",
353
+ message: P.value
354
+ }, null, 8, ["message"])) : V.value.length === 0 ? (D(), y(j(r), {
355
+ key: 2,
356
+ description: "暂无可管理的自动清理设置"
357
+ })) : (D(), x("section", ne, [(D(!0), x(_, null, k(V.value, (t) => (D(), x("article", { key: t.eventType }, [
358
+ S("header", null, [S("div", null, [S("h3", null, A(Q(t.eventType)), 1), t.updatedAt ? (D(), x("small", Y, [C(" 最近更新:" + A(t.updatedAt), 1), t.updatedBy ? (D(), x(_, { key: 0 }, [C(" · " + A(t.updatedBy), 1)], 64)) : b("v-if", !0)])) : b("v-if", !0)]), S("label", re, [n[2] ||= S("span", null, "自动清理", -1), w(j(e), {
359
+ checked: t.automaticCleanupEnabled,
360
+ "onUpdate:checked": (e) => t.automaticCleanupEnabled = e,
361
+ disabled: !R.value || B.value,
362
+ "checked-text": "启用",
363
+ "unchecked-text": "停用"
364
+ }, null, 8, [
365
+ "checked",
366
+ "onUpdate:checked",
367
+ "disabled"
368
+ ])])]),
369
+ S("div", X, [S("label", ie, [
370
+ n[4] ||= S("span", null, "保留天数", -1),
371
+ S("span", ae, [w(j(u), {
372
+ value: t.retentionDays,
373
+ type: "number",
374
+ disabled: !R.value || B.value,
375
+ "aria-label": `${Q(t.eventType)}保留天数`,
376
+ "onUpdate:value": (e) => se(t, e)
377
+ }, null, 8, [
378
+ "value",
379
+ "disabled",
380
+ "aria-label",
381
+ "onUpdate:value"
382
+ ]), z.value ? (D(), y(j(d), {
383
+ key: 0,
384
+ intent: "danger",
385
+ disabled: B.value || !Z(t.retentionDays),
386
+ loading: I.value === t.eventType,
387
+ onClick: (e) => K(t)
388
+ }, {
389
+ default: M(() => [...n[3] ||= [C(" 立即清理 ", -1)]]),
390
+ _: 1
391
+ }, 8, [
392
+ "disabled",
393
+ "loading",
394
+ "onClick"
395
+ ])) : b("v-if", !0)]),
396
+ Z(t.retentionDays) ? b("v-if", !0) : (D(), x("small", oe, " 请输入 1 至 36500 之间的整数。 "))
397
+ ])]),
398
+ S("footer", null, [R.value ? (D(), y(j(d), {
399
+ key: 0,
400
+ emphasis: "primary",
401
+ disabled: B.value || !Z(t.retentionDays) || !J(t),
402
+ loading: F.value === t.eventType,
403
+ onClick: (e) => G(t)
404
+ }, {
405
+ default: M(() => [...n[5] ||= [C(" 保存 ", -1)]]),
406
+ _: 1
407
+ }, 8, [
408
+ "disabled",
409
+ "loading",
410
+ "onClick"
411
+ ])) : b("v-if", !0)])
412
+ ]))), 128))]))]),
413
+ _: 1
414
+ }, 8, ["open"])], 64));
415
+ }
416
+ }), [["__scopeId", "data-v-f75c1238"]]), Z = {
417
+ key: 2,
418
+ class: "business-log-list__detail"
419
+ }, Q = {
420
+ key: 4,
421
+ class: "business-log-list__diagnostic"
422
+ }, ce = {
423
+ key: 1,
424
+ class: "business-log-list__detail"
425
+ }, le = {
426
+ key: 0,
427
+ class: "business-log-list__hint"
428
+ }, ue = {
429
+ key: 1,
430
+ class: "business-log-list__detail"
431
+ }, de = /*#__PURE__*/ h(/* @__PURE__ */ T({
432
+ name: "BusinessLogListDrawer",
433
+ __name: "BusinessLogListDrawer",
434
+ props: {
435
+ surface: {},
436
+ moduleAlias: {},
437
+ title: {}
438
+ },
439
+ setup(e) {
440
+ let n = e, c = o({ moduleAlias: n.moduleAlias }), u = P(c.http, n.surface), h = {
441
+ title: "选择操作用户",
442
+ placeholder: "按账号或用户 ID 搜索",
443
+ searchPlaceholder: "按账号或用户 ID 搜索",
444
+ mode: "dialog",
445
+ columns: f,
446
+ provider: m({
447
+ sourceIdentity: {
448
+ targetModuleAlias: "iam.user",
449
+ source: {
450
+ kind: "businessPurpose",
451
+ id: `${n.moduleAlias}:operators`
452
+ }
453
+ },
454
+ searchPage: async ({ keyword: e, pageNum: t, pageSize: n, scope: r }) => {
455
+ let i = await u.operatorCandidates({
456
+ keyword: e,
457
+ pageNum: t,
458
+ pageSize: n,
459
+ ...r
460
+ });
461
+ return {
462
+ records: i.records,
463
+ total: i.total,
464
+ navigation: i.navigation
465
+ };
466
+ },
467
+ resolveUsers: async (e) => (await u.operatorCandidates({ selectedIds: e })).selectedRecords
468
+ })
469
+ }, g = O(), T = O(!1), N = O(), F = O(), I = O(!1), L = O(), R = O(!1), z = O(), B = O(), V = O(!1), H = O(), U = O(), ee = v(() => we[n.surface]), W = v(() => n.surface === "activity"), G = v(() => n.surface === "request-error"), K = v(() => ({
470
+ login: ["LOGIN"],
471
+ activity: ["ACTION", "PAGE_ACCESS"],
472
+ "request-error": ["REQUEST_ERROR"]
473
+ })[n.surface]), q = v(() => c.can("viewInternalDiagnostic") === !0), J = v(() => ee.value.columns), te = v(() => g.value ? ge(g.value) : []), ne = v(() => xe(F.value)), Y = v(() => [..._e("业务动作", z.value), ..._e("页面访问", B.value)]), re = v(() => z.value?.complete === !1 || B.value?.complete === !1);
474
+ async function X(e) {
475
+ let t = e, n = t.eventId;
476
+ if (n) {
477
+ g.value = t, N.value = void 0, F.value = void 0, L.value = void 0, T.value = !0;
478
+ try {
479
+ g.value = await u.detail(n);
480
+ } catch (e) {
481
+ N.value = Ce(e), a(e, {
482
+ source: "business-log-detail",
483
+ phase: "load"
484
+ });
485
+ } finally {
486
+ T.value = !1;
487
+ }
488
+ }
489
+ }
490
+ async function ie() {
491
+ if (W.value && !V.value) {
492
+ R.value = !0, V.value = !0, H.value = void 0;
493
+ try {
494
+ let e = U.value ?? de(), [t, n] = await Promise.all([u.actionStatistics?.(e), u.pageAccessStatistics?.(e)]);
495
+ z.value = t, B.value = n;
496
+ } catch (e) {
497
+ H.value = Ce(e), a(e, {
498
+ source: "business-log-statistics",
499
+ phase: "load"
500
+ });
501
+ } finally {
502
+ V.value = !1;
503
+ }
504
+ }
505
+ }
506
+ async function ae() {
507
+ let e = g.value?.eventId;
508
+ if (u.diagnostic && e && !I.value) {
509
+ I.value = !0, L.value = void 0;
510
+ try {
511
+ F.value = await u.diagnostic(e);
512
+ } catch (e) {
513
+ L.value = Ce(e), a(e, {
514
+ source: "business-log-diagnostic",
515
+ phase: "load"
516
+ });
517
+ } finally {
518
+ I.value = !1;
519
+ }
520
+ }
521
+ }
522
+ function oe(e) {
523
+ U.value = e, z.value = void 0, B.value = void 0;
524
+ }
525
+ function de() {
526
+ return {
527
+ page: {
528
+ pageNum: 1,
529
+ pageSize: 50
530
+ },
531
+ conditions: []
532
+ };
533
+ }
534
+ function fe(e) {
535
+ return e.name === "operatorId" ? h : void 0;
536
+ }
537
+ function pe(e, t) {
538
+ switch (e) {
539
+ case "outcome": return he(t.outcome);
540
+ case "mutationSource": return me(t.mutationSource);
541
+ case "employeeName": return t.operatorIdentity?.employeeName ?? "—";
542
+ case "username": return t.operatorIdentity?.username ?? t.operatorId ?? "—";
543
+ case "loginAccount": return ve(t) ?? "—";
544
+ case "organizationName": return t.operatorIdentity?.organizationName ?? "—";
545
+ case "departmentName": return t.operatorIdentity?.departmentName ?? "—";
546
+ case "errorCode": return $(t.details?.errorCode) ?? "—";
547
+ case "httpStatus": return $(t.details?.httpStatus) ?? "—";
548
+ default: return Se(t[e]);
549
+ }
550
+ }
551
+ function me(e) {
552
+ return {
553
+ BUSINESS: "业务写入",
554
+ ACTION: "业务动作",
555
+ SYSTEM: "系统处理",
556
+ WRITE_BACK: "平台回写"
557
+ }[e ?? ""] ?? e ?? "—";
558
+ }
559
+ function he(e) {
560
+ return {
561
+ SUCCESS: "成功",
562
+ FAILURE: "失败",
563
+ REJECTED: "拒绝"
564
+ }[e ?? ""] ?? e ?? "—";
565
+ }
566
+ function ge(e) {
567
+ return [
568
+ ["发生时间", e.occurredAt],
569
+ ["事件类型", e.eventType],
570
+ ["结果", e.outcome],
571
+ ["职员姓名", e.operatorIdentity?.employeeName],
572
+ ["操作用户", e.operatorIdentity?.username ?? e.operatorId],
573
+ ["登录账号", ve(e)],
574
+ ["用户 ID", e.operatorId],
575
+ ["机构", e.operatorIdentity?.organizationName],
576
+ ["机构 ID", e.operatorIdentity?.organizationId ?? e.operatorOrganizationId],
577
+ ["部门", e.operatorIdentity?.departmentName],
578
+ ["部门 ID", e.operatorIdentity?.departmentId],
579
+ ["业务模块", e.moduleAlias],
580
+ ["动作", e.actionCode],
581
+ ["实体", e.entityAlias],
582
+ ["记录 ID", e.recordId],
583
+ ["变更来源", me(e.mutationSource)],
584
+ ["追踪 ID", e.traceId],
585
+ ...xe(e.details, [
586
+ "outcome",
587
+ "entityAlias",
588
+ "recordId",
589
+ "mutationSource"
590
+ ]).map((e) => [e.key, e.value])
591
+ ].filter(([, e]) => e != null && e !== "").map(([e, t]) => ({
592
+ key: e,
593
+ value: Se(t)
594
+ }));
595
+ }
596
+ function _e(e, t) {
597
+ return (t?.items ?? []).map((t) => ({
598
+ key: `${e}:${t.key}`,
599
+ kind: e,
600
+ title: t.title,
601
+ count: t.count
602
+ }));
603
+ }
604
+ function ve(e) {
605
+ if (e.eventType === "LOGIN") return e.loginAccount ?? $(e.details?.confirmedAccount) ?? $(e.details?.claimedAccount);
606
+ }
607
+ function ye() {
608
+ return [{
609
+ key: "detail",
610
+ title: "详情",
611
+ primary: !0,
612
+ iconName: "eye"
613
+ }];
614
+ }
615
+ function be(e, t) {
616
+ e.key === "detail" && X(t);
617
+ }
618
+ function xe(e, t = []) {
619
+ let n = new Set(t);
620
+ return Object.entries(e ?? {}).filter(([e]) => !n.has(e)).map(([e, t]) => ({
621
+ key: e,
622
+ value: Se(t)
623
+ }));
624
+ }
625
+ function $(e) {
626
+ return typeof e == "string" || typeof e == "number" ? String(e) : void 0;
627
+ }
628
+ function Se(e) {
629
+ return e == null || e === "" ? "—" : typeof e == "string" ? e : JSON.stringify(e, null, 2);
630
+ }
631
+ function Ce(e) {
632
+ return e instanceof Error ? e.message : "请求未完成,请稍后重试。";
633
+ }
634
+ let we = {
635
+ login: { columns: [
636
+ {
637
+ key: "outcome",
638
+ title: "结果",
639
+ width: "96px"
640
+ },
641
+ {
642
+ key: "occurredAt",
643
+ title: "发生时间",
644
+ width: "176px"
645
+ },
646
+ {
647
+ key: "loginAccount",
648
+ title: "登录账号",
649
+ width: "200px"
650
+ }
651
+ ] },
652
+ activity: { columns: [
653
+ {
654
+ key: "outcome",
655
+ title: "结果",
656
+ width: "96px"
657
+ },
658
+ {
659
+ key: "occurredAt",
660
+ title: "发生时间",
661
+ width: "176px"
662
+ },
663
+ {
664
+ key: "username",
665
+ title: "操作用户",
666
+ width: "160px"
667
+ },
668
+ {
669
+ key: "moduleAlias",
670
+ title: "业务模块",
671
+ width: "190px"
672
+ },
673
+ {
674
+ key: "actionCode",
675
+ title: "动作",
676
+ width: "150px"
677
+ },
678
+ {
679
+ key: "recordId",
680
+ title: "记录 ID",
681
+ width: "170px"
682
+ },
683
+ {
684
+ key: "mutationSource",
685
+ title: "变更来源",
686
+ width: "120px"
687
+ }
688
+ ] },
689
+ "request-error": { columns: [
690
+ {
691
+ key: "occurredAt",
692
+ title: "发生时间",
693
+ width: "176px"
694
+ },
695
+ {
696
+ key: "moduleAlias",
697
+ title: "业务模块",
698
+ width: "190px"
699
+ },
700
+ {
701
+ key: "errorCode",
702
+ title: "错误码",
703
+ width: "150px"
704
+ },
705
+ {
706
+ key: "httpStatus",
707
+ title: "HTTP 状态",
708
+ width: "112px"
709
+ },
710
+ {
711
+ key: "summary",
712
+ title: "错误摘要",
713
+ width: "260px"
714
+ }
715
+ ] }
716
+ };
717
+ return (n, a) => (D(), x(_, null, [
718
+ w(j(t), {
719
+ class: "business-log-list",
720
+ context: j(c),
721
+ title: e.title,
722
+ columns: J.value,
723
+ "row-key": "eventId",
724
+ "show-recycle-bin": !1,
725
+ "page-size": 50,
726
+ "page-size-options": [
727
+ 20,
728
+ 50,
729
+ 100
730
+ ],
731
+ "reference-picker-of": fe,
732
+ "empty-description": "暂无符合条件的日志",
733
+ "row-actions-of": ye,
734
+ "row-actions-title": "操作",
735
+ "action-column-width": "88px",
736
+ onRecordActivate: X,
737
+ onRowAction: be,
738
+ onQueried: oe
739
+ }, {
740
+ operations: M(() => [W.value ? (D(), y(j(d), {
741
+ key: 0,
742
+ loading: V.value,
743
+ onClick: ie
744
+ }, {
745
+ default: M(() => [...a[2] ||= [C(" 使用统计 ", -1)]]),
746
+ _: 1
747
+ }, 8, ["loading"])) : b("v-if", !0), w(se, { "event-types": K.value }, null, 8, ["event-types"])]),
748
+ cell: M(({ column: e, record: t }) => [e.key === "occurredAt" ? (D(), y(j(i), {
749
+ key: 0,
750
+ value: t.occurredAt
751
+ }, null, 8, ["value"])) : (D(), x("span", {
752
+ key: 1,
753
+ class: E({ "business-log-list__summary": e.key === "summary" })
754
+ }, A(pe(e.key, t)), 3))]),
755
+ _: 1
756
+ }, 8, [
757
+ "context",
758
+ "title",
759
+ "columns"
760
+ ]),
761
+ w(j(p), {
762
+ open: !!g.value,
763
+ title: `${e.title}详情`,
764
+ "render-mode": "inline",
765
+ subtitle: g.value ? g.value.operatorIdentity?.employeeName ?? g.value.operatorIdentity?.username ?? g.value.operatorId : void 0,
766
+ "close-on-outside": !0,
767
+ onClose: a[0] ||= (e) => g.value = void 0
768
+ }, {
769
+ default: M(() => [T.value ? (D(), y(j(l), {
770
+ key: 0,
771
+ tip: "加载详情"
772
+ })) : N.value ? (D(), y(j(s), {
773
+ key: 1,
774
+ title: "日志详情加载失败",
775
+ message: N.value
776
+ }, null, 8, ["message"])) : g.value ? (D(), x("dl", Z, [(D(!0), x(_, null, k(te.value, (e) => (D(), x(_, { key: e.key }, [S("dt", null, A(e.key), 1), S("dd", null, [S("pre", null, A(e.value), 1)])], 64))), 128))])) : (D(), y(j(r), {
777
+ key: 3,
778
+ description: "未选择日志"
779
+ })), G.value && g.value && q.value ? (D(), x("section", Q, [
780
+ w(j(d), {
781
+ loading: I.value,
782
+ onClick: ae
783
+ }, {
784
+ default: M(() => [...a[3] ||= [C("查看内部诊断", -1)]]),
785
+ _: 1
786
+ }, 8, ["loading"]),
787
+ a[4] ||= S("small", null, "仅具备平台范围的管理员可查看。", -1),
788
+ L.value ? (D(), y(j(s), {
789
+ key: 0,
790
+ title: "内部诊断不可用",
791
+ message: L.value
792
+ }, null, 8, ["message"])) : F.value ? (D(), x("dl", ce, [(D(!0), x(_, null, k(ne.value, (e) => (D(), x(_, { key: e.key }, [S("dt", null, A(e.key), 1), S("dd", null, [S("pre", null, A(e.value), 1)])], 64))), 128))])) : b("v-if", !0)
793
+ ])) : b("v-if", !0)]),
794
+ _: 1
795
+ }, 8, [
796
+ "open",
797
+ "title",
798
+ "subtitle"
799
+ ]),
800
+ w(j(p), {
801
+ open: R.value,
802
+ title: "业务活动使用统计",
803
+ "render-mode": "inline",
804
+ subtitle: "统计口径遵循当前标准查询条件与登录账号的数据范围。",
805
+ "close-on-outside": !0,
806
+ onClose: a[1] ||= (e) => R.value = !1
807
+ }, {
808
+ default: M(() => [V.value ? (D(), y(j(l), {
809
+ key: 0,
810
+ tip: "加载使用统计"
811
+ })) : H.value ? (D(), y(j(s), {
812
+ key: 1,
813
+ title: "使用统计加载失败",
814
+ message: H.value
815
+ }, null, 8, ["message"])) : (D(), x(_, { key: 2 }, [re.value ? (D(), x("p", le, "当前统计只覆盖可读取的最近日志。")) : b("v-if", !0), Y.value.length > 0 ? (D(), x("dl", ue, [(D(!0), x(_, null, k(Y.value, (e) => (D(), x(_, { key: e.key }, [S("dt", null, A(e.kind) + " · " + A(e.title), 1), S("dd", null, A(e.count), 1)], 64))), 128))])) : (D(), y(j(r), {
816
+ key: 2,
817
+ description: "暂无可统计的业务活动"
818
+ }))], 64))]),
819
+ _: 1
820
+ }, 8, ["open"])
821
+ ], 64));
822
+ }
823
+ }), [["__scopeId", "data-v-dbe6e7b1"]]);
824
+ //#endregion
825
+ export { de as t };