@morningfast/platform 1.0.4 → 1.0.6

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.
@@ -1,287 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-CZc-Y3Wh.js";
2
- import { a as t, i as n, n as r } from "./config-CJOAan9n.js";
3
- import { ElMessage as i } from "element-plus";
4
- import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, reactive as h, ref as g, renderList as _, resolveComponent as v, toDisplayString as y, withCtx as b, withModifiers as x } from "vue";
5
- //#region src/main/pages/system/application-config/index.vue?vue&type=script&setup=true&lang.ts
6
- var S = { class: "app-config-page" }, C = { class: "app-config-page__apps" }, w = { class: "app-config-section__header" }, T = { class: "app-config-section__title" }, E = { class: "app-config-page__grid" }, D = ["onClick"], ee = { class: "app-config-card__title-row" }, O = { class: "app-config-card__desc" }, k = { class: "app-config-card__path" }, A = { class: "app-config-card__entry" }, j = { class: "app-config-card__footer" }, M = { class: "app-config-card__footer-actions" }, N = {
7
- key: 0,
8
- class: "app-config-page__empty"
9
- }, P = { class: "app-config-empty__actions" }, F = { class: "app-config-dialog__footer" }, I = { class: "app-config-remove__text" }, L = { class: "app-config-dialog__footer" }, R = /* @__PURE__ */ e(/* @__PURE__ */ f({
10
- __name: "index",
11
- setup(e) {
12
- let f = g(!1), R = g("create"), z = g(!1), B = g(!1), V = g(!1), H = g(null), U = g(J()), W = g(U.value[0]?.id || ""), G = g(""), K = h(Y()), q = o(() => R.value === "edit" ? "编辑子应用" : R.value === "copy" ? "复制子应用" : "新增子应用");
13
- function J() {
14
- return r();
15
- }
16
- function Y() {
17
- return {
18
- id: "",
19
- name: "",
20
- description: "",
21
- basePath: "",
22
- entry: ""
23
- };
24
- }
25
- function X() {
26
- R.value = "create", G.value = "", Object.assign(K, Y()), f.value = !0;
27
- }
28
- function Z(e) {
29
- R.value = "edit", G.value = e.id, Object.assign(K, {
30
- id: e.id,
31
- name: e.name,
32
- description: e.description,
33
- basePath: e.basePath,
34
- entry: e.entry
35
- }), f.value = !0;
36
- }
37
- function te(e) {
38
- R.value = "copy", G.value = "", Object.assign(K, {
39
- id: "",
40
- name: e.name,
41
- description: e.description,
42
- basePath: e.basePath,
43
- entry: e.entry
44
- }), f.value = !0;
45
- }
46
- function ne(e) {
47
- H.value = e, B.value = !0;
48
- }
49
- async function re() {
50
- if (!K.name.trim() || !K.basePath.trim()) {
51
- i.warning("请先填写子应用名称和路由前缀");
52
- return;
53
- }
54
- if (!K.entry.trim()) {
55
- i.warning("请先填写子应用入口地址");
56
- return;
57
- }
58
- z.value = !0;
59
- try {
60
- let e = {
61
- id: G.value || `app-${Date.now()}`,
62
- name: K.name.trim(),
63
- type: "sub",
64
- description: K.description.trim(),
65
- basePath: n(K.basePath),
66
- entry: K.entry.trim()
67
- };
68
- R.value === "edit" ? U.value = U.value.map((t) => t.id === G.value ? e : t) : U.value = [e, ...U.value], await $(), W.value = e.id, f.value = !1, i.success(Q());
69
- } finally {
70
- z.value = !1;
71
- }
72
- }
73
- function Q() {
74
- return R.value === "edit" ? "子应用已更新" : R.value === "copy" ? "子应用已复制" : "子应用已新增";
75
- }
76
- async function ie() {
77
- if (!H.value) {
78
- B.value = !1;
79
- return;
80
- }
81
- V.value = !0;
82
- try {
83
- U.value = U.value.filter((e) => e.id !== H.value?.id), await $(), W.value = U.value[0]?.id || "", B.value = !1, i.success("子应用已删除");
84
- } finally {
85
- V.value = !1, H.value = null;
86
- }
87
- }
88
- async function $() {
89
- await t(U.value);
90
- }
91
- function ae() {
92
- G.value = "", Object.assign(K, Y());
93
- }
94
- return (e, t) => {
95
- let n = v("el-tag"), r = v("el-button"), i = v("el-scrollbar"), o = v("el-empty"), h = v("el-input"), g = v("el-form-item"), R = v("el-col"), G = v("el-row"), J = v("el-alert"), Y = v("el-form"), Q = v("el-dialog");
96
- return m(), c("div", S, [
97
- l("section", C, [l("div", w, [l("div", T, [t[9] ||= l("h2", null, "子应用", -1), d(n, {
98
- size: "small",
99
- effect: "plain"
100
- }, {
101
- default: b(() => [u(y(U.value.length), 1)]),
102
- _: 1
103
- })]), d(r, {
104
- type: "primary",
105
- onClick: X
106
- }, {
107
- default: b(() => [...t[10] ||= [u("新增子应用", -1)]]),
108
- _: 1
109
- })]), d(i, { class: "app-config-page__scroll" }, {
110
- default: b(() => [l("div", E, [(m(!0), c(a, null, _(U.value, (e) => (m(), c("article", {
111
- key: e.id,
112
- class: p(["app-config-card", { "is-active": W.value === e.id }]),
113
- onClick: (t) => W.value = e.id
114
- }, [
115
- l("div", ee, [l("h2", null, y(e.name), 1), d(n, {
116
- type: "success",
117
- effect: "plain",
118
- size: "small"
119
- }, {
120
- default: b(() => [...t[11] ||= [u("子应用", -1)]]),
121
- _: 1
122
- })]),
123
- l("p", O, y(e.description || "暂无子应用说明"), 1),
124
- l("div", k, y(e.basePath), 1),
125
- l("div", A, y(e.entry), 1),
126
- l("div", j, [t[15] ||= l("span", { class: "app-config-card__mount" }, "qiankun", -1), l("div", M, [
127
- d(r, {
128
- type: "primary",
129
- link: "",
130
- onClick: x((t) => Z(e), ["stop"])
131
- }, {
132
- default: b(() => [...t[12] ||= [u("配置", -1)]]),
133
- _: 1
134
- }, 8, ["onClick"]),
135
- d(r, {
136
- type: "primary",
137
- link: "",
138
- onClick: x((t) => te(e), ["stop"])
139
- }, {
140
- default: b(() => [...t[13] ||= [u("复制", -1)]]),
141
- _: 1
142
- }, 8, ["onClick"]),
143
- d(r, {
144
- type: "danger",
145
- link: "",
146
- onClick: x((t) => ne(e), ["stop"])
147
- }, {
148
- default: b(() => [...t[14] ||= [u("删除", -1)]]),
149
- _: 1
150
- }, 8, ["onClick"])
151
- ])])
152
- ], 10, D))), 128))])]),
153
- _: 1
154
- })]),
155
- U.value.length ? s("", !0) : (m(), c("section", N, [d(o, { description: "暂无子应用配置" }, {
156
- default: b(() => [l("div", P, [d(r, {
157
- type: "primary",
158
- onClick: X
159
- }, {
160
- default: b(() => [...t[16] ||= [u("新增子应用", -1)]]),
161
- _: 1
162
- })])]),
163
- _: 1
164
- })])),
165
- d(Q, {
166
- modelValue: f.value,
167
- "onUpdate:modelValue": t[6] ||= (e) => f.value = e,
168
- title: q.value,
169
- width: "720px",
170
- "destroy-on-close": "",
171
- onClosed: ae
172
- }, {
173
- footer: b(() => [l("div", F, [d(r, { onClick: t[5] ||= (e) => f.value = !1 }, {
174
- default: b(() => [...t[17] ||= [u("取消", -1)]]),
175
- _: 1
176
- }), d(r, {
177
- type: "primary",
178
- loading: z.value,
179
- onClick: re
180
- }, {
181
- default: b(() => [...t[18] ||= [u("保存", -1)]]),
182
- _: 1
183
- }, 8, ["loading"])])]),
184
- default: b(() => [d(Y, {
185
- "label-width": "92px",
186
- onSubmit: t[4] ||= x(() => {}, ["prevent"])
187
- }, {
188
- default: b(() => [d(G, { gutter: 16 }, {
189
- default: b(() => [
190
- d(R, {
191
- xs: 24,
192
- sm: 12
193
- }, {
194
- default: b(() => [d(g, { label: "子应用名称" }, {
195
- default: b(() => [d(h, {
196
- modelValue: K.name,
197
- "onUpdate:modelValue": t[0] ||= (e) => K.name = e,
198
- placeholder: "请输入子应用名称"
199
- }, null, 8, ["modelValue"])]),
200
- _: 1
201
- })]),
202
- _: 1
203
- }),
204
- d(R, {
205
- xs: 24,
206
- sm: 12
207
- }, {
208
- default: b(() => [d(g, { label: "路由前缀" }, {
209
- default: b(() => [d(h, {
210
- modelValue: K.basePath,
211
- "onUpdate:modelValue": t[1] ||= (e) => K.basePath = e,
212
- placeholder: "例如 /micro/sub-app"
213
- }, null, 8, ["modelValue"])]),
214
- _: 1
215
- })]),
216
- _: 1
217
- }),
218
- d(R, {
219
- xs: 24,
220
- sm: 12
221
- }, {
222
- default: b(() => [d(g, { label: "入口地址" }, {
223
- default: b(() => [d(h, {
224
- modelValue: K.entry,
225
- "onUpdate:modelValue": t[2] ||= (e) => K.entry = e,
226
- placeholder: "例如 http://localhost:8082"
227
- }, null, 8, ["modelValue"])]),
228
- _: 1
229
- })]),
230
- _: 1
231
- }),
232
- d(R, { xs: 24 }, {
233
- default: b(() => [d(g, { label: "子应用说明" }, {
234
- default: b(() => [d(h, {
235
- modelValue: K.description,
236
- "onUpdate:modelValue": t[3] ||= (e) => K.description = e,
237
- type: "textarea",
238
- rows: 3,
239
- placeholder: "请输入子应用说明"
240
- }, null, 8, ["modelValue"])]),
241
- _: 1
242
- })]),
243
- _: 1
244
- })
245
- ]),
246
- _: 1
247
- }), d(J, {
248
- type: "info",
249
- closable: !1,
250
- "show-icon": "",
251
- title: "当前页面只维护子应用;系统壳本身不作为应用配置项维护。"
252
- })]),
253
- _: 1
254
- })]),
255
- _: 1
256
- }, 8, ["modelValue", "title"]),
257
- d(Q, {
258
- modelValue: B.value,
259
- "onUpdate:modelValue": t[8] ||= (e) => B.value = e,
260
- title: "删除子应用",
261
- width: "420px",
262
- "destroy-on-close": ""
263
- }, {
264
- footer: b(() => [l("div", L, [d(r, { onClick: t[7] ||= (e) => B.value = !1 }, {
265
- default: b(() => [...t[21] ||= [u("取消", -1)]]),
266
- _: 1
267
- }), d(r, {
268
- type: "danger",
269
- loading: V.value,
270
- onClick: ie
271
- }, {
272
- default: b(() => [...t[22] ||= [u("确认删除", -1)]]),
273
- _: 1
274
- }, 8, ["loading"])])]),
275
- default: b(() => [l("p", I, [
276
- t[19] ||= u(" 确认删除 ", -1),
277
- l("strong", null, y(H.value?.name), 1),
278
- t[20] ||= u(" 吗?删除后本地子应用配置会立即移除。 ", -1)
279
- ])]),
280
- _: 1
281
- }, 8, ["modelValue"])
282
- ]);
283
- };
284
- }
285
- }), [["__scopeId", "data-v-ada45daa"]]);
286
- //#endregion
287
- export { R as default };
@@ -1,40 +0,0 @@
1
- import { r as e, t } from "./storage-DNllLr_D.js";
2
- //#region src/main/micro-apps/config.ts
3
- var n = "system:apps", r = [], i = "micro-app-container";
4
- function a() {
5
- return t(n, r).filter((e) => e.type === "sub");
6
- }
7
- function o(e) {
8
- r = e;
9
- }
10
- async function s(t) {
11
- await e(n, t);
12
- }
13
- function c(e) {
14
- return e.map((e) => ({
15
- id: e.id,
16
- name: u(e),
17
- title: e.name,
18
- entry: e.entry || "http://localhost:8082",
19
- activeRule: d(e.basePath),
20
- container: "#micro-app-container"
21
- }));
22
- }
23
- function l(e) {
24
- return {
25
- id: "id" in e ? String(e.id) : e.name,
26
- name: e.name,
27
- title: e.title,
28
- entry: e.entry,
29
- activeRule: e.activeRule
30
- };
31
- }
32
- function u(e) {
33
- return `morningfast-${e.id}`;
34
- }
35
- function d(e) {
36
- let t = e.trim() || "/micro";
37
- return t.startsWith("/") ? t : `/${t}`;
38
- }
39
- //#endregion
40
- export { s as a, d as i, a as n, o, c as r, l as s, i as t };