@epxing/business 5.3.0-beta.2 → 5.3.0-beta.4

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 (98) hide show
  1. package/API.md +115 -111
  2. package/README.md +44 -44
  3. package/dist/src/base/AiSkillEditor.js +1 -1
  4. package/dist/src/base/AiSkillEditor.vue.js +2 -0
  5. package/dist/src/base/AppConfigFormItem.js +1 -3
  6. package/dist/src/base/AppConfigFormItem.vue.js +210 -85
  7. package/dist/src/base/CommonFieldList.js +1 -1
  8. package/dist/src/base/CommonFieldList.vue.js +2 -1
  9. package/dist/src/base/ConfigModuleIndex.js +38 -1
  10. package/dist/src/base/ManageAppNav.js +1 -1
  11. package/dist/src/base/ManageMenu.js +1 -1
  12. package/dist/src/base/RoleBindTrace.js +253 -0
  13. package/dist/src/base/RoleGroupManage.js +1037 -0
  14. package/dist/src/base/ServiceMenu.js +7 -6
  15. package/dist/src/components/AiList.js +1278 -3
  16. package/dist/src/components/EntityCheckboxFind.vue.js +14 -10
  17. package/dist/src/components/EntityRightFormItem.js +1 -5
  18. package/dist/src/components/EntityRightFormItem.vue.js +3 -1
  19. package/dist/src/components/EntitySystemEr.js +492 -0
  20. package/dist/src/components/HallNav.vue.js +7 -36
  21. package/dist/src/components/IconFontLibrary.js +22 -1
  22. package/dist/src/components/IconFontList.js +21 -1
  23. package/dist/src/components/PrintFormList.js +2 -1
  24. package/dist/src/components/PrintFormList.vue.js +3 -1
  25. package/dist/src/components/WikiWorkbench.js +153 -129
  26. package/dist/src/components/authorization/AuthorizationInterface.js +3 -1
  27. package/dist/src/components/custom-bpmn/PropertiesView.js +1991 -1942
  28. package/dist/src/components/icon-gallery/IconGallery.js +193 -0
  29. package/dist/src/components/icon-gallery/mixin.js +150 -0
  30. package/dist/src/components/wiki-workbench/WikiIntake.js +86 -93
  31. package/dist/src/components/wiki-workbench/WikiIntake.vue.js +153 -73
  32. package/dist/src/index.js +26 -20
  33. package/dist/src/public-components.js +16 -14
  34. package/dist/src/route-components.js +5 -5
  35. package/dist/src/system.component.index.js +1 -1
  36. package/dist/src/system.component.js +8 -3
  37. package/dist/src/system.component.lazy.js +1 -1
  38. package/dist/src/views/Add.js +1 -1
  39. package/dist/src/views/Add.vue.js +8 -3
  40. package/dist/src/views/AiToolManager.js +792 -317
  41. package/dist/src/views/App.js +3 -45
  42. package/dist/src/views/AppRoleSelect.js +3 -230
  43. package/dist/src/views/Error.js +3 -207
  44. package/dist/src/views/ExcelDesign.js +326 -316
  45. package/dist/src/views/JvmMemoryMonitor.js +463 -0
  46. package/dist/src/views/Module.js +3 -170
  47. package/dist/src/views/WikiBinding.js +88 -25
  48. package/dist/style.css +2867 -1487
  49. package/package.json +12 -6
  50. package/src/base/AiSkillEditor.vue +2 -0
  51. package/src/base/AppConfigFormItem.vue +211 -145
  52. package/src/base/CommonFieldList.vue +9 -6
  53. package/src/base/ConfigModuleIndex.vue +37 -1
  54. package/src/base/ManageAppNav.vue +1188 -1188
  55. package/src/base/ManageMenu.vue +933 -933
  56. package/src/base/RoleBindTrace.vue +364 -0
  57. package/src/base/RoleGroupManage.vue +1160 -0
  58. package/src/base/ServiceMenu.vue +6 -5
  59. package/src/components/AiList.vue +439 -113
  60. package/src/components/EntityCheckboxFind.vue +12 -8
  61. package/src/components/EntityRightFormItem.vue +9 -10
  62. package/src/components/EntitySystemEr.vue +517 -0
  63. package/src/components/HallNav.vue +6 -33
  64. package/src/components/IconFontLibrary.vue +27 -60
  65. package/src/components/IconFontList.vue +13 -64
  66. package/src/components/PrintFormList.vue +33 -27
  67. package/src/components/WikiWorkbench.vue +90 -60
  68. package/src/components/authorization/AuthorizationInterface.vue +2 -0
  69. package/src/components/custom-bpmn/CustomPalette.js +1 -1
  70. package/src/components/custom-bpmn/CustomRenderer.js +1 -1
  71. package/src/components/custom-bpmn/PropertiesView.vue +35 -4
  72. package/src/components/custom-bpmn/index.js +1 -1
  73. package/src/components/icon-gallery/IconGallery.vue +130 -0
  74. package/src/components/icon-gallery/mixin.jsx +109 -0
  75. package/src/components/wiki-workbench/WikiIntake.vue +178 -104
  76. package/src/index.js +24 -20
  77. package/src/public-components.js +1 -0
  78. package/src/route-components.js +4 -4
  79. package/src/system.component.index.js +1 -1
  80. package/src/views/Add.vue +8 -5
  81. package/src/views/AiToolManager.vue +326 -4
  82. package/src/views/App.vue +4 -53
  83. package/src/views/AppRoleSelect.vue +4 -334
  84. package/src/views/Error.vue +4 -63
  85. package/src/views/ExcelDesign.vue +24 -7
  86. package/src/views/JvmMemoryMonitor.vue +284 -0
  87. package/src/views/Module.vue +4 -210
  88. package/src/views/WikiBinding.vue +42 -0
  89. package/types/app.d.ts +1 -0
  90. package/types/dept-find.d.ts +1 -1
  91. package/types/index.d.ts +15 -14
  92. package/types/popup.d.ts +2 -2
  93. package/types/route-components.d.ts +1 -1
  94. package/types/user-find.d.ts +1 -1
  95. package/dist/assets/role_select-DTqRlFNz.webp +0 -0
  96. package/dist/src/components/AiList.vue.js +0 -93
  97. package/dist/src/components/IconFontLibrary.vue.js +0 -67
  98. package/dist/src/components/IconFontList.vue.js +0 -79
@@ -0,0 +1,463 @@
1
+ import '../../style.css';
2
+ import axios from "axios";
3
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, createTextVNode, createBlock, createCommentVNode, Fragment, toDisplayString, normalizeClass, markRaw } from "vue";
4
+ /* empty css */
5
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
6
+ const _sfc_main = {
7
+ name: "epx-jvm-memory-monitor",
8
+ data() {
9
+ return {
10
+ snapshot: null,
11
+ history: [],
12
+ autoRefresh: true,
13
+ loading: false,
14
+ error: "",
15
+ stale: false,
16
+ active: false,
17
+ timer: null,
18
+ // 取消并作废离开页面前的请求,避免迟到响应重启轮询。
19
+ pendingRequest: null,
20
+ jstackLoading: false,
21
+ jstackVisible: false,
22
+ jstackSnapshot: null
23
+ };
24
+ },
25
+ computed: {
26
+ statusText() {
27
+ if (this.error || this.stale) return "状态未知";
28
+ const states = { NORMAL: "正常", WARNING: "内存预警", PROTECTED: this.snapshot.rejecting ? "请求保护中" : "高内存压力(仅监控)", STARTING: "等待采样", DISABLED: "监控已关闭" };
29
+ return states[this.snapshot.state] || "状态未知";
30
+ },
31
+ statusType() {
32
+ if (this.error || this.stale || !this.snapshot.enabled) return "info";
33
+ return this.snapshot.state === "PROTECTED" ? "danger" : this.snapshot.state === "WARNING" ? "warning" : "success";
34
+ },
35
+ pressureColor() {
36
+ return this.snapshot.pressureRatio >= this.snapshot.rejectThreshold ? "#f56c6c" : "#3074ef";
37
+ },
38
+ trendPoints() {
39
+ return this.history.map((point, index) => `${index * 600 / Math.max(1, this.history.length - 1)},${120 * (1 - Math.min(1, Math.max(0, point.pressureRatio)))}`).join(" ");
40
+ }
41
+ },
42
+ mounted() {
43
+ document.addEventListener("visibilitychange", this.onVisibilityChange);
44
+ this.activate();
45
+ },
46
+ activated() {
47
+ this.activate();
48
+ },
49
+ deactivated() {
50
+ this.active = false;
51
+ this.stop();
52
+ },
53
+ beforeUnmount() {
54
+ this.active = false;
55
+ this.stop();
56
+ document.removeEventListener("visibilitychange", this.onVisibilityChange);
57
+ },
58
+ methods: {
59
+ activate() {
60
+ if (this.active) return;
61
+ this.active = true;
62
+ if (!document.hidden) this.refresh();
63
+ },
64
+ stop() {
65
+ clearTimeout(this.timer);
66
+ this.timer = null;
67
+ if (this.pendingRequest) this.pendingRequest.cancel();
68
+ this.pendingRequest = null;
69
+ this.loading = false;
70
+ },
71
+ onVisibilityChange() {
72
+ if (document.hidden) this.stop();
73
+ else if (this.active && this.autoRefresh) this.refresh();
74
+ },
75
+ changeRefresh() {
76
+ this.stop();
77
+ if (this.autoRefresh) this.refresh();
78
+ },
79
+ async refresh() {
80
+ if (!this.active || document.hidden || this.loading) return;
81
+ clearTimeout(this.timer);
82
+ this.loading = true;
83
+ const request = markRaw(axios.CancelToken.source());
84
+ this.pendingRequest = request;
85
+ try {
86
+ const data = await this.$http.get({ entityId: "FM_SYSTEM", action: "getJvmMemoryStatus" }, { timeout: 8e3, cancelToken: request.token });
87
+ if (this.pendingRequest !== request) return;
88
+ if (!data || !data.instanceId || !data.state) throw new Error("监控数据格式异常");
89
+ if (this.snapshot && this.snapshot.instanceId !== data.instanceId) this.history = [];
90
+ this.snapshot = data;
91
+ this.error = "";
92
+ this.stale = data.enabled && data.sampledAt > 0 && Date.now() - data.sampledAt > Math.max(3e4, data.sampleIntervalMs * 3);
93
+ const last = this.history[this.history.length - 1];
94
+ if (data.sampledAt > 0 && (!last || last.sampledAt !== data.sampledAt)) {
95
+ this.history.push({ sampledAt: data.sampledAt, pressureRatio: data.pressureRatio });
96
+ if (this.history.length > 60) this.history.shift();
97
+ }
98
+ } catch (error) {
99
+ if (this.pendingRequest === request && !axios.isCancel(error)) this.error = error && (error.msg || error.message) || "内存监控获取失败";
100
+ } finally {
101
+ if (this.pendingRequest === request) {
102
+ this.pendingRequest = null;
103
+ this.loading = false;
104
+ if (this.active && this.autoRefresh && !document.hidden) {
105
+ this.timer = setTimeout(this.refresh, Math.max(1e4, this.snapshot && this.snapshot.sampleIntervalMs || 0));
106
+ }
107
+ }
108
+ }
109
+ },
110
+ async captureJstack() {
111
+ if (this.jstackLoading) return;
112
+ this.jstackLoading = true;
113
+ try {
114
+ this.jstackSnapshot = await this.$http.get({ entityId: "FM_SYSTEM", action: "getJvmJstack" }, { timeout: 15e3 });
115
+ this.jstackVisible = true;
116
+ } catch (error) {
117
+ this.$message.error(error && (error.msg || error.message) || "jstack 获取失败");
118
+ } finally {
119
+ this.jstackLoading = false;
120
+ }
121
+ },
122
+ async copyJstack() {
123
+ if (!this.jstackSnapshot || !this.jstackSnapshot.text) return;
124
+ const text = this.jstackSnapshot.text;
125
+ try {
126
+ if (navigator.clipboard && navigator.clipboard.writeText) {
127
+ await navigator.clipboard.writeText(text);
128
+ } else {
129
+ const input = document.createElement("textarea");
130
+ input.value = text;
131
+ input.setAttribute("readonly", "");
132
+ input.style.position = "fixed";
133
+ input.style.opacity = "0";
134
+ document.body.appendChild(input);
135
+ input.select();
136
+ document.execCommand("copy");
137
+ document.body.removeChild(input);
138
+ }
139
+ this.$message.success("jstack 已复制");
140
+ } catch (error) {
141
+ this.$message.error("复制失败,请手动选择文本复制");
142
+ }
143
+ },
144
+ bytes(value) {
145
+ if (value == null || value < 0) return "未限定";
146
+ return value >= 1073741824 ? `${(value / 1073741824).toFixed(2)} GB` : `${(value / 1048576).toFixed(1)} MB`;
147
+ },
148
+ percent(used, max) {
149
+ return max > 0 ? Math.min(100, Math.max(0, Math.round(used / max * 1e3) / 10)) : 0;
150
+ },
151
+ ratio(value) {
152
+ return `${Math.round(value * 100)}%`;
153
+ },
154
+ riskType(value) {
155
+ return value === "HIGH" || value === "DETECTED" ? "danger" : value === "WATCH" ? "warning" : "success";
156
+ },
157
+ seconds(value) {
158
+ return value == null || value < 0 ? "暂不可预测" : `${value} 秒`;
159
+ },
160
+ bytesPerSecond(value) {
161
+ return `${this.bytes(value)}/秒`;
162
+ },
163
+ time(value) {
164
+ return value > 0 ? new Date(value).toLocaleString() : "—";
165
+ }
166
+ }
167
+ };
168
+ const _hoisted_1 = { class: "jvm-memory" };
169
+ const _hoisted_2 = { class: "jvm-memory__toolbar" };
170
+ const _hoisted_3 = { class: "jvm-memory__actions" };
171
+ const _hoisted_4 = { class: "jvm-memory__status" };
172
+ const _hoisted_5 = { class: "jvm-memory__summary-row" };
173
+ const _hoisted_6 = { class: "jvm-memory__panel jvm-memory__policy" };
174
+ const _hoisted_7 = {
175
+ key: 0,
176
+ class: "jvm-memory__panel jvm-memory__risk"
177
+ };
178
+ const _hoisted_8 = { class: "jvm-memory__chart-title" };
179
+ const _hoisted_9 = { key: 0 };
180
+ const _hoisted_10 = { key: 1 };
181
+ const _hoisted_11 = {
182
+ key: 0,
183
+ class: "jvm-memory__cards"
184
+ };
185
+ const _hoisted_12 = { class: "jvm-memory__card" };
186
+ const _hoisted_13 = { class: "jvm-memory__card" };
187
+ const _hoisted_14 = { class: "jvm-memory__card" };
188
+ const _hoisted_15 = { class: "jvm-memory__card" };
189
+ const _hoisted_16 = { class: "jvm-memory__panel" };
190
+ const _hoisted_17 = { class: "jvm-memory__chart-title" };
191
+ const _hoisted_18 = {
192
+ key: 0,
193
+ class: "jvm-memory__chart",
194
+ viewBox: "0 0 600 120",
195
+ preserveAspectRatio: "none",
196
+ role: "img",
197
+ "aria-label": "内存压力趋势,橙色虚线为保护阈值"
198
+ };
199
+ const _hoisted_19 = ["y1", "y2"];
200
+ const _hoisted_20 = ["points"];
201
+ const _hoisted_21 = {
202
+ key: 1,
203
+ class: "jvm-memory__empty"
204
+ };
205
+ const _hoisted_22 = { class: "jvm-memory__chart-title" };
206
+ const _hoisted_23 = {
207
+ key: 1,
208
+ class: "jvm-memory__panel jvm-memory__threads"
209
+ };
210
+ const _hoisted_24 = { class: "jvm-memory__chart-title" };
211
+ const _hoisted_25 = { class: "jvm-memory__thread-grid" };
212
+ const _hoisted_26 = {
213
+ key: 3,
214
+ class: "jvm-memory__empty"
215
+ };
216
+ const _hoisted_27 = { class: "jvm-memory__dialog-title" };
217
+ const _hoisted_28 = { class: "jvm-memory__dialog-actions" };
218
+ const _hoisted_29 = {
219
+ key: 0,
220
+ class: "jvm-memory__jstack-meta"
221
+ };
222
+ const _hoisted_30 = {
223
+ key: 1,
224
+ class: "jvm-memory__jstack"
225
+ };
226
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
227
+ const _component_el_switch = resolveComponent("el-switch");
228
+ const _component_el_button = resolveComponent("el-button");
229
+ const _component_el_alert = resolveComponent("el-alert");
230
+ const _component_el_tag = resolveComponent("el-tag");
231
+ const _component_el_progress = resolveComponent("el-progress");
232
+ const _component_el_dialog = resolveComponent("el-dialog");
233
+ return openBlock(), createElementBlock("section", _hoisted_1, [
234
+ createElementVNode("div", _hoisted_2, [
235
+ _cache[4] || (_cache[4] = createElementVNode("div", null, [
236
+ createElementVNode("h2", null, "内存监控"),
237
+ createElementVNode("p", null, "当前 JVM 的内存使用、GC 与请求保护状态")
238
+ ], -1)),
239
+ createElementVNode("div", _hoisted_3, [
240
+ createVNode(_component_el_switch, {
241
+ modelValue: $data.autoRefresh,
242
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.autoRefresh = $event),
243
+ "active-text": "自动刷新",
244
+ onChange: $options.changeRefresh
245
+ }, null, 8, ["modelValue", "onChange"]),
246
+ createVNode(_component_el_button, {
247
+ size: "small",
248
+ icon: "el-icon-refresh",
249
+ loading: $data.loading,
250
+ onClick: $options.refresh
251
+ }, {
252
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
253
+ createTextVNode("刷新", -1)
254
+ ])]),
255
+ _: 1
256
+ }, 8, ["loading", "onClick"]),
257
+ createVNode(_component_el_button, {
258
+ size: "small",
259
+ icon: "el-icon-document",
260
+ loading: $data.jstackLoading,
261
+ onClick: $options.captureJstack
262
+ }, {
263
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
264
+ createTextVNode("获取 jstack", -1)
265
+ ])]),
266
+ _: 1
267
+ }, 8, ["loading", "onClick"])
268
+ ])
269
+ ]),
270
+ $data.error ? (openBlock(), createBlock(_component_el_alert, {
271
+ key: 0,
272
+ title: $data.error,
273
+ type: "error",
274
+ closable: false,
275
+ "show-icon": ""
276
+ }, null, 8, ["title"])) : $data.stale ? (openBlock(), createBlock(_component_el_alert, {
277
+ key: 1,
278
+ title: "采样数据已过期,请检查 JVM 监控线程或网络。下方保留最后一次采样。",
279
+ type: "warning",
280
+ closable: false,
281
+ "show-icon": ""
282
+ })) : createCommentVNode("", true),
283
+ $data.snapshot ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
284
+ createElementVNode("div", _hoisted_4, [
285
+ createVNode(_component_el_tag, { type: $options.statusType }, {
286
+ default: withCtx(() => [
287
+ createTextVNode(toDisplayString($options.statusText), 1)
288
+ ]),
289
+ _: 1
290
+ }, 8, ["type"]),
291
+ createElementVNode("span", null, "采样时间:" + toDisplayString($options.time($data.snapshot.sampledAt)), 1),
292
+ createElementVNode("span", null, "采样间隔:" + toDisplayString($data.snapshot.sampleIntervalMs / 1e3) + " 秒", 1),
293
+ createElementVNode("span", null, "保护策略:" + toDisplayString($data.snapshot.rejectRequests ? "高压时拒绝新请求" : "仅监控"), 1)
294
+ ]),
295
+ createElementVNode("div", _hoisted_5, [
296
+ createElementVNode("div", _hoisted_6, [
297
+ _cache[5] || (_cache[5] = createElementVNode("h3", null, "监控与保护规则", -1)),
298
+ createElementVNode("p", null, "预警 " + toDisplayString($options.ratio($data.snapshot.warningThreshold)) + ";连续 " + toDisplayString($data.snapshot.highSamples) + " 次达到 " + toDisplayString($options.ratio($data.snapshot.rejectThreshold)) + ",或单次达到 " + toDisplayString($options.ratio($data.snapshot.emergencyThreshold)) + " 时进入保护。", 1),
299
+ createElementVNode("p", null, "连续 " + toDisplayString($data.snapshot.recoverySamples) + " 次降至 " + toDisplayString($options.ratio($data.snapshot.recoveryThreshold)) + " 以下后恢复。保护期间新业务请求返回 503,已接收的请求继续执行。", 1),
300
+ _cache[6] || (_cache[6] = createElementVNode("p", null, "压力取堆内存、有明确上限的非堆内存池及已配置预算的直接内存使用率的最大值。监控不主动触发 GC,也不采集对象明细。", -1)),
301
+ createElementVNode("small", null, "实例 " + toDisplayString($data.snapshot.instanceId) + " · JVM 启动于 " + toDisplayString($options.time($data.snapshot.startedAt)) + "。只展示本次请求命中的 JVM,切换实例时清空趋势。", 1)
302
+ ]),
303
+ $data.snapshot.risk ? (openBlock(), createElementBlock("div", _hoisted_7, [
304
+ createElementVNode("div", _hoisted_8, [
305
+ _cache[7] || (_cache[7] = createElementVNode("h3", null, "溢出与死锁风险预测", -1)),
306
+ createElementVNode("span", null, toDisplayString($data.snapshot.risk.reason), 1)
307
+ ]),
308
+ createElementVNode("p", null, [
309
+ _cache[8] || (_cache[8] = createTextVNode("内存风险:", -1)),
310
+ createVNode(_component_el_tag, {
311
+ size: "small",
312
+ type: $options.riskType($data.snapshot.risk.memoryRisk)
313
+ }, {
314
+ default: withCtx(() => [
315
+ createTextVNode(toDisplayString($data.snapshot.risk.memoryRisk), 1)
316
+ ]),
317
+ _: 1
318
+ }, 8, ["type"]),
319
+ _cache[9] || (_cache[9] = createElementVNode("span", { class: "jvm-memory__risk-gap" }, "死锁风险:", -1)),
320
+ createVNode(_component_el_tag, {
321
+ size: "small",
322
+ type: $options.riskType($data.snapshot.risk.deadlockRisk)
323
+ }, {
324
+ default: withCtx(() => [
325
+ createTextVNode(toDisplayString($data.snapshot.risk.deadlockRisk), 1)
326
+ ]),
327
+ _: 1
328
+ }, 8, ["type"])
329
+ ]),
330
+ $data.snapshot.risk.memoryGrowthBytesPerSecond > 0 ? (openBlock(), createElementBlock("p", _hoisted_9, "最近窗口堆增长 " + toDisplayString($options.bytesPerSecond($data.snapshot.risk.memoryGrowthBytesPerSecond)) + ";预计达到拒绝线 " + toDisplayString($options.seconds($data.snapshot.risk.predictedSecondsToReject)) + ",达到紧急线 " + toDisplayString($options.seconds($data.snapshot.risk.predictedSecondsToEmergency)) + "。", 1)) : (openBlock(), createElementBlock("p", _hoisted_10, "最近窗口未观察到持续堆增长,预测仅供预警参考。"))
331
+ ])) : createCommentVNode("", true)
332
+ ]),
333
+ $data.snapshot.heap ? (openBlock(), createElementBlock("div", _hoisted_11, [
334
+ createElementVNode("div", _hoisted_12, [
335
+ _cache[10] || (_cache[10] = createElementVNode("span", null, "堆内存", -1)),
336
+ createElementVNode("strong", null, toDisplayString($options.bytes($data.snapshot.heap.used)), 1),
337
+ createVNode(_component_el_progress, {
338
+ percentage: $options.percent($data.snapshot.heap.used, $data.snapshot.heap.max),
339
+ color: $options.pressureColor
340
+ }, null, 8, ["percentage", "color"]),
341
+ createElementVNode("small", null, "上限 " + toDisplayString($options.bytes($data.snapshot.heap.max)) + " · 已提交 " + toDisplayString($options.bytes($data.snapshot.heap.committed)), 1)
342
+ ]),
343
+ createElementVNode("div", _hoisted_13, [
344
+ _cache[11] || (_cache[11] = createElementVNode("span", null, "非堆内存", -1)),
345
+ createElementVNode("strong", null, toDisplayString($options.bytes($data.snapshot.nonHeap.used)), 1),
346
+ createElementVNode("small", null, "上限 " + toDisplayString($options.bytes($data.snapshot.nonHeap.max)) + " · 已提交 " + toDisplayString($options.bytes($data.snapshot.nonHeap.committed)), 1)
347
+ ]),
348
+ createElementVNode("div", _hoisted_14, [
349
+ _cache[12] || (_cache[12] = createElementVNode("span", null, "直接 / 映射缓冲区", -1)),
350
+ createElementVNode("strong", null, toDisplayString($options.bytes($data.snapshot.directBytes)), 1),
351
+ createElementVNode("small", null, "映射 " + toDisplayString($options.bytes($data.snapshot.mappedBytes)), 1),
352
+ createElementVNode("small", null, "直接内存预算 " + toDisplayString($data.snapshot.directMemoryLimitBytes ? $options.bytes($data.snapshot.directMemoryLimitBytes) : "未配置,仅监控"), 1)
353
+ ]),
354
+ createElementVNode("div", _hoisted_15, [
355
+ _cache[13] || (_cache[13] = createElementVNode("span", null, "GC 累计次数 / 耗时", -1)),
356
+ createElementVNode("strong", null, toDisplayString($data.snapshot.gcCount) + " 次", 1),
357
+ createElementVNode("small", null, toDisplayString(($data.snapshot.gcTimeMillis / 1e3).toFixed(2)) + " 秒 · JVM 启动以来累计", 1),
358
+ createElementVNode("small", null, "已拒绝请求 " + toDisplayString($data.snapshot.rejectedRequests) + " 次", 1)
359
+ ])
360
+ ])) : createCommentVNode("", true),
361
+ createElementVNode("div", _hoisted_16, [
362
+ createElementVNode("div", _hoisted_17, [
363
+ _cache[14] || (_cache[14] = createElementVNode("h3", null, "内存压力趋势", -1)),
364
+ createElementVNode("span", null, "当前 " + toDisplayString(($data.snapshot.pressureRatio * 100).toFixed(1)) + "% · 当前页面最近 60 个采样点", 1)
365
+ ]),
366
+ $data.history.length > 1 ? (openBlock(), createElementBlock("svg", _hoisted_18, [
367
+ createElementVNode("line", {
368
+ x1: "0",
369
+ y1: 120 * (1 - $data.snapshot.rejectThreshold),
370
+ x2: "600",
371
+ y2: 120 * (1 - $data.snapshot.rejectThreshold),
372
+ stroke: "#e6a23c",
373
+ "stroke-dasharray": "5 5"
374
+ }, null, 8, _hoisted_19),
375
+ createElementVNode("polyline", {
376
+ points: $options.trendPoints,
377
+ fill: "none",
378
+ stroke: "#3074ef",
379
+ "stroke-width": "2",
380
+ "vector-effect": "non-scaling-stroke"
381
+ }, null, 8, _hoisted_20)
382
+ ])) : (openBlock(), createElementBlock("p", _hoisted_21, toDisplayString($data.snapshot.enabled ? "等待下一次采样形成趋势" : "监控已关闭"), 1)),
383
+ createElementVNode("div", _hoisted_22, [
384
+ createElementVNode("small", null, toDisplayString($data.history.length ? $options.time($data.history[0].sampledAt) : "—"), 1),
385
+ createElementVNode("small", null, toDisplayString($options.time($data.snapshot.sampledAt)), 1)
386
+ ])
387
+ ]),
388
+ $data.snapshot.threads ? (openBlock(), createElementBlock("div", _hoisted_23, [
389
+ createElementVNode("div", _hoisted_24, [
390
+ _cache[15] || (_cache[15] = createElementVNode("h3", null, "线程监控", -1)),
391
+ createElementVNode("span", null, "采样 " + toDisplayString($options.time($data.snapshot.threads.sampledAt)), 1)
392
+ ]),
393
+ createElementVNode("div", _hoisted_25, [
394
+ createElementVNode("span", null, [
395
+ _cache[16] || (_cache[16] = createTextVNode("活动线程 ", -1)),
396
+ createElementVNode("strong", null, toDisplayString($data.snapshot.threads.live), 1)
397
+ ]),
398
+ createElementVNode("span", null, [
399
+ _cache[17] || (_cache[17] = createTextVNode("峰值线程 ", -1)),
400
+ createElementVNode("strong", null, toDisplayString($data.snapshot.threads.peak), 1)
401
+ ]),
402
+ createElementVNode("span", null, [
403
+ _cache[18] || (_cache[18] = createTextVNode("RUNNABLE ", -1)),
404
+ createElementVNode("strong", null, toDisplayString($data.snapshot.threads.runnable), 1)
405
+ ]),
406
+ createElementVNode("span", null, [
407
+ _cache[19] || (_cache[19] = createTextVNode("BLOCKED ", -1)),
408
+ createElementVNode("strong", null, toDisplayString($data.snapshot.threads.blocked), 1)
409
+ ]),
410
+ createElementVNode("span", null, [
411
+ _cache[20] || (_cache[20] = createTextVNode("WAITING ", -1)),
412
+ createElementVNode("strong", null, toDisplayString($data.snapshot.threads.waiting + $data.snapshot.threads.timedWaiting), 1)
413
+ ]),
414
+ createElementVNode("span", null, [
415
+ _cache[21] || (_cache[21] = createTextVNode("死锁线程 ", -1)),
416
+ createElementVNode("strong", {
417
+ class: normalizeClass({ "is-danger": $data.snapshot.threads.deadlocked > 0 })
418
+ }, toDisplayString($data.snapshot.threads.deadlocked), 3)
419
+ ]),
420
+ createElementVNode("span", null, [
421
+ _cache[22] || (_cache[22] = createTextVNode("线程栈估算 ", -1)),
422
+ createElementVNode("strong", null, toDisplayString($data.snapshot.threads.stackBytesEstimated ? $options.bytes($data.snapshot.threads.stackBytesEstimate) : "未知"), 1)
423
+ ])
424
+ ]),
425
+ _cache[23] || (_cache[23] = createElementVNode("p", null, "线程栈是按活动线程数和 Xss 参数估算的保留空间,不等于实际 RSS;死锁扫描按 30 秒周期执行。", -1))
426
+ ])) : createCommentVNode("", true)
427
+ ], 64)) : !$data.loading && !$data.error ? (openBlock(), createElementBlock("p", _hoisted_26, "暂无采样数据")) : createCommentVNode("", true),
428
+ createVNode(_component_el_dialog, {
429
+ modelValue: $data.jstackVisible,
430
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.jstackVisible = $event),
431
+ width: "80%",
432
+ "append-to-body": ""
433
+ }, {
434
+ title: withCtx(() => [
435
+ createElementVNode("div", _hoisted_27, [
436
+ _cache[25] || (_cache[25] = createElementVNode("span", null, "JVM jstack(有界快照)", -1)),
437
+ createElementVNode("span", _hoisted_28, [
438
+ createVNode(_component_el_button, {
439
+ size: "small",
440
+ icon: "el-icon-document-copy",
441
+ disabled: !$data.jstackSnapshot,
442
+ onClick: $options.copyJstack
443
+ }, {
444
+ default: withCtx(() => [..._cache[24] || (_cache[24] = [
445
+ createTextVNode("复制", -1)
446
+ ])]),
447
+ _: 1
448
+ }, 8, ["disabled", "onClick"])
449
+ ])
450
+ ])
451
+ ]),
452
+ default: withCtx(() => [
453
+ $data.jstackSnapshot ? (openBlock(), createElementBlock("div", _hoisted_29, "线程 " + toDisplayString($data.jstackSnapshot.threadCount) + ",输出 " + toDisplayString($data.jstackSnapshot.includedThreads) + " 条,栈空间估算 " + toDisplayString($data.jstackSnapshot.stackBytesEstimated ? $options.bytes($data.jstackSnapshot.stackBytesEstimate) : "未知"), 1)) : createCommentVNode("", true),
454
+ $data.jstackSnapshot ? (openBlock(), createElementBlock("pre", _hoisted_30, toDisplayString($data.jstackSnapshot.text), 1)) : createCommentVNode("", true)
455
+ ]),
456
+ _: 1
457
+ }, 8, ["modelValue"])
458
+ ]);
459
+ }
460
+ const JvmMemoryMonitor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-edc0b42c"]]);
461
+ export {
462
+ JvmMemoryMonitor as default
463
+ };
@@ -1,173 +1,6 @@
1
1
  import '../../style.css';
2
- import { DELETE_MODULE_ROUTER, SET_ROUTER } from "@epxing/core/src/store/actions";
3
- import { mapState } from "vuex";
4
- import { resolveComponent, openBlock, createElementBlock, createBlock, createCommentVNode } from "vue";
5
- /* empty css */
6
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
7
- const _sfc_main = {
8
- name: "epx-module",
9
- props: {
10
- router: {
11
- type: Object,
12
- default() {
13
- return {};
14
- }
15
- }
16
- },
17
- data() {
18
- return {
19
- showPage: false,
20
- moduleIndexPage: "",
21
- moduleRouters: [],
22
- initRoute: null
23
- };
24
- },
25
- computed: {
26
- ...mapState({
27
- // routers: state => state.router.moduleRouters,
28
- // route: state => state.router.moduleRoute,
29
- user: (state) => state.user.user
30
- }),
31
- pageId() {
32
- return this.route.pageId || this.moduleIndexPage;
33
- },
34
- // moduleRouters () {
35
- // const { children = [] } = this.router
36
- // return children
37
- // },
38
- moduleRouter() {
39
- return this.moduleRouters[this.moduleRouters.length - 1] || {};
40
- }
41
- },
42
- watch: {
43
- $routers: {
44
- handler(routers) {
45
- routers.forEach((item) => {
46
- if (item.key === this.router.key) {
47
- const { children = [] } = item;
48
- this.moduleRouters = [...children];
49
- }
50
- });
51
- },
52
- deep: true
53
- },
54
- moduleRouter: {
55
- handler(v, oldV) {
56
- if (!(v.pageId === oldV.pageId && v.flag === oldV.flag && v.metaId === oldV.metaId && v.component === oldV.component)) {
57
- this.reloadPageDebounce();
58
- }
59
- },
60
- deep: true
61
- }
62
- },
63
- provide() {
64
- return {
65
- $changeRouter: this.changeRouter,
66
- $reloadPage: this.reloadPage,
67
- $backPage: this.$popModuleRoute
68
- };
69
- },
70
- methods: {
71
- reloadPage() {
72
- this.showPage = false;
73
- this.$nextTick(() => {
74
- if (this.moduleRouter.pageId || this.moduleRouter.flag || this.moduleIndexPage || this.moduleRouter.component) {
75
- const timer = setTimeout(() => {
76
- this.showPage = true;
77
- clearTimeout(timer);
78
- }, 0);
79
- }
80
- });
81
- },
82
- getModule() {
83
- let { moduleId } = this.$route.query;
84
- if (this.router.query) {
85
- moduleId = this.router.query.moduleId;
86
- }
87
- if (!moduleId) {
88
- if (this.user.currentRoleEntity) {
89
- const { MENU: USER_MENU } = this.user.currentRoleEntity.data;
90
- moduleId = USER_MENU;
91
- }
92
- }
93
- this.$http.get({
94
- entityId: "FM_MODULE",
95
- id: moduleId
96
- }).then((data) => {
97
- if (data) {
98
- const module = data.data || {};
99
- const date = (/* @__PURE__ */ new Date()).getTime();
100
- if (!this.router.query) {
101
- this.$createPage({
102
- key: this.$routers.length === 0 ? "nav-" + date : date,
103
- moduleId: module.ID,
104
- title: module.NAME,
105
- openType: "1"
106
- });
107
- this.initRoute = {
108
- key: this.$routers.length === 0 ? "nav-" + date : date,
109
- moduleId: module.ID,
110
- title: module.NAME
111
- };
112
- } else {
113
- if (!this.router.children || this.router.children.length === 0) {
114
- const router = {
115
- ...this.router,
116
- children: [
117
- { key: date, pageId: module.MAIN_PAGE, moduleId }
118
- ]
119
- };
120
- this.initRoute = { key: date, pageId: module.MAIN_PAGE, moduleId };
121
- this.$store.commit(SET_ROUTER, { key: this.router.key, router });
122
- }
123
- }
124
- }
125
- });
126
- },
127
- addListenerRouter() {
128
- this.$bus.off("push");
129
- this.$bus.off("pop");
130
- },
131
- removeListenerRouter() {
132
- this.$store.commit(DELETE_MODULE_ROUTER);
133
- },
134
- changeRouter(v) {
135
- },
136
- back() {
137
- this.$popModuleRoute();
138
- }
139
- },
140
- created() {
141
- this.getModule();
142
- this.addListenerRouter();
143
- this.reloadPageDebounce = this.$_.debounce(this.reloadPage, 20);
144
- },
145
- beforeUnmount() {
146
- this.removeListenerRouter();
147
- }
148
- };
149
- const _hoisted_1 = {
150
- ref: "module",
151
- id: "module",
152
- class: "module"
153
- };
154
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
155
- const _component_epx_page = resolveComponent("epx-page");
156
- return openBlock(), createElementBlock("div", _hoisted_1, [
157
- $data.showPage ? (openBlock(), createBlock(_component_epx_page, {
158
- key: 0,
159
- onChangeRouter: $options.changeRouter,
160
- onBack: $options.back,
161
- pageId: $options.moduleRouter.pageId,
162
- flag: $options.moduleRouter.flag,
163
- metaId: $options.moduleRouter.metaId,
164
- component: $options.moduleRouter.component,
165
- router: $options.moduleRouter,
166
- "current-query": $options.moduleRouter
167
- }, null, 8, ["onChangeRouter", "onBack", "pageId", "flag", "metaId", "component", "router", "current-query"])) : createCommentVNode("", true)
168
- ], 512);
169
- }
170
- const Module = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ef3e2f88"]]);
2
+ import __VUE_DEFAULT__ from "@epxing/core/src/views/Module.vue";
3
+ const _sfc_main = __VUE_DEFAULT__;
171
4
  export {
172
- Module as default
5
+ _sfc_main as default
173
6
  };