@ximatai/muyun-web-app 0.26.27 → 0.26.29

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 (71) hide show
  1. package/dist/{BusinessActivityLogView-Bbe-GbNG.js → BusinessActivityLogView-fzxP3P68.js} +2 -2
  2. package/dist/BusinessLogListDrawer-C7wb2R6q.js +868 -0
  3. package/dist/CodeConfigurationView-DXrXp7kg.js +2333 -0
  4. package/dist/{ConfigurationTranslationView-B3Cr9Wes.js → ConfigurationTranslationView-CNWJhB8C.js} +49 -49
  5. package/dist/{LoginAuditLogView-DOwkqtVB.js → LoginAuditLogView-D2q4WT8W.js} +2 -2
  6. package/dist/{ModuleActionManagementView-DNXAhdXk.js → ModuleActionManagementView-Xd8uB3iR.js} +191 -191
  7. package/dist/{ModuleGovernanceView-g5W2R_Zl.js → ModuleGovernanceView-BFCfy5wB.js} +3403 -3421
  8. package/dist/{RequestErrorLogView-9GIz2mkQ.js → RequestErrorLogView-C-dZhHvD.js} +2 -2
  9. package/dist/RoleDetailWorkspaceView-BmtEBE0r.js +1435 -0
  10. package/dist/{RuntimeLogView-C5i19Z-u.js → RuntimeLogView-BuFuboQh.js} +51 -51
  11. package/dist/{WorkflowAdministrationView-CnoTudpI.js → WorkflowAdministrationView-Cb6RnlGU.js} +57 -57
  12. package/dist/WorkflowConfigurationView-VLObweIg.js +2227 -0
  13. package/dist/{WorkflowWorkbenchView-DbWqspEB.js → WorkflowWorkbenchView-CbZervUv.js} +248 -248
  14. package/dist/{codeConfiguration-Bno8cWxB.js → codeConfiguration-DbUEhnW7.js} +66 -49
  15. package/dist/configurationEditorNavigation-DZeBbg3z.js +15 -0
  16. package/dist/formulaReferences-CKkkdA_R.js +23 -0
  17. package/dist/index.css +1 -1
  18. package/dist/index.js +727 -727
  19. package/dist/{moduleMenuWorkspace-DW13bHG5.js → moduleMenuWorkspace-COanAuqc.js} +237 -248
  20. package/dist/{platform-components-D3NvMY3T.js → platform-components-5joS6YaR.js} +4677 -4489
  21. package/dist/{platform-workbench-C4OFiuG5.js → platform-workbench-le7pFe4d.js} +5457 -5296
  22. package/dist/types/consumer/index.d.ts +2 -1
  23. package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +32 -26
  24. package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +60 -29
  25. package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +2 -0
  26. package/dist/types/dynamic-page-runtime/ModuleReferenceRecordDetailBrowser.vue.d.ts +13 -4
  27. package/dist/types/dynamic-page-runtime/index.d.ts +2 -2
  28. package/dist/types/dynamic-page-runtime/modulePageActionControls.d.ts +12 -0
  29. package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +18 -5
  30. package/dist/types/dynamic-page-runtime/recordFormAssistantCapabilities.d.ts +3 -1
  31. package/dist/types/dynamic-page-runtime/recordFormDraftAccess.d.ts +2 -0
  32. package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +16 -13
  33. package/dist/types/dynamic-page-runtime/useModuleRecordDataChanges.d.ts +4 -1
  34. package/dist/types/platform-components/ActionControlHost.vue.d.ts +16 -0
  35. package/dist/types/platform-components/AdaptiveHeaderActionBar.vue.d.ts +3 -0
  36. package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +2 -0
  37. package/dist/types/platform-components/ReferenceRecordDetailBrowser.vue.d.ts +10 -0
  38. package/dist/types/platform-components/actionControl.d.ts +28 -0
  39. package/dist/types/platform-components/adaptiveHeaderActionLayout.d.ts +4 -2
  40. package/dist/types/platform-components/index.d.ts +3 -2
  41. package/dist/types/platform-components/optionFieldOptionCache.d.ts +11 -1
  42. package/dist/types/platform-components/recordActionBarModel.d.ts +5 -0
  43. package/dist/types/platform-components/recordFormFieldModel.d.ts +1 -0
  44. package/dist/types/platform-components/referenceRecordDetailBrowser.d.ts +13 -1
  45. package/dist/types/platform-components/useWorkflowDesignSession.d.ts +141 -0
  46. package/dist/types/platform-components/workflowDesignEditing.d.ts +8 -7
  47. package/dist/types/platform-components/workflowDesignOperations.d.ts +107 -0
  48. package/dist/types/views/CodeRuleRecoveryPanel.vue.d.ts +20 -0
  49. package/dist/types/views/businessRuleGovernance.d.ts +1 -2
  50. package/dist/types/views/codeConfiguration.d.ts +29 -1
  51. package/dist/types/views/codeConfigurationAssistantSurface.d.ts +17 -0
  52. package/dist/types/views/codeRuleSaveRecovery.d.ts +12 -0
  53. package/dist/types/views/useCodeConfigurationAssistant.d.ts +10 -0
  54. package/dist/types/views/useCodeConfigurationSession.d.ts +16 -0
  55. package/dist/types/views/useWorkflowConfigurationAssistant.d.ts +16 -0
  56. package/dist/types/views/useWorkflowConfigurationContext.d.ts +16 -2
  57. package/dist/types/views/useWorkflowConfigurationSession.d.ts +146 -0
  58. package/dist/types/views/workflowConfigurationAssistantSurface.d.ts +169 -0
  59. package/dist/types/views/workflowSaveRecovery.d.ts +11 -0
  60. package/dist/types/vue-ui-antdv/components/sidePanelHost.d.ts +3 -1
  61. package/dist/types/vue-ui-antdv/index.d.ts +1 -0
  62. package/dist/types/web-core/formulaReferences.d.ts +2 -0
  63. package/dist/types/web-core/workflow.d.ts +11 -1
  64. package/dist/useWorkflowConfigurationContext-B9GigSF8.js +78 -0
  65. package/dist/{workspaceViews-D2Uh4KAq.js → workspaceViews-8-LaaGxD.js} +680 -680
  66. package/package.json +1 -1
  67. package/dist/BusinessLogListDrawer-BmF-14We.js +0 -868
  68. package/dist/CodeConfigurationView-DdPfBjoC.js +0 -1667
  69. package/dist/RoleDetailWorkspaceView-BuqRT0pd.js +0 -1435
  70. package/dist/WorkflowConfigurationView-Cku-F1Fm.js +0 -980
  71. package/dist/useWorkflowConfigurationContext-eQKyqe6_.js +0 -66
@@ -1,868 +0,0 @@
1
- import { $a as e, $r as t, A as n, Dn as r, In as i, Jn as a, Ln as o, Mn as s, Nn as c, Pa as ee, Pn as l, Un as te, Wt as ne, Y as u, ba as re, bn as d, hr as f, j as p, ja as ie, lr as ae, no as m, ro as oe, va as h, vr as g, ya as se } from "./platform-components-D3NvMY3T.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, shallowRef as A, toDisplayString as j, unref as M, withCtx as N } from "vue";
3
- //#region src/views/businessLogClient.ts
4
- var P = {
5
- activity: "/platform.business_activity_log",
6
- "request-error": "/platform.request_error_log",
7
- login: "/iam.login_audit_log"
8
- };
9
- function F(e, t) {
10
- let n = P[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(t) {
133
- let n = K(t);
134
- return Array.isArray(n.pages) ? {
135
- items: n.pages.map((t) => {
136
- let n = K(t);
137
- return {
138
- key: q(n.pageKey) ?? "unknown-page",
139
- title: q(n.pageKey) ?? "未知页面",
140
- ...q(n.pageKey) ? {} : { titleSource: e("platform.log.statistic.unknown-page") },
141
- count: J(n.accessCount)
142
- };
143
- }),
144
- complete: Y(n.complete)
145
- } : {
146
- items: [
147
- ["executionCount", "执行次数"],
148
- ["successCount", "成功次数"],
149
- ["failureCount", "失败次数"],
150
- ["rejectedCount", "拒绝次数"],
151
- ["knownDurationCount", "含耗时记录数"],
152
- ["totalDurationMillis", "累计耗时(毫秒)"],
153
- ["knownAffectedRecordCount", "含影响数记录数"],
154
- ["totalAffectedRecordCount", "累计影响记录数"]
155
- ].map(([t, r]) => ({
156
- key: t,
157
- title: r,
158
- titleSource: e(`platform.log.statistic.${t}`),
159
- count: J(n[t])
160
- })),
161
- complete: Y(n.complete)
162
- };
163
- }
164
- function ce(e, t) {
165
- let n = e.titleSource;
166
- return n?.sourceKind === "CODE" && n.sourceId.startsWith("platform.log.statistic.") && m(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" }, X = { 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__*/ g(/* @__PURE__ */ T({
239
- name: "BusinessLogRetentionControl",
240
- __name: "BusinessLogRetentionControl",
241
- props: { eventTypes: {} },
242
- setup(e) {
243
- let n = oe(), r = e, u = t({
244
- moduleAlias: "platform.business_log_retention",
245
- runtimeAccess: "VIEW"
246
- }), p = ue(u.http), m = O(!1), g = O([]), T = O({}), E = O(!1), P = A(), F = v(() => P.value ? ve(P.value) : void 0), I = O(), L = O(), R = v(() => u.can("viewRetentionPolicies") === !0), z = v(() => u.can("configureRetentionPolicy") === !0), B = v(() => u.can("purgeExpiredLogs") === !0), V = v(() => I.value !== void 0 || L.value !== void 0), H = v(() => {
247
- let e = new Set(r.eventTypes);
248
- return g.value.filter((t) => e.has(t.eventType));
249
- }), ce = v(() => H.value.some(J));
250
- async function U() {
251
- R.value && (m.value = !0, await W());
252
- }
253
- async function W() {
254
- E.value = !0, P.value = void 0;
255
- try {
256
- let e = await p.policies(), t = new Set(r.eventTypes), n = e.filter((e) => t.has(e.eventType));
257
- g.value = n.map((e) => ({ ...e })), T.value = Object.fromEntries(n.map((e) => [e.eventType, { ...e }]));
258
- } catch (e) {
259
- P.value = _e(e), d(e, {
260
- language: n,
261
- source: "business-log-retention",
262
- phase: "load"
263
- });
264
- } finally {
265
- E.value = !1;
266
- }
267
- }
268
- async function G() {
269
- return V.value ? (s(n.t("platform.screen.BusinessLogRetentionControl.a-cleanup-operation-is-in-progress-please-wait", "自动清理操作正在执行,请稍候。")), !1) : !ce.value || l({
270
- title: n.t("platform.screen.BusinessLogRetentionControl.discard-unsaved-cleanup-settings", "放弃未保存的自动清理设置?"),
271
- content: n.t("platform.screen.BusinessLogRetentionControl.unsaved-changes-to-automatic-cleanup-and-retention-days-will-be", "关闭后,本次未保存的自动清理和保留天数修改将丢失。")
272
- }, n);
273
- }
274
- async function K(e) {
275
- if (Z(e.retentionDays) && J(e) && !V.value) {
276
- I.value = e.eventType;
277
- try {
278
- q(await p.update(e)), c(n.t("platform.screen.BusinessLogRetentionControl.cleanup-settings-saved-for-value", "{value1}自动清理设置已保存", { value1: Q(e.eventType) }));
279
- } catch (e) {
280
- d(e, {
281
- language: n,
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 (Z(e.retentionDays) && !V.value && await l({
292
- title: n.t("platform.screen.BusinessLogRetentionControl.clean-up-value-now", "立即清理{value1}", { value1: Q(e.eventType) }),
293
- content: n.t("platform.screen.BusinessLogRetentionControl.logs-strictly-older-than-value-days-will-be-deleted-this", "将删除严格早于 {value1} 天的日志。本次清理不会保存对保留天数的修改,且操作不可恢复。", { value1: e.retentionDays }),
294
- requiredText: n.t("platform.screen.BusinessLogRetentionControl.clean-up-value", "清理{value1}", { value1: Q(e.eventType) }),
295
- danger: !0
296
- }, n)) {
297
- L.value = e.eventType;
298
- try {
299
- let t = await p.purge(e.eventType, e.retentionDays);
300
- if (t.result.status === "ALREADY_RUNNING") {
301
- s(n.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" ? n.t("platform.screen.BusinessLogRetentionControl.deleted-value-records-in-this-run-remaining-records-will-be", "本轮已清理 {value1} 条,剩余数据将在后续批次继续处理", { value1: t.result.deletedCount }) : n.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
- d(e, {
310
- language: n,
311
- source: "business-log-retention",
312
- phase: "action"
313
- });
314
- } finally {
315
- L.value = void 0;
316
- }
317
- }
318
- }
319
- function q(e) {
320
- T.value = {
321
- ...T.value,
322
- [e.eventType]: { ...e }
323
- }, g.value = g.value.map((t) => t.eventType === e.eventType ? { ...e } : t);
324
- }
325
- function J(e) {
326
- let t = T.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 Z(e) {
333
- return Number.isInteger(e) && e >= 1 && e <= 36500;
334
- }
335
- function Q(e) {
336
- return {
337
- LOGIN: n.t("platform.screen.BusinessLogRetentionControl.login-audit-logs", "登录日志"),
338
- ACTION: n.t("platform.screen.BusinessLogRetentionControl.action-logs", "动作日志"),
339
- REQUEST_ERROR: n.t("platform.screen.BusinessLogRetentionControl.error-logs", "异常日志"),
340
- PAGE_ACCESS: n.t("platform.screen.BusinessLogRetentionControl.page-access-logs", "页面访问日志")
341
- }[e];
342
- }
343
- function _e(e) {
344
- return e instanceof Error ? e : new h(se(n, "platform.screen.BusinessLogRetentionControl.failed-to-load-automatic-cleanup-settings", "自动清理设置加载失败。"));
345
- }
346
- function ve(e) {
347
- return e instanceof h ? re(e, n) : ee(ie(e), n);
348
- }
349
- return (e, t) => (D(), x(_, null, [R.value ? (D(), y(M(f), {
350
- key: 0,
351
- onClick: U
352
- }, {
353
- default: N(() => [C(j(M(n).t("platform.screen.BusinessLogRetentionControl.automatic-cleanup", "自动清理")), 1)]),
354
- _: 1
355
- })) : b("v-if", !0), w(M(ne), {
356
- open: m.value,
357
- title: M(n).t("platform.screen.BusinessLogRetentionControl.automatic-cleanup", "自动清理"),
358
- subtitle: M(n).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) => m.value = !1
363
- }, {
364
- default: N(() => [E.value ? (D(), y(M(o), {
365
- key: 0,
366
- tip: M(n).t("platform.screen.BusinessLogRetentionControl.loading-automatic-cleanup-settings", "加载自动清理设置")
367
- }, null, 8, ["tip"])) : F.value ? (D(), y(M(i), {
368
- key: 1,
369
- title: M(n).t("platform.screen.BusinessLogRetentionControl.automatic-cleanup-settings-unavailable", "自动清理设置不可用"),
370
- message: F.value
371
- }, null, 8, ["title", "message"])) : H.value.length === 0 ? (D(), y(M(te), {
372
- key: 2,
373
- description: M(n).t("platform.screen.BusinessLogRetentionControl.no-automatic-cleanup-settings-available", "暂无可管理的自动清理设置")
374
- }, null, 8, ["description"])) : (D(), x("section", de, [(D(!0), x(_, null, k(H.value, (e) => (D(), x("article", { key: e.eventType }, [
375
- S("header", null, [S("div", null, [S("h3", null, j(Q(e.eventType)), 1), e.updatedAt ? (D(), x("small", fe, [C(j(M(n).t("platform.screen.BusinessLogRetentionControl.last-updated", "最近更新:")) + j(e.updatedAt), 1), e.updatedBy ? (D(), x(_, { key: 0 }, [C(" · " + j(e.updatedBy), 1)], 64)) : b("v-if", !0)])) : b("v-if", !0)]), S("label", pe, [S("span", null, j(M(n).t("platform.screen.BusinessLogRetentionControl.automatic-cleanup", "自动清理")), 1), w(M(a), {
376
- checked: e.automaticCleanupEnabled,
377
- "onUpdate:checked": (t) => e.automaticCleanupEnabled = t,
378
- disabled: !z.value || V.value,
379
- "checked-text": M(n).t("platform.screen.WorkflowWorkbenchView.enabled", "启用"),
380
- "unchecked-text": M(n).t("platform.screen.WorkflowWorkbenchView.disabled", "停用")
381
- }, null, 8, [
382
- "checked",
383
- "onUpdate:checked",
384
- "disabled",
385
- "checked-text",
386
- "unchecked-text"
387
- ])])]),
388
- S("div", X, [S("label", me, [
389
- S("span", null, j(M(n).t("platform.screen.BusinessLogRetentionControl.retention-days", "保留天数")), 1),
390
- S("span", he, [w(M(ae), {
391
- value: e.retentionDays,
392
- type: "number",
393
- disabled: !z.value || V.value,
394
- "aria-label": M(n).t("platform.screen.BusinessLogRetentionControl.retention-days-for-value", "{value1}保留天数", { value1: Q(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 ? (D(), y(M(f), {
402
- key: 0,
403
- intent: "danger",
404
- disabled: V.value || !Z(e.retentionDays),
405
- loading: L.value === e.eventType,
406
- onClick: (t) => le(e)
407
- }, {
408
- default: N(() => [C(j(M(n).t("platform.screen.BusinessLogRetentionControl.clean-up-now", "立即清理")), 1)]),
409
- _: 1
410
- }, 8, [
411
- "disabled",
412
- "loading",
413
- "onClick"
414
- ])) : b("v-if", !0)]),
415
- Z(e.retentionDays) ? b("v-if", !0) : (D(), x("small", ge, j(M(n).t("platform.screen.BusinessLogRetentionControl.enter-an-integer-from-1-to-36500", "请输入 1 至 36500 之间的整数。")), 1))
416
- ])]),
417
- S("footer", null, [z.value ? (D(), y(M(f), {
418
- key: 0,
419
- emphasis: "primary",
420
- disabled: V.value || !Z(e.retentionDays) || !J(e),
421
- loading: I.value === e.eventType,
422
- onClick: (t) => K(e)
423
- }, {
424
- default: N(() => [C(j(M(n).t("platform.action.save", "保存")), 1)]),
425
- _: 1
426
- }, 8, [
427
- "disabled",
428
- "loading",
429
- "onClick"
430
- ])) : b("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__*/ g(/* @__PURE__ */ T({
455
- name: "BusinessLogListDrawer",
456
- __name: "BusinessLogListDrawer",
457
- props: {
458
- surface: {},
459
- moduleAlias: {},
460
- title: {}
461
- },
462
- setup(e) {
463
- let a = oe(), s = e, c = t({ moduleAlias: s.moduleAlias }), l = F(c.http, s.surface), ae = {
464
- get title() {
465
- return a.t("platform.screen.BusinessLogListDrawer.select-an-operator", "选择操作用户");
466
- },
467
- get placeholder() {
468
- return a.t("platform.screen.UserPicker.searchPlaceholder", "按账号或用户 ID 搜索");
469
- },
470
- get searchPlaceholder() {
471
- return a.t("platform.screen.UserPicker.searchPlaceholder", "按账号或用户 ID 搜索");
472
- },
473
- mode: "dialog",
474
- columns: p,
475
- provider: n({
476
- sourceIdentity: {
477
- targetModuleAlias: "iam.user",
478
- source: {
479
- kind: "businessPurpose",
480
- id: `${s.moduleAlias}:operators`
481
- }
482
- },
483
- searchPage: async ({ keyword: e, pageNum: t, pageSize: n, scope: r }) => {
484
- let i = await l.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 l.operatorCandidates({ selectedIds: e })).selectedRecords
497
- })
498
- }, m = O(), g = O(!1), T = A(), P = v(() => T.value ? Le(T.value) : void 0), I = O(), L = O(!1), R = A(), z = v(() => R.value ? Le(R.value) : void 0), B = O(!1), V = O(), H = O(), U = O(!1), W = A(), G = v(() => W.value ? Le(W.value) : void 0), K = O(), le = v(() => Ie.value[s.surface]), q = v(() => s.surface === "activity"), J = v(() => s.surface === "request-error"), Y = v(() => ({
499
- login: ["LOGIN"],
500
- activity: ["ACTION", "PAGE_ACCESS"],
501
- "request-error": ["REQUEST_ERROR"]
502
- })[s.surface]), ue = v(() => c.can("viewInternalDiagnostic") === !0), de = v(() => le.value.columns), fe = v(() => m.value ? Oe(m.value) : []), pe = v(() => Ne(I.value)), X = v(() => [...ke(a.t("platform.workflow-task-editor.business-action", "业务动作"), V.value), ...ke(a.t("platform.screen.BusinessLogListDrawer.page-access", "页面访问"), H.value)]), me = v(() => V.value?.complete === !1 || H.value?.complete === !1);
503
- async function he(e) {
504
- let t = e, n = t.eventId;
505
- if (n) {
506
- m.value = t, T.value = void 0, I.value = void 0, R.value = void 0, g.value = !0;
507
- try {
508
- m.value = await l.detail(n);
509
- } catch (e) {
510
- T.value = Fe(e), d(e, {
511
- language: a,
512
- source: "business-log-detail",
513
- phase: "load"
514
- });
515
- } finally {
516
- g.value = !1;
517
- }
518
- }
519
- }
520
- async function ge() {
521
- if (q.value && !U.value) {
522
- B.value = !0, U.value = !0, W.value = void 0;
523
- try {
524
- let e = K.value ?? Ce(), [t, n] = await Promise.all([l.actionStatistics?.(e), l.pageAccessStatistics?.(e)]);
525
- V.value = t, H.value = n;
526
- } catch (e) {
527
- W.value = Fe(e), d(e, {
528
- language: a,
529
- source: "business-log-statistics",
530
- phase: "load"
531
- });
532
- } finally {
533
- U.value = !1;
534
- }
535
- }
536
- }
537
- async function xe() {
538
- let e = m.value?.eventId;
539
- if (l.diagnostic && e && !L.value) {
540
- L.value = !0, R.value = void 0;
541
- try {
542
- I.value = await l.diagnostic(e);
543
- } catch (e) {
544
- R.value = Fe(e), d(e, {
545
- language: a,
546
- source: "business-log-diagnostic",
547
- phase: "load"
548
- });
549
- } finally {
550
- L.value = !1;
551
- }
552
- }
553
- }
554
- function Se(e) {
555
- K.value = e, V.value = void 0, H.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" ? ae : 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: a.t("platform.screen.BusinessLogListDrawer.business-data-write", "业务写入"),
586
- ACTION: a.t("platform.workflow-task-editor.business-action", "业务动作"),
587
- SYSTEM: a.t("platform.screen.BusinessLogListDrawer.system-processing", "系统处理"),
588
- WRITE_BACK: a.t("platform.screen.BusinessLogListDrawer.platform-write-back", "平台回写")
589
- }[e ?? ""] ?? e ?? "—";
590
- }
591
- function De(e) {
592
- return {
593
- SUCCESS: a.t("platform.screen.BusinessLogListDrawer.success", "成功"),
594
- FAILURE: a.t("platform.screen.BusinessLogListDrawer.failure", "失败"),
595
- REJECTED: a.t("platform.screen.BusinessLogListDrawer.rejected", "拒绝")
596
- }[e ?? ""] ?? e ?? "—";
597
- }
598
- function Oe(e) {
599
- return [
600
- [a.t("platform.screen.BusinessLogListDrawer.occurred-at", "发生时间"), e.occurredAt],
601
- [a.t("platform.screen.BusinessLogListDrawer.event-type", "事件类型"), e.eventType],
602
- [a.t("platform.screen.BusinessLogListDrawer.outcome", "结果"), e.outcome],
603
- [a.t("platform.user-picker.column.employee-name", "职员姓名"), e.operatorIdentity?.employeeName],
604
- [a.t("platform.screen.BusinessLogListDrawer.operator", "操作用户"), e.operatorIdentity?.username ?? e.operatorId],
605
- [a.t("platform.screen.CurrentUserProfileDialog.sign-in-account", "登录账号"), Ae(e)],
606
- [a.t("platform.screen.BusinessLogListDrawer.user-id", "用户 ID"), e.operatorId],
607
- [a.t("platform.user-picker.axis.organization", "机构"), e.operatorIdentity?.organizationName],
608
- [a.t("platform.screen.BusinessLogListDrawer.organization-id", "机构 ID"), e.operatorIdentity?.organizationId ?? e.operatorOrganizationId],
609
- [a.t("platform.user-picker.axis.department", "部门"), e.operatorIdentity?.departmentName],
610
- [a.t("platform.screen.BusinessLogListDrawer.department-id", "部门 ID"), e.operatorIdentity?.departmentId],
611
- [a.t("platform.screen.WorkflowWorkbenchView.business-module", "业务模块"), e.moduleAlias],
612
- [a.t("platform.governance.tab.actions", "动作"), e.actionCode],
613
- [a.t("platform.screen.BusinessLogListDrawer.entity", "实体"), e.entityAlias],
614
- [a.t("platform.screen.BusinessLogListDrawer.record-id", "记录 ID"), e.recordId],
615
- [a.t("platform.screen.BusinessLogListDrawer.change-source", "变更来源"), Ee(e.mutationSource)],
616
- [a.t("platform.access-tokens.auth-method", "认证方式"), e.authenticationMethod],
617
- [a.t("platform.access-tokens.credential-id", "凭据 ID"), e.authenticationCredentialId],
618
- [a.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: ce(t, a),
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: a.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 h(se(a, "platform.screen.BusinessLogListDrawer.the-request-did-not-complete-try-again-later", "请求未完成,请稍后重试。"));
667
- }
668
- let Ie = v(() => ({
669
- login: { columns: [
670
- {
671
- key: "outcome",
672
- title: a.t("platform.screen.BusinessLogListDrawer.outcome", "结果"),
673
- width: "96px"
674
- },
675
- {
676
- key: "occurredAt",
677
- title: a.t("platform.screen.BusinessLogListDrawer.occurred-at", "发生时间"),
678
- width: "176px"
679
- },
680
- {
681
- key: "loginAccount",
682
- title: a.t("platform.screen.CurrentUserProfileDialog.sign-in-account", "登录账号"),
683
- width: "200px"
684
- }
685
- ] },
686
- activity: { columns: [
687
- {
688
- key: "outcome",
689
- title: a.t("platform.screen.BusinessLogListDrawer.outcome", "结果"),
690
- width: "96px"
691
- },
692
- {
693
- key: "occurredAt",
694
- title: a.t("platform.screen.BusinessLogListDrawer.occurred-at", "发生时间"),
695
- width: "176px"
696
- },
697
- {
698
- key: "username",
699
- title: a.t("platform.screen.BusinessLogListDrawer.operator", "操作用户"),
700
- width: "160px"
701
- },
702
- {
703
- key: "moduleAlias",
704
- title: a.t("platform.screen.WorkflowWorkbenchView.business-module", "业务模块"),
705
- width: "190px"
706
- },
707
- {
708
- key: "actionCode",
709
- title: a.t("platform.governance.tab.actions", "动作"),
710
- width: "150px"
711
- },
712
- {
713
- key: "recordId",
714
- title: a.t("platform.screen.BusinessLogListDrawer.record-id", "记录 ID"),
715
- width: "170px"
716
- },
717
- {
718
- key: "mutationSource",
719
- title: a.t("platform.screen.BusinessLogListDrawer.change-source", "变更来源"),
720
- width: "120px"
721
- }
722
- ] },
723
- "request-error": { columns: [
724
- {
725
- key: "occurredAt",
726
- title: a.t("platform.screen.BusinessLogListDrawer.occurred-at", "发生时间"),
727
- width: "176px"
728
- },
729
- {
730
- key: "moduleAlias",
731
- title: a.t("platform.screen.WorkflowWorkbenchView.business-module", "业务模块"),
732
- width: "190px"
733
- },
734
- {
735
- key: "errorCode",
736
- title: a.t("platform.screen.BusinessLogListDrawer.error-code", "错误码"),
737
- width: "150px"
738
- },
739
- {
740
- key: "httpStatus",
741
- title: a.t("platform.screen.BusinessLogListDrawer.http-status", "HTTP 状态"),
742
- width: "112px"
743
- },
744
- {
745
- key: "summary",
746
- title: a.t("platform.screen.BusinessLogListDrawer.error-summary", "错误摘要"),
747
- width: "260px"
748
- }
749
- ] }
750
- }));
751
- function Le(e) {
752
- return e instanceof h ? re(e, a) : ee(ie(e), a);
753
- }
754
- return (t, n) => (D(), x(_, null, [
755
- w(M(u), {
756
- class: "business-log-list",
757
- context: M(c),
758
- title: e.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": we,
769
- "empty-description": M(a).t("platform.screen.BusinessLogListDrawer.no-logs-match-the-criteria", "暂无符合条件的日志"),
770
- "row-actions-of": je,
771
- "row-actions-title": M(a).t("platform.screen.RecordPermissionDialog.operation", "操作"),
772
- "action-column-width": "88px",
773
- onRecordActivate: he,
774
- onRowAction: Me,
775
- onQueried: Se
776
- }, {
777
- operations: N(() => [q.value ? (D(), y(M(f), {
778
- key: 0,
779
- loading: U.value,
780
- onClick: ge
781
- }, {
782
- default: N(() => [C(j(M(a).t("platform.screen.BusinessLogListDrawer.usage-statistics", "使用统计")), 1)]),
783
- _: 1
784
- }, 8, ["loading"])) : b("v-if", !0), w(Z, { "event-types": Y.value }, null, 8, ["event-types"])]),
785
- cell: N(({ column: e, record: t }) => [e.key === "occurredAt" ? (D(), y(M(r), {
786
- key: 0,
787
- value: t.occurredAt
788
- }, null, 8, ["value"])) : (D(), x("span", {
789
- key: 1,
790
- class: E({ "business-log-list__summary": e.key === "summary" })
791
- }, j(Te(e.key, t)), 3))]),
792
- _: 1
793
- }, 8, [
794
- "context",
795
- "title",
796
- "columns",
797
- "empty-description",
798
- "row-actions-title"
799
- ]),
800
- w(M(ne), {
801
- open: !!m.value,
802
- title: M(a).t("platform.screen.BusinessLogListDrawer.value-details", "{value1}详情", { value1: e.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: n[0] ||= (e) => m.value = void 0
807
- }, {
808
- default: N(() => [g.value ? (D(), y(M(o), {
809
- key: 0,
810
- tip: M(a).t("platform.screen.BusinessLogListDrawer.loading-details", "加载详情")
811
- }, null, 8, ["tip"])) : P.value ? (D(), y(M(i), {
812
- key: 1,
813
- title: M(a).t("platform.screen.BusinessLogListDrawer.failed-to-load-log-details", "日志详情加载失败"),
814
- message: P.value
815
- }, null, 8, ["title", "message"])) : m.value ? (D(), x("dl", Q, [(D(!0), x(_, null, k(fe.value, (e) => (D(), x(_, { key: e.key }, [S("dt", null, j(e.key), 1), S("dd", null, [S("pre", null, j(e.value), 1)])], 64))), 128))])) : (D(), y(M(te), {
816
- key: 3,
817
- description: M(a).t("platform.screen.BusinessLogListDrawer.no-log-selected", "未选择日志")
818
- }, null, 8, ["description"])), J.value && m.value && ue.value ? (D(), x("section", _e, [
819
- w(M(f), {
820
- loading: L.value,
821
- onClick: xe
822
- }, {
823
- default: N(() => [C(j(M(a).t("platform.screen.BusinessLogListDrawer.view-internal-diagnostics", "查看内部诊断")), 1)]),
824
- _: 1
825
- }, 8, ["loading"]),
826
- S("small", null, j(M(a).t("platform.screen.BusinessLogListDrawer.only-administrators-with-platform-wide-scope-can-view-this-information", "仅具备平台范围的管理员可查看。")), 1),
827
- z.value ? (D(), y(M(i), {
828
- key: 0,
829
- title: M(a).t("platform.screen.BusinessLogListDrawer.internal-diagnostics-unavailable", "内部诊断不可用"),
830
- message: z.value
831
- }, null, 8, ["title", "message"])) : I.value ? (D(), x("dl", ve, [(D(!0), x(_, null, k(pe.value, (e) => (D(), x(_, { key: e.key }, [S("dt", null, j(e.key), 1), S("dd", null, [S("pre", null, j(e.value), 1)])], 64))), 128))])) : b("v-if", !0)
832
- ])) : b("v-if", !0)]),
833
- _: 1
834
- }, 8, [
835
- "open",
836
- "title",
837
- "subtitle"
838
- ]),
839
- w(M(ne), {
840
- open: B.value,
841
- title: M(a).t("platform.screen.BusinessLogListDrawer.business-activity-usage-statistics", "业务活动使用统计"),
842
- "render-mode": "inline",
843
- subtitle: M(a).t("platform.screen.BusinessLogListDrawer.statistics-follow-the-current-query-criteria-and-the-signed-in", "统计口径遵循当前标准查询条件与登录账号的数据范围。"),
844
- "close-on-outside": !0,
845
- onClose: n[1] ||= (e) => B.value = !1
846
- }, {
847
- default: N(() => [U.value ? (D(), y(M(o), {
848
- key: 0,
849
- tip: M(a).t("platform.screen.BusinessLogListDrawer.loading-usage-statistics", "加载使用统计")
850
- }, null, 8, ["tip"])) : G.value ? (D(), y(M(i), {
851
- key: 1,
852
- title: M(a).t("platform.screen.BusinessLogListDrawer.failed-to-load-usage-statistics", "使用统计加载失败"),
853
- message: G.value
854
- }, null, 8, ["title", "message"])) : (D(), x(_, { key: 2 }, [me.value ? (D(), x("p", ye, j(M(a).t("platform.screen.BusinessLogListDrawer.these-statistics-cover-only-the-most-recent-accessible-logs", "当前统计只覆盖可读取的最近日志。")), 1)) : b("v-if", !0), X.value.length > 0 ? (D(), x("dl", be, [(D(!0), x(_, null, k(X.value, (e) => (D(), x(_, { key: e.key }, [S("dt", null, j(e.kind) + " · " + j(e.title), 1), S("dd", null, j(e.count), 1)], 64))), 128))])) : (D(), y(M(te), {
855
- key: 2,
856
- description: M(a).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 };