@ximatai/muyun-web-app 0.26.29 → 0.26.32

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