@ximatai/muyun-web-app 0.26.25 → 0.26.27

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