@ximatai/muyun-web-app 0.26.17 → 0.26.18

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