@opentiny/tiny-engine-plugin-page 2.0.0-alpha.4 → 2.0.0-alpha.5

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.
package/dist/index.js CHANGED
@@ -1,351 +1,38 @@
1
1
  import "./style.css";
2
- import { reactive as z, watchEffect as Y, computed as re, inject as He, resolveComponent as c, openBlock as T, createElementBlock as J, createVNode as r, withCtx as y, createTextVNode as ae, createElementVNode as x, toDisplayString as me, ref as U, createBlock as A, createCommentVNode as H, nextTick as Le, Fragment as de, renderList as Be, provide as je } from "vue";
3
- import { usePage as L, useModal as Q, useNotify as G, useBlock as qe, useEditorInfo as Je, getMergeMeta as be, useApp as le, useCanvas as fe, useLayout as oe, useBreadcrumb as Ke, useHelp as Xe, HOOK_NAME as We } from "@opentiny/tiny-engine-meta-register";
4
- import { BlockHistoryList as ze, MetaCodeEditor as Qe, LifeCycles as Ye, PluginSetting as ke, SvgButton as Pe, ButtonGroup as we, PluginPanel as Ze } from "@opentiny/tiny-engine-common";
5
- import { isEqual as ce, extend as ne } from "@opentiny/vue-renderless/common/object";
6
- import { Checkbox as Ee, Form as $e, FormItem as et, Input as Ve, Select as tt, Radio as at, Button as xe, Collapse as _e, CollapseItem as ye, Search as nt, Tree as ot } from "@opentiny/vue";
7
- import { constants as Re } from "@opentiny/tiny-engine-utils";
8
- import { isVsCodeEnv as Ge } from "@opentiny/tiny-engine-common/js/environments";
9
- import { handlePageUpdate as st } from "@opentiny/tiny-engine-common/js/http";
10
- import { generateRouter as rt, generatePage as lt } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
11
- import { REGEXP_PAGE_NAME as ct, REGEXP_ROUTE as Ne, REGEXP_FOLDER_NAME as it } from "@opentiny/tiny-engine-common/js/verification";
12
- import { useHttp as gt } from "@opentiny/tiny-engine-http";
2
+ import { ref as U, watchEffect as Y, resolveComponent as u, openBlock as N, createBlock as G, computed as le, createElementBlock as J, createVNode as l, withCtx as y, createElementVNode as V, reactive as W, createTextVNode as $, createCommentVNode as H, resolveDynamicComponent as Ee, nextTick as je, Fragment as Pe, renderList as qe, toDisplayString as fe, provide as Je, inject as Ke } from "vue";
3
+ import { usePage as L, useBlock as Xe, useModal as Q, useEditorInfo as We, getMergeMeta as Ne, useNotify as x, useApp as ce, useCanvas as _e, getMergeRegistry as Ve, useLayout as se, useBreadcrumb as ze, useHelp as Qe, HOOK_NAME as Ye } from "@opentiny/tiny-engine-meta-register";
4
+ import { BlockHistoryList as Ze, MetaCodeEditor as $e, LifeCycles as et, PluginSetting as xe, SvgButton as ye, ButtonGroup as Ge, PluginPanel as tt } from "@opentiny/tiny-engine-common";
5
+ import { isEqual as ie, extend as ee } from "@opentiny/vue-renderless/common/object";
6
+ import { Checkbox as Re, Button as Ae, Collapse as Se, CollapseItem as De, Input as Ue, Search as at, Tree as nt, Form as ot, FormItem as st, Select as rt, Radio as lt } from "@opentiny/vue";
7
+ import { constants as Me } from "@opentiny/tiny-engine-utils";
8
+ import { isVsCodeEnv as He } from "@opentiny/tiny-engine-common/js/environments";
9
+ import { handlePageUpdate as ct } from "@opentiny/tiny-engine-common/js/http";
10
+ import { generatePage as it, generateRouter as gt } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
13
11
  import { previewPage as pt } from "@opentiny/tiny-engine-common/js/preview";
14
- import ut from "@opentiny/vue-renderless/common/deps/throttle";
15
- import { IconSearch as dt, IconFolderOpened as mt, IconFolderClosed as ft } from "@opentiny/vue-icon";
16
- import { getCanvasStatus as Te } from "@opentiny/tiny-engine-common/js/canvas";
17
- const B = gt(), Pt = (n) => B.get(`/app-center/api/pages/list/${n}`), Se = (n) => B.get(`/app-center/api/pages/detail/${n}`), _t = (n) => B.get(`/app-center/api/pages/delete/${n}`), yt = (n) => B.post("/app-center/api/pages/create", n), St = (n, t) => B.post(`/app-center/api/pages/update/${n}`, t), Dt = (n) => B.post("/app-center/api/pages/copy", n), Ae = (n) => B.get(`/app-center/api/pages/histories?page=${n}`), ht = (n) => B.post("/app-center/api/pageHistory/restore", n), Ct = (n) => B.get(`/app-center/api/pages/histories/${n}`), vt = (n, t) => B.post(`/app-center/api/pages/update/${n}`, t), ie = {
18
- fetchPageList: Pt,
19
- fetchPageDetail: Se,
20
- requestDeletePage: _t,
21
- requestCreatePage: yt,
22
- requestCopyPage: Dt,
23
- fetchPageHistory: Ae,
24
- fetchHistoryDetail: Ct,
25
- handleRouteHomeUpdate: St,
26
- requestRestorePageHistory: ht,
27
- requestUpdatePage: vt
28
- }, K = (n, t) => {
29
- const s = n.__vccOpts || n;
12
+ import { useHttp as ut } from "@opentiny/tiny-engine-http";
13
+ import dt from "@opentiny/vue-renderless/common/deps/throttle";
14
+ import { IconSearch as mt, IconFolderOpened as Pt, IconFolderClosed as ft } from "@opentiny/vue-icon";
15
+ import { getCanvasStatus as Oe } from "@opentiny/tiny-engine-common/js/canvas";
16
+ import { REGEXP_PAGE_NAME as _t, REGEXP_ROUTE as Fe, REGEXP_FOLDER_NAME as yt } from "@opentiny/tiny-engine-common/js/verification";
17
+ const B = ut(), St = (a) => B.get(`/app-center/api/pages/list/${a}`), he = (a) => B.get(`/app-center/api/pages/detail/${a}`), Dt = (a) => B.get(`/app-center/api/pages/delete/${a}`), ht = (a) => B.post("/app-center/api/pages/create", a), Ct = (a, t) => B.post(`/app-center/api/pages/update/${a}`, t), vt = (a) => B.post("/app-center/api/pages/copy", a), Le = (a) => B.get(`/app-center/api/pages/histories?page=${a}`), bt = (a) => B.post("/app-center/api/pageHistory/restore", a), It = (a) => B.get(`/app-center/api/pages/histories/${a}`), Tt = (a, t) => B.post(`/app-center/api/pages/update/${a}`, t), ge = {
18
+ fetchPageList: St,
19
+ fetchPageDetail: he,
20
+ requestDeletePage: Dt,
21
+ requestCreatePage: ht,
22
+ requestCopyPage: vt,
23
+ fetchPageHistory: Le,
24
+ fetchHistoryDetail: It,
25
+ handleRouteHomeUpdate: Ct,
26
+ requestRestorePageHistory: bt,
27
+ requestUpdatePage: Tt
28
+ }, K = (a, t) => {
29
+ const s = a.__vccOpts || a;
30
30
  for (const [e, m] of t)
31
31
  s[e] = m;
32
32
  return s;
33
- }, It = {
33
+ }, Nt = {
34
34
  components: {
35
- TinyCheckbox: Ee
36
- },
37
- setup() {
38
- const { pageSettingState: n, STATIC_PAGE_GROUP_ID: t } = L(), { handleRouteHomeUpdate: s } = ie, { confirm: e } = Q(), m = z({
39
- checked: !1,
40
- selectDisable: !1
41
- });
42
- Y(() => {
43
- var g;
44
- const o = !!((g = n.currentPageData) != null && g.isHome);
45
- m.checked = o, m.selectDisable = o;
46
- });
47
- const f = re(() => {
48
- let o = "暂无主页";
49
- if (n.pages[t]) {
50
- const u = n.pages[t].data.filter((P) => P.isHome);
51
- u[0] && (o = u[0].name);
52
- }
53
- return o;
54
- }), a = He("openSettingPanel");
55
- return {
56
- pageSettingState: n,
57
- settingHome: () => {
58
- e({
59
- title: "提示",
60
- type: "warning ",
61
- message: "是否确定要将此页面设置为主页?您所做的任何未保存的更改都将被丢弃。",
62
- exec: () => {
63
- const { id: o } = n.currentPageData, g = n.ROOT_ID, u = { ...n.currentPageData };
64
- u.parentId = g, u.isHome = !0, s(o, u).then(() => {
65
- n.updateTreeData(), a({ data: n.currentPageData }), n.isNew = !1, Ge && rt({
66
- pageId: o,
67
- componentsTree: u
68
- }), G({ message: "主页设置成功!", type: "success" });
69
- }).catch(() => {
70
- G({ message: "主页设置失败!", type: "error" });
71
- });
72
- },
73
- cancel: () => {
74
- m.checked = !1;
75
- }
76
- });
77
- },
78
- homePage: f,
79
- state: m
80
- };
81
- }
82
- }, bt = { class: "home" }, Nt = { class: "tip" }, Tt = { class: "home-page" };
83
- function Ot(n, t, s, e, m, f) {
84
- const a = c("tiny-checkbox");
85
- return T(), J("div", bt, [
86
- r(a, {
87
- class: "selectHome",
88
- modelValue: e.state.checked,
89
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.state.checked = l),
90
- disabled: e.state.selectDisable,
91
- onChange: e.settingHome
92
- }, {
93
- default: y(() => t[1] || (t[1] = [
94
- ae("设为主页")
95
- ])),
96
- _: 1
97
- }, 8, ["modelValue", "disabled", "onChange"]),
98
- x("div", Nt, [
99
- t[2] || (t[2] = x("span", null, "当前主页是", -1)),
100
- x("span", Tt, "【" + me(e.homePage) + "】", 1)
101
- ])
102
- ]);
103
- }
104
- const Ft = /* @__PURE__ */ K(It, [["render", Ot], ["__scopeId", "data-v-b15de911"]]), kt = {
105
- components: {
106
- TinyForm: $e,
107
- TinyFormItem: et,
108
- TinyInput: Ve,
109
- TinySelect: tt,
110
- PageHome: Ft,
111
- TinyRadio: at
112
- },
113
- props: {
114
- modelValue: {
115
- type: Object,
116
- default: () => ({})
117
- },
118
- isFolder: {
119
- type: Boolean,
120
- default: !1
121
- }
122
- },
123
- setup() {
124
- const {
125
- pageSettingState: n,
126
- changeTreeData: t,
127
- STATIC_PAGE_GROUP_ID: s
128
- } = L(), e = n.ROOT_ID, m = U(n.currentPageData.parentId);
129
- Y(() => {
130
- m.value = n.oldParentId;
131
- });
132
- const f = re(() => {
133
- let D = n.currentPageData.route || "", S = n.currentPageData.parentId;
134
- for (; S !== e; ) {
135
- const p = n.treeDataMapping[S];
136
- if (!p)
137
- break;
138
- D = `${p.route}/${D}`, S = p.parentId;
139
- }
140
- return D.startsWith("/") && (D = D.slice(1)), D;
141
- }), a = {
142
- name: [{
143
- required: !0,
144
- message: "请输入页面 ID"
145
- }, {
146
- pattern: ct,
147
- message: "只允许包含英文字母,且为大写开头驼峰格式, 如DemoPage"
148
- }, {
149
- min: 3,
150
- max: 25,
151
- message: "长度在 3 到 25 个字符"
152
- }],
153
- route: [{
154
- required: !0,
155
- message: "请输入页面路由"
156
- }, {
157
- pattern: Ne,
158
- message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
159
- }]
160
- }, l = {
161
- name: [{
162
- required: !0,
163
- message: "请输入页面文件夹 ID"
164
- }, {
165
- pattern: it,
166
- message: "只允许包含英文字母、数字、下横线_、中横线-, 且以英文字母开头"
167
- }, {
168
- min: 3,
169
- max: 25,
170
- message: "长度在 3 到 25 个字符"
171
- }],
172
- route: [{
173
- required: !0,
174
- message: "请输入页面文件夹路由"
175
- }, {
176
- pattern: Ne,
177
- message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
178
- }],
179
- group: [{
180
- required: !0,
181
- message: "必须选择页面类型"
182
- }]
183
- }, o = (D) => {
184
- const S = [];
185
- return D.forEach((p) => {
186
- !p.isPage && p.id !== n.currentPageData.id && (S.push(p), p.children || (p.children = []), p.children = o(p.children));
187
- }), S;
188
- }, g = re(() => {
189
- var F;
190
- const D = r(c("SvgIcon"), {
191
- name: "text-page-folder-closed",
192
- class: "folder-icon"
193
- }, null), S = r(c("SvgIcon"), {
194
- name: "text-page-folder",
195
- class: "folder-icon"
196
- }, null), p = ((F = n.pages[s]) == null ? void 0 : F.data) || [];
197
- return {
198
- data: [{
199
- name: "无",
200
- id: e
201
- }, ...o(JSON.parse(JSON.stringify(p)))],
202
- shrinkIcon: S,
203
- expandIcon: D,
204
- renderContent: (Z, {
205
- node: X,
206
- data: W
207
- }) => r("span", {
208
- style: "display:flex"
209
- }, [X.isLeaf && W.id !== e ? r(c("svg-icon"), {
210
- name: "text-page-folder-closed",
211
- style: "margin-right:14px"
212
- }, null) : null, r("span", {
213
- class: "label"
214
- }, [X.label])])
215
- };
216
- }), u = U(null);
217
- return {
218
- pageRules: a,
219
- folderRules: l,
220
- pageSettingState: n,
221
- generalForm: u,
222
- validGeneralForm: () => new Promise((D, S) => {
223
- u.value.validate((p) => {
224
- p ? D(p) : S(p);
225
- });
226
- }),
227
- treeFolderOp: g,
228
- currentRoute: f,
229
- changeParentForderId: (D) => {
230
- t(D.id, m.value), m.value = D.id;
231
- }
232
- };
233
- }
234
- }, wt = { class: "general-config" }, Et = { class: "tip" }, Vt = {
235
- key: 0,
236
- class: "text"
237
- }, xt = {
238
- key: 1,
239
- class: "route-text"
240
- }, Rt = { class: "text-dim" };
241
- function Gt(n, t, s, e, m, f) {
242
- const a = c("tiny-radio"), l = c("tiny-form-item"), o = c("tiny-input"), g = c("tiny-select"), u = c("tiny-form"), P = c("page-home");
243
- return T(), J("div", wt, [
244
- r(u, {
245
- ref: "generalForm",
246
- model: e.pageSettingState.currentPageData,
247
- rules: s.isFolder ? e.folderRules : e.pageRules,
248
- "label-width": "120px",
249
- "validate-type": "text",
250
- "inline-message": !0,
251
- "label-align": !0,
252
- "label-position": "top",
253
- class: "general-config-form"
254
- }, {
255
- default: y(() => [
256
- s.isFolder ? H("", !0) : (T(), A(l, {
257
- key: 0,
258
- prop: "group",
259
- label: "页面类型",
260
- class: "form-item-page-type"
261
- }, {
262
- default: y(() => [
263
- r(a, {
264
- modelValue: e.pageSettingState.currentPageData.group,
265
- "onUpdate:modelValue": t[0] || (t[0] = (_) => e.pageSettingState.currentPageData.group = _),
266
- class: "page-type-radio",
267
- label: "staticPages"
268
- }, {
269
- default: y(() => t[5] || (t[5] = [
270
- ae(" 静态页面 ")
271
- ])),
272
- _: 1
273
- }, 8, ["modelValue"]),
274
- r(a, {
275
- modelValue: e.pageSettingState.currentPageData.group,
276
- "onUpdate:modelValue": t[1] || (t[1] = (_) => e.pageSettingState.currentPageData.group = _),
277
- class: "page-type-radio",
278
- label: "publicPages"
279
- }, {
280
- default: y(() => t[6] || (t[6] = [
281
- ae(" 公共页面 ")
282
- ])),
283
- _: 1
284
- }, 8, ["modelValue"])
285
- ]),
286
- _: 1
287
- })),
288
- r(l, {
289
- prop: "name",
290
- label: `${s.isFolder ? "文件夹" : "页面"}名称`
291
- }, {
292
- default: y(() => [
293
- r(o, {
294
- modelValue: e.pageSettingState.currentPageData.name,
295
- "onUpdate:modelValue": t[2] || (t[2] = (_) => e.pageSettingState.currentPageData.name = _),
296
- placeholder: `请设置${s.isFolder ? "文件夹" : "页面"}名称`
297
- }, null, 8, ["modelValue", "placeholder"])
298
- ]),
299
- _: 1
300
- }, 8, ["label"]),
301
- e.pageSettingState.currentPageData.group !== "publicPages" ? (T(), A(l, {
302
- key: 1,
303
- label: "父文件夹",
304
- prop: "parentId"
305
- }, {
306
- default: y(() => [
307
- r(g, {
308
- modelValue: e.pageSettingState.currentPageData.parentId,
309
- "onUpdate:modelValue": t[3] || (t[3] = (_) => e.pageSettingState.currentPageData.parentId = _),
310
- "value-field": "id",
311
- "render-type": "tree",
312
- "tree-op": e.treeFolderOp,
313
- "text-field": "name",
314
- placeholder: "请选择父文件夹",
315
- "popper-class": "parent-fold-select-dropdown",
316
- onChange: e.changeParentForderId
317
- }, null, 8, ["modelValue", "tree-op", "onChange"])
318
- ]),
319
- _: 1
320
- })) : H("", !0),
321
- r(l, {
322
- label: "页面路由",
323
- prop: "route"
324
- }, {
325
- default: y(() => [
326
- r(o, {
327
- modelValue: e.pageSettingState.currentPageData.route,
328
- "onUpdate:modelValue": t[4] || (t[4] = (_) => e.pageSettingState.currentPageData.route = _),
329
- placeholder: "请设置路由"
330
- }, null, 8, ["modelValue"]),
331
- x("div", Et, [
332
- e.pageSettingState.currentPageData.route ? (T(), J("span", xt, [
333
- t[7] || (t[7] = x("span", { class: "text" }, "website.com/", -1)),
334
- x("span", Rt, me(e.currentRoute), 1)
335
- ])) : (T(), J("span", Vt, "路由将以website.com开头"))
336
- ])
337
- ]),
338
- _: 1
339
- })
340
- ]),
341
- _: 1
342
- }, 8, ["model", "rules"]),
343
- !s.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (T(), A(P, { key: 0 })) : H("", !0)
344
- ]);
345
- }
346
- const Ue = /* @__PURE__ */ K(kt, [["render", Gt], ["__scopeId", "data-v-98016952"]]), At = {
347
- components: {
348
- BlockHistoryList: ze
35
+ BlockHistoryList: Ze
349
36
  },
350
37
  props: {
351
38
  curPageData: {
@@ -354,96 +41,96 @@ const Ue = /* @__PURE__ */ K(kt, [["render", Gt], ["__scopeId", "data-v-98016952
354
41
  }
355
42
  },
356
43
  emits: ["restorePage"],
357
- setup(n, { emit: t }) {
358
- const { pageSettingState: s } = L(), { getDateFromNow: e } = qe(), { confirm: m } = Q(), f = U([]), a = (g) => {
359
- const { id: u, version: P } = Je().useInfo(), _ = P ? `&app=${u}&version=${P}` : "";
360
- g ? Ae(g + _).then((D) => {
361
- D && (D.forEach((S) => {
362
- S.backupTitle = S.message, S.backupTime = e(new Date(S.time));
363
- }), f.value = D.reverse());
364
- }) : f.value = [];
44
+ setup(a, { emit: t }) {
45
+ const { pageSettingState: s } = L(), { getDateFromNow: e } = Xe(), { confirm: m } = Q(), i = U([]), o = (p) => {
46
+ const { id: d, version: f } = We().useInfo(), _ = f ? `&app=${d}&version=${f}` : "";
47
+ p ? Le(p + _).then((D) => {
48
+ D && (D.forEach((h) => {
49
+ h.backupTitle = h.message, h.backupTime = e(new Date(h.time));
50
+ }), i.value = D.reverse());
51
+ }) : i.value = [];
365
52
  };
366
53
  return Y(() => {
367
- var u;
368
- const g = ((u = s.currentPageData) == null ? void 0 : u.id) || "";
369
- a(g);
54
+ var d;
55
+ const p = ((d = s.currentPageData) == null ? void 0 : d.id) || "";
56
+ o(p);
370
57
  }), {
371
- list: f,
372
- previewHistory: (g) => {
373
- var u, P;
374
- g && pt({
375
- id: g.page,
376
- history: g.id,
377
- framework: (u = be("engine.config")) == null ? void 0 : u.dslMode,
378
- platform: (P = be("engine.config")) == null ? void 0 : P.platformId
58
+ list: i,
59
+ previewHistory: (p) => {
60
+ var d, f;
61
+ p && pt({
62
+ id: p.page,
63
+ history: p.id,
64
+ framework: (d = Ne("engine.config")) == null ? void 0 : d.dslMode,
65
+ platform: (f = Ne("engine.config")) == null ? void 0 : f.platformId
379
66
  });
380
67
  },
381
- restoreHistory: (g) => {
68
+ restoreHistory: (p) => {
382
69
  m({
383
70
  title: "提示",
384
71
  message: "您即将还原历史页面,是否继续还原?",
385
72
  exec: () => {
386
- t("restorePage", g);
73
+ t("restorePage", p);
387
74
  }
388
75
  });
389
76
  }
390
77
  };
391
78
  }
392
79
  };
393
- function Ut(n, t, s, e, m, f) {
394
- const a = c("block-history-list");
395
- return T(), A(a, {
80
+ function Ot(a, t, s, e, m, i) {
81
+ const o = u("block-history-list");
82
+ return N(), G(o, {
396
83
  history: e.list,
397
84
  onPreview: e.previewHistory,
398
85
  onRestore: e.restoreHistory
399
86
  }, null, 8, ["history", "onPreview", "onRestore"]);
400
87
  }
401
- const Mt = /* @__PURE__ */ K(At, [["render", Ut]]), Ht = {
88
+ const Ft = /* @__PURE__ */ K(Nt, [["render", Ot]]), wt = {
402
89
  components: {
403
- MetaCodeEditor: Qe,
404
- TinyCheckbox: Ee
90
+ MetaCodeEditor: $e,
91
+ TinyCheckbox: Re
405
92
  },
406
93
  setup() {
407
- const n = U(""), t = U(""), { pageSettingState: s } = L(), e = re(() => s.currentPageData);
94
+ const a = U(""), t = U(""), { pageSettingState: s } = L(), e = le(() => s.currentPageData);
408
95
  return Y(() => {
409
- var l, o;
410
- n.value = ((l = s.currentPageData.page_content) == null ? void 0 : l.inputs) || "", t.value = ((o = s.currentPageData.page_content) == null ? void 0 : o.outputs) || "";
96
+ var g, n;
97
+ a.value = ((g = s.currentPageData.page_content) == null ? void 0 : g.inputs) || "", t.value = ((n = s.currentPageData.page_content) == null ? void 0 : n.outputs) || "";
411
98
  }), {
412
- inputValue: n,
99
+ inputValue: a,
413
100
  outputValue: t,
414
- saveInputValue: (l) => {
101
+ saveInputValue: (g) => {
415
102
  try {
416
- const o = JSON.parse(l.content);
417
- n.value = l.content, e.value.page_content.inputs = o;
418
- } catch (o) {
419
- G({
103
+ const n = JSON.parse(g.content);
104
+ a.value = g.content, e.value.page_content.inputs = n;
105
+ } catch (n) {
106
+ x({
420
107
  title: "输入配置保存失败(必须符合JSON格式)",
421
- message: `${(o == null ? void 0 : o.message) || o}`,
108
+ message: `${(n == null ? void 0 : n.message) || n}`,
422
109
  type: "error"
423
110
  });
424
111
  }
425
112
  },
426
- saveOutputValue: (l) => {
113
+ saveOutputValue: (g) => {
427
114
  try {
428
- const o = JSON.parse(l.content);
429
- t.value = l.content, e.value.page_content.outputs = o;
430
- } catch (o) {
431
- G({
115
+ const n = JSON.parse(g.content);
116
+ t.value = g.content, e.value.page_content.outputs = n;
117
+ } catch (n) {
118
+ x({
432
119
  title: "输出配置保存失败(必须符合JSON格式)",
433
- message: `${(o == null ? void 0 : o.message) || o}`,
120
+ message: `${(n == null ? void 0 : n.message) || n}`,
434
121
  type: "error"
435
122
  });
436
123
  }
437
124
  },
438
125
  pageSettingState: s,
439
- hasContent: (l) => Array.isArray(l) && l.length > 0 || typeof l == "object" && Object.keys(l).length > 0
126
+ hasContent: (g) => Array.isArray(g) && g.length > 0 || typeof g == "object" && Object.keys(g).length > 0
440
127
  };
441
128
  }
442
- }, Lt = { class: "input-or-output" };
443
- function Bt(n, t, s, e, m, f) {
444
- const a = c("svg-icon"), l = c("meta-code-editor"), o = c("tiny-checkbox");
445
- return T(), J("div", Lt, [
446
- r(l, {
129
+ }, kt = { class: "input-or-output" };
130
+ function Et(a, t, s, e, m, i) {
131
+ const o = u("svg-icon"), g = u("meta-code-editor"), n = u("tiny-checkbox");
132
+ return N(), J("div", kt, [
133
+ l(g, {
447
134
  modelValue: e.inputValue,
448
135
  title: "输入配置",
449
136
  "button-text": "输入配置",
@@ -453,15 +140,15 @@ function Bt(n, t, s, e, m, f) {
453
140
  onSave: e.saveInputValue
454
141
  }, {
455
142
  icon: y(() => [
456
- r(a, {
143
+ l(o, {
457
144
  class: "edit-btn-icon",
458
145
  name: "to-edit"
459
146
  })
460
147
  ]),
461
148
  _: 1
462
149
  }, 8, ["modelValue", "buttonShowContent", "onSave"]),
463
- t[2] || (t[2] = x("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
464
- r(l, {
150
+ t[2] || (t[2] = V("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
151
+ l(g, {
465
152
  modelValue: e.outputValue,
466
153
  title: "输出配置",
467
154
  "button-text": "输出配置",
@@ -471,54 +158,62 @@ function Bt(n, t, s, e, m, f) {
471
158
  onSave: e.saveOutputValue
472
159
  }, {
473
160
  icon: y(() => [
474
- r(a, {
161
+ l(o, {
475
162
  class: "edit-btn-icon",
476
163
  name: "to-edit"
477
164
  })
478
165
  ]),
479
166
  _: 1
480
167
  }, 8, ["modelValue", "buttonShowContent", "onSave"]),
481
- t[3] || (t[3] = x("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
482
- r(o, {
168
+ t[3] || (t[3] = V("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
169
+ l(n, {
483
170
  class: "selectHome",
484
171
  modelValue: e.pageSettingState.currentPageData.isBody,
485
- "onUpdate:modelValue": t[0] || (t[0] = (g) => e.pageSettingState.currentPageData.isBody = g)
172
+ "onUpdate:modelValue": t[0] || (t[0] = (p) => e.pageSettingState.currentPageData.isBody = p)
486
173
  }, {
487
174
  default: y(() => t[1] || (t[1] = [
488
- x("span", null, "设为根元素为Body", -1)
175
+ V("span", null, "设为根元素为Body", -1)
489
176
  ])),
490
177
  _: 1
491
178
  }, 8, ["modelValue"]),
492
- t[4] || (t[4] = x("div", { class: "input-output-div" }, "默认为div", -1))
179
+ t[4] || (t[4] = V("div", { class: "input-output-div" }, "默认为div", -1))
493
180
  ]);
494
181
  }
495
- const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379"]]), {
496
- COMPONENT_NAME: qt
497
- } = Re, De = U(!1), se = () => {
498
- De.value = !0;
499
- }, q = () => {
500
- De.value = !1;
182
+ const Vt = /* @__PURE__ */ K(wt, [["render", Et], ["__scopeId", "data-v-3b0f8d59"]]), te = {
183
+ id: "engine.plugins.appmanage",
184
+ title: "页面",
185
+ type: "plugins",
186
+ icon: "plugin-icon-page",
187
+ align: "top"
188
+ }, {
189
+ COMPONENT_NAME: xt
190
+ } = Me, Ce = U(!1), re = () => {
191
+ Ce.value = !0;
192
+ }, j = () => {
193
+ Ce.value = !1;
501
194
  const {
502
- resetPageData: n
195
+ resetPageData: a
503
196
  } = L();
504
- n();
505
- }, Oe = {
197
+ a();
198
+ }, we = {
506
199
  general: "general",
507
200
  inputOutput: "inputOutput",
508
201
  lifeCycles: "lifeCycles",
509
202
  history: "history"
510
- }, Jt = {
203
+ }, Be = {
204
+ beforeCreatePage: async () => {
205
+ }
206
+ }, Gt = {
511
207
  components: {
512
- TinyButton: xe,
513
- TinyCollapse: _e,
514
- TinyCollapseItem: ye,
515
- PageInputOutput: jt,
516
- LifeCycles: Ye,
517
- PageGeneral: Ue,
518
- PageHistory: Mt,
519
- PluginSetting: ke,
520
- SvgButton: Pe,
521
- ButtonGroup: we
208
+ TinyButton: Ae,
209
+ TinyCollapse: Se,
210
+ TinyCollapseItem: De,
211
+ PageInputOutput: Vt,
212
+ LifeCycles: et,
213
+ PageHistory: Ft,
214
+ PluginSetting: xe,
215
+ SvgButton: ye,
216
+ ButtonGroup: Ge
522
217
  },
523
218
  props: {
524
219
  isFolder: {
@@ -527,176 +222,177 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
527
222
  }
528
223
  },
529
224
  emits: ["openNewPage"],
530
- setup(n, {
225
+ setup(a, {
531
226
  emit: t
532
227
  }) {
533
228
  const {
534
229
  requestCreatePage: s,
535
230
  requestDeletePage: e
536
- } = ie, {
231
+ } = ge, {
537
232
  appInfoState: m
538
- } = le(), {
539
- DEFAULT_PAGE: f,
540
- pageSettingState: a,
541
- changeTreeData: l,
542
- isCurrentDataSame: o,
543
- initCurrentPageData: g,
544
- isTemporaryPage: u,
545
- STATIC_PAGE_GROUP_ID: P
233
+ } = ce(), {
234
+ DEFAULT_PAGE: i,
235
+ pageSettingState: o,
236
+ changeTreeData: g,
237
+ isCurrentDataSame: n,
238
+ initCurrentPageData: p,
239
+ isTemporaryPage: d,
240
+ STATIC_PAGE_GROUP_ID: f
546
241
  } = L(), {
547
242
  pageState: _,
548
243
  initData: D
549
- } = fe(), {
550
- confirm: S
551
- } = Q(), p = U(null), h = z({
552
- activeName: Object.values(Oe),
244
+ } = _e(), {
245
+ confirm: h
246
+ } = Q(), k = Ve(te.type, te.id).components.PageGeneral, T = U(null), v = W({
247
+ activeName: Object.values(we),
553
248
  title: "页面设置",
554
249
  historyMessage: ""
555
- }), R = () => {
556
- ce(a.currentPageData, a.currentPageDataCopy) ? q() : S({
250
+ }), X = () => {
251
+ ie(o.currentPageData, o.currentPageDataCopy) ? j() : h({
557
252
  title: "提示",
558
253
  message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
559
254
  exec: () => {
560
- a.isNew || (l(a.oldParentId, a.currentPageData.parentId), Object.assign(a.currentPageData, a.currentPageDataCopy)), q();
255
+ o.isNew || (g(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy)), j();
561
256
  }
562
257
  });
563
- }, F = () => {
258
+ }, R = async () => {
564
259
  const {
565
- page_content: v,
260
+ page_content: b,
566
261
  ...C
567
- } = f, {
262
+ } = i, {
568
263
  page_content: I,
569
- ...k
570
- } = a.currentPageData, E = {
264
+ ...r
265
+ } = o.currentPageData, c = {
571
266
  ...C,
572
- ...k,
267
+ ...r,
573
268
  page_content: {
574
- ...v,
269
+ ...b,
575
270
  ...I,
576
- fileName: a.currentPageData.name
271
+ fileName: o.currentPageData.name
577
272
  },
578
273
  app: m.selectedId,
579
274
  isPage: !0
580
275
  };
581
- E.id && (delete E.id, delete E._id), s(E).then((i) => {
582
- a.updateTreeData(), a.isNew = !1, u.saved = !1, t("openNewPage", i), q(), oe().closePlugin(), G({
276
+ c.id && (delete c.id, delete c._id), await Be.beforeCreatePage(c), s(c).then((S) => {
277
+ o.updateTreeData(), o.isNew = !1, d.saved = !1, t("openNewPage", S), j(), se().closePlugin(), x({
583
278
  type: "success",
584
279
  message: "新建页面成功!"
585
- }), Ge && lt(i);
586
- }).catch((i) => {
587
- G({
280
+ }), He && it(S);
281
+ }).catch((S) => {
282
+ x({
588
283
  type: "error",
589
284
  title: "新建页面失败",
590
- message: JSON.stringify((i == null ? void 0 : i.message) || i)
285
+ message: JSON.stringify((S == null ? void 0 : S.message) || S)
591
286
  });
592
287
  });
593
- }, Z = (v, C) => {
594
- const I = a.currentPageDataCopy.route !== a.currentPageData.route;
595
- return st(v, C, I);
596
- }, X = (v) => {
597
- v.id = v.page, ["page", "backupTime", "backupTitle", "time"].forEach((k) => delete v[k]);
288
+ }, q = (b, C) => {
289
+ const I = o.currentPageDataCopy.route !== o.currentPageData.route;
290
+ return ct(b, C, I);
291
+ }, pe = (b) => {
292
+ b.id = b.page, ["page", "backupTime", "backupTitle", "time"].forEach((r) => delete b[r]);
598
293
  const I = {
599
- ...a.currentPageData,
600
- ...v,
294
+ ...o.currentPageData,
295
+ ...b,
601
296
  message: "还原页面"
602
297
  };
603
- Z(v.id, I).then((k) => {
604
- var E;
605
- ((E = _ == null ? void 0 : _.currentPage) == null ? void 0 : E.id) === (k == null ? void 0 : k.id) && D(k.page_content, k);
298
+ q(b.id, I).then((r) => {
299
+ var c;
300
+ ((c = _ == null ? void 0 : _.currentPage) == null ? void 0 : c.id) === (r == null ? void 0 : r.id) && D(r.page_content, r);
606
301
  });
607
- }, W = async () => {
302
+ }, ae = async () => {
608
303
  const {
609
- id: v,
304
+ id: b,
610
305
  name: C,
611
306
  page_content: I
612
- } = a.currentPageData, k = {
613
- ...a.currentPageData,
307
+ } = o.currentPageData, r = {
308
+ ...o.currentPageData,
614
309
  page_content: {
615
310
  ...I,
616
311
  fileName: C
617
312
  }
618
- }, E = await Z(v, k);
619
- g(E);
620
- }, ge = (v) => {
621
- if (!v)
313
+ }, c = await q(b, r);
314
+ p(c);
315
+ }, ue = (b) => {
316
+ if (!b)
622
317
  return;
623
- const C = a.currentPageData.page_content;
318
+ const C = o.currentPageData.page_content;
624
319
  C.lifeCycles = {
625
320
  ...C.lifeCycles || {},
626
- ...v
321
+ ...b
627
322
  };
628
- }, $ = () => {
629
- const v = a.currentPageData, C = ne(!0, {}, v);
630
- a.isNew = !0, C.name = `${C.name}Copy`, C.route = `${C.route}Copy`, a.currentPageData = C, a.currentPageDataCopy = ne(!0, {}, C);
631
- }, pe = () => {
632
- o() ? $() : S({
323
+ }, z = () => {
324
+ const b = o.currentPageData, C = ee(!0, {}, b);
325
+ o.isNew = !0, C.name = `${C.name}Copy`, C.route = `${C.route}Copy`, o.currentPageData = C, o.currentPageDataCopy = ee(!0, {}, C);
326
+ }, de = () => {
327
+ n() ? z() : h({
633
328
  title: "提示",
634
329
  message: "您即将复制的页面有更改未保存,是否确定跳过更改直接复制?",
635
330
  exec: () => {
636
- l(a.oldParentId, a.currentPageData.parentId), Object.assign(a.currentPageData, a.currentPageDataCopy), $();
331
+ g(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy), z();
637
332
  }
638
333
  });
639
- }, ee = () => {
640
- S({
334
+ }, ne = () => {
335
+ h({
641
336
  title: "创建历史备份信息",
642
337
  status: "custom",
643
338
  message: {
644
- render: () => r(Ve, {
339
+ render: () => l(Ue, {
645
340
  placeholder: "历史备份信息",
646
- modelValue: h.historyMessage,
647
- "onUpdate:modelValue": (E) => h.historyMessage = E
341
+ modelValue: v.historyMessage,
342
+ "onUpdate:modelValue": (c) => v.historyMessage = c
648
343
  }, null)
649
344
  },
650
345
  exec: () => {
651
- a.currentPageData.message = h.historyMessage.trim() || "Page auto save", a.isNew ? F() : W(), h.historyMessage = "";
346
+ o.currentPageData.message = v.historyMessage.trim() || "Page auto save", o.isNew ? R() : ae(), v.historyMessage = "";
652
347
  }
653
348
  });
654
- }, ue = () => {
655
- p.value.validGeneralForm().then(ee);
656
- }, te = (v = []) => {
657
- if (!Array.isArray(v))
349
+ }, me = () => {
350
+ T.value.validGeneralForm().then(ne);
351
+ }, oe = (b = []) => {
352
+ if (!Array.isArray(b))
658
353
  return [];
659
354
  const C = [];
660
- return v.forEach((I) => {
661
- var k;
355
+ return b.forEach((I) => {
356
+ var r;
662
357
  if (I != null && I.isPage) {
663
358
  C.push(I);
664
359
  return;
665
360
  }
666
- !(I != null && I.isPage) && ((k = I == null ? void 0 : I.children) != null && k.length) && C.push(...te(I.children));
361
+ !(I != null && I.isPage) && ((r = I == null ? void 0 : I.children) != null && r.length) && C.push(...oe(I.children));
667
362
  }), C;
668
363
  };
669
364
  return {
670
- state: h,
671
- isShow: De,
672
- savePageSetting: ue,
673
- copyPage: pe,
674
- pageSettingState: a,
675
- pageGeneralRef: p,
365
+ state: v,
366
+ isShow: Ce,
367
+ savePageSetting: me,
368
+ copyPage: de,
369
+ pageSettingState: o,
370
+ pageGeneral: k,
371
+ pageGeneralRef: T,
676
372
  deletePage: () => {
677
- S({
373
+ h({
678
374
  title: "提示",
679
375
  message: "您是否要删除页面?",
680
376
  exec: () => {
681
377
  var C;
682
- const v = ((C = a.currentPageData) == null ? void 0 : C.id) || "";
683
- e(v).then(() => {
684
- a.updateTreeData().then((I) => {
685
- var N, O;
686
- if (((N = _ == null ? void 0 : _.currentPage) == null ? void 0 : N.id) !== v)
378
+ const b = ((C = o.currentPageData) == null ? void 0 : C.id) || "";
379
+ e(b).then(() => {
380
+ o.updateTreeData().then((I) => {
381
+ var w, A;
382
+ if (((w = _ == null ? void 0 : _.currentPage) == null ? void 0 : w.id) !== b)
687
383
  return;
688
- const k = ((O = (I || []).find(({
689
- groupId: w
690
- }) => w === P)) == null ? void 0 : O.data) || [], E = te(k), i = E.find((w) => w.isHome), d = E == null ? void 0 : E[0], b = {
691
- componentName: qt.Page
384
+ const r = ((A = (I || []).find(({
385
+ groupId: Z
386
+ }) => Z === f)) == null ? void 0 : A.data) || [], c = oe(r), S = c.find((Z) => Z.isHome), O = c == null ? void 0 : c[0], F = {
387
+ componentName: xt.Page
692
388
  };
693
- t("openNewPage", i || d || b);
694
- }), q(), G({
389
+ t("openNewPage", S || O || F);
390
+ }), j(), x({
695
391
  message: "删除页面成功!",
696
392
  type: "success"
697
393
  });
698
394
  }).catch(() => {
699
- G({
395
+ x({
700
396
  message: "删除页面失败!",
701
397
  type: "error"
702
398
  });
@@ -704,47 +400,47 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
704
400
  }
705
401
  });
706
402
  },
707
- cancelPageSetting: R,
708
- closePageSettingPanel: q,
709
- updatePageLifeCycles: ge,
710
- restorePage: X,
711
- PAGE_SETTING_SESSION: Oe
403
+ cancelPageSetting: X,
404
+ closePageSettingPanel: j,
405
+ updatePageLifeCycles: ue,
406
+ restorePage: pe,
407
+ PAGE_SETTING_SESSION: we
712
408
  };
713
409
  }
714
- }, Kt = { class: "page-setting-content" }, Xt = { class: "life-cycles-container" };
715
- function Wt(n, t, s, e, m, f) {
716
- const a = c("tiny-button"), l = c("svg-button"), o = c("button-group"), g = c("page-general"), u = c("tiny-collapse-item"), P = c("page-input-output"), _ = c("life-cycles"), D = c("page-history"), S = c("tiny-collapse"), p = c("plugin-setting");
717
- return e.isShow ? (T(), A(p, {
410
+ }, Rt = { class: "page-setting-content" }, At = { class: "life-cycles-container" };
411
+ function Ut(a, t, s, e, m, i) {
412
+ const o = u("tiny-button"), g = u("svg-button"), n = u("button-group"), p = u("tiny-collapse-item"), d = u("page-input-output"), f = u("life-cycles"), _ = u("page-history"), D = u("tiny-collapse"), h = u("plugin-setting");
413
+ return e.isShow ? (N(), G(h, {
718
414
  key: 0,
719
415
  title: e.state.title,
720
416
  class: "page-plugin-setting"
721
417
  }, {
722
418
  header: y(() => [
723
- r(o, null, {
419
+ l(n, null, {
724
420
  default: y(() => [
725
- r(a, {
421
+ l(o, {
726
422
  type: "primary",
727
423
  onClick: e.savePageSetting
728
424
  }, {
729
425
  default: y(() => t[1] || (t[1] = [
730
- ae("保存")
426
+ $("保存")
731
427
  ])),
732
428
  _: 1
733
429
  }, 8, ["onClick"]),
734
- e.pageSettingState.isNew ? H("", !0) : (T(), A(l, {
430
+ e.pageSettingState.isNew ? H("", !0) : (N(), G(g, {
735
431
  key: 0,
736
432
  name: "text-copy-page",
737
433
  placement: "bottom",
738
434
  tips: "复制页面",
739
435
  onClick: e.copyPage
740
436
  }, null, 8, ["onClick"])),
741
- e.pageSettingState.isNew ? H("", !0) : (T(), A(l, {
437
+ e.pageSettingState.isNew ? H("", !0) : (N(), G(g, {
742
438
  key: 1,
743
439
  name: "delete",
744
440
  tips: "删除页面",
745
441
  onClick: e.deletePage
746
442
  }, null, 8, ["onClick"])),
747
- r(l, {
443
+ l(g, {
748
444
  class: "close-plugin-setting-icon",
749
445
  name: "close",
750
446
  onClick: e.cancelPageSetting
@@ -754,48 +450,48 @@ function Wt(n, t, s, e, m, f) {
754
450
  })
755
451
  ]),
756
452
  content: y(() => [
757
- x("div", Kt, [
758
- r(S, {
453
+ V("div", Rt, [
454
+ l(D, {
759
455
  modelValue: e.state.activeName,
760
- "onUpdate:modelValue": t[0] || (t[0] = (h) => e.state.activeName = h),
456
+ "onUpdate:modelValue": t[0] || (t[0] = (P) => e.state.activeName = P),
761
457
  class: "page-setting-collapse"
762
458
  }, {
763
459
  default: y(() => [
764
- r(u, {
460
+ l(p, {
765
461
  title: "基本设置",
766
462
  name: e.PAGE_SETTING_SESSION.general
767
463
  }, {
768
464
  default: y(() => [
769
- r(g, {
465
+ (N(), G(Ee(e.pageGeneral), {
770
466
  ref: "pageGeneralRef",
771
467
  isFolder: s.isFolder
772
- }, null, 8, ["isFolder"])
468
+ }, null, 8, ["isFolder"]))
773
469
  ]),
774
470
  _: 1
775
471
  }, 8, ["name"]),
776
- e.pageSettingState.currentPageData.group !== "public" ? (T(), A(u, {
472
+ e.pageSettingState.currentPageData.group !== "public" ? (N(), G(p, {
777
473
  key: 0,
778
474
  class: "base-setting",
779
475
  title: "输入输出",
780
476
  name: e.PAGE_SETTING_SESSION.inputOutput
781
477
  }, {
782
478
  default: y(() => [
783
- r(P)
479
+ l(d)
784
480
  ]),
785
481
  _: 1
786
482
  }, 8, ["name"])) : H("", !0),
787
- e.pageSettingState.currentPageData.group !== "public" ? (T(), A(u, {
483
+ e.pageSettingState.currentPageData.group !== "public" ? (N(), G(p, {
788
484
  key: 1,
789
485
  class: "input-output",
790
486
  title: "页面生命周期配置",
791
487
  name: e.PAGE_SETTING_SESSION.lifeCycles
792
488
  }, {
793
489
  default: y(() => {
794
- var h;
490
+ var P;
795
491
  return [
796
- x("div", Xt, [
797
- r(_, {
798
- bindLifeCycles: (h = e.pageSettingState.currentPageData.page_content) == null ? void 0 : h.lifeCycles,
492
+ V("div", At, [
493
+ l(f, {
494
+ bindLifeCycles: (P = e.pageSettingState.currentPageData.page_content) == null ? void 0 : P.lifeCycles,
799
495
  onUpdatePageLifeCycles: e.updatePageLifeCycles
800
496
  }, null, 8, ["bindLifeCycles", "onUpdatePageLifeCycles"])
801
497
  ])
@@ -803,13 +499,13 @@ function Wt(n, t, s, e, m, f) {
803
499
  }),
804
500
  _: 1
805
501
  }, 8, ["name"])) : H("", !0),
806
- r(u, {
502
+ l(p, {
807
503
  class: "history-source",
808
504
  title: "历史备份",
809
505
  name: e.PAGE_SETTING_SESSION.history
810
506
  }, {
811
507
  default: y(() => [
812
- r(D, { onRestorePage: e.restorePage }, null, 8, ["onRestorePage"])
508
+ l(_, { onRestorePage: e.restorePage }, null, 8, ["onRestorePage"])
813
509
  ]),
814
510
  _: 1
815
511
  }, 8, ["name"])
@@ -821,23 +517,22 @@ function Wt(n, t, s, e, m, f) {
821
517
  _: 1
822
518
  }, 8, ["title"])) : H("", !0);
823
519
  }
824
- const zt = /* @__PURE__ */ K(Jt, [["render", Wt], ["__scopeId", "data-v-988bf056"]]);
825
- let he = U(!1);
826
- const Fe = () => {
827
- he.value = !0;
520
+ const Mt = /* @__PURE__ */ K(Gt, [["render", Ut], ["__scopeId", "data-v-9bebe31b"]]);
521
+ let ve = U(!1);
522
+ const ke = () => {
523
+ ve.value = !0;
828
524
  }, M = () => {
829
- he.value = !1;
830
- const { resetPageData: n } = L();
831
- n();
832
- }, Qt = {
525
+ ve.value = !1;
526
+ const { resetPageData: a } = L();
527
+ a();
528
+ }, Ht = {
833
529
  components: {
834
- TinyButton: xe,
835
- TinyCollapse: _e,
836
- TinyCollapseItem: ye,
837
- PluginSetting: ke,
838
- PageGeneral: Ue,
839
- SvgButton: Pe,
840
- ButtonGroup: we
530
+ TinyButton: Ae,
531
+ TinyCollapse: Se,
532
+ TinyCollapseItem: De,
533
+ PluginSetting: xe,
534
+ SvgButton: ye,
535
+ ButtonGroup: Ge
841
536
  },
842
537
  props: {
843
538
  isFolder: {
@@ -846,122 +541,123 @@ const Fe = () => {
846
541
  }
847
542
  },
848
543
  setup() {
849
- const n = z({
544
+ const a = W({
850
545
  activeName: ["folderGeneralRef"],
851
546
  title: "文件夹设置"
852
- }), t = U(null), { requestCreatePage: s, requestUpdatePage: e, requestDeletePage: m } = ie, { appInfoState: f } = le(), { pageSettingState: a, changeTreeData: l } = L(), { confirm: o } = Q(), g = () => {
853
- ce(a.currentPageData, a.currentPageDataCopy) ? M() : o({
547
+ }), { requestCreatePage: t, requestUpdatePage: s, requestDeletePage: e } = ge, { appInfoState: m } = ce(), { pageSettingState: i, changeTreeData: o } = L(), { confirm: g } = Q(), p = Ve(te.type, te.id).components.PageGeneral, d = U(null), f = () => {
548
+ ie(i.currentPageData, i.currentPageDataCopy) ? M() : g({
854
549
  title: "提示",
855
550
  message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
856
551
  exec: () => {
857
- a.isNew || (l(a.oldParentId, a.currentPageData.parentId), Object.assign(a.currentPageData, a.currentPageDataCopy)), M();
552
+ i.isNew || (o(i.oldParentId, i.currentPageData.parentId), Object.assign(i.currentPageData, i.currentPageDataCopy)), M();
858
553
  }
859
554
  });
860
- }, u = () => {
861
- const p = {
862
- ...a.currentPageData,
863
- app: f.selectedId,
555
+ }, _ = () => {
556
+ const T = {
557
+ ...i.currentPageData,
558
+ app: m.selectedId,
864
559
  isPage: !1
865
560
  };
866
- s(p).then(() => {
867
- a.updateTreeData(), a.isNew = !1, M(), G({
561
+ t(T).then(() => {
562
+ i.updateTreeData(), i.isNew = !1, M(), x({
868
563
  type: "success",
869
564
  message: "新建文件夹成功!"
870
565
  });
871
- }).catch((h) => {
872
- G({
566
+ }).catch((v) => {
567
+ x({
873
568
  type: "error",
874
569
  title: "新建文件夹失败",
875
- message: JSON.stringify((h == null ? void 0 : h.message) || h)
570
+ message: JSON.stringify((v == null ? void 0 : v.message) || v)
876
571
  });
877
572
  });
878
- }, P = () => {
879
- const { id: S } = a.currentPageData;
880
- e(S, { ...a.currentPageData, page_content: null }).then(() => {
881
- a.updateTreeData(), a.isNew = !1, M(), G({
573
+ }, D = () => {
574
+ const { id: k } = i.currentPageData;
575
+ s(k, { ...i.currentPageData, page_content: null }).then(() => {
576
+ i.updateTreeData(), i.isNew = !1, M(), x({
882
577
  type: "success",
883
578
  message: "更新文件夹成功!"
884
579
  });
885
- }).catch((p) => {
886
- G({
580
+ }).catch((T) => {
581
+ x({
887
582
  type: "error",
888
583
  title: "更新文件夹失败",
889
- message: JSON.stringify((p == null ? void 0 : p.message) || p)
584
+ message: JSON.stringify((T == null ? void 0 : T.message) || T)
890
585
  });
891
586
  });
892
587
  };
893
588
  return {
894
589
  saveFolderSetting: () => {
895
- t.value.validGeneralForm().then(() => {
896
- a.isNew ? u() : P();
590
+ d.value.validGeneralForm().then(() => {
591
+ i.isNew ? _() : D();
897
592
  });
898
593
  },
899
- deleteFolder: ut(5e3, !0, () => {
900
- var S, p;
901
- if ((p = (S = a.treeDataMapping[a.currentPageData.id]) == null ? void 0 : S.children) != null && p.length) {
902
- G({
594
+ deleteFolder: dt(5e3, !0, () => {
595
+ var k, T;
596
+ if ((T = (k = i.treeDataMapping[i.currentPageData.id]) == null ? void 0 : k.children) != null && T.length) {
597
+ x({
903
598
  type: "error",
904
599
  message: "此文件夹不是空文件夹,不能删除!"
905
600
  });
906
601
  return;
907
602
  }
908
- o({
603
+ g({
909
604
  title: "提示",
910
605
  message: "您是否要删除文件夹?",
911
606
  exec: () => {
912
- var R;
913
- const h = ((R = a.currentPageData) == null ? void 0 : R.id) || "";
914
- m(h).then(() => {
915
- a.updateTreeData(), M(), G({
607
+ var X;
608
+ const v = ((X = i.currentPageData) == null ? void 0 : X.id) || "";
609
+ e(v).then(() => {
610
+ i.updateTreeData(), M(), x({
916
611
  type: "success",
917
612
  message: "删除文件夹成功!"
918
613
  });
919
- }).catch((F) => {
920
- G({
614
+ }).catch((R) => {
615
+ x({
921
616
  type: "success",
922
617
  title: "删除文件夹失败!",
923
- message: JSON.stringify((F == null ? void 0 : F.message) || F)
618
+ message: JSON.stringify((R == null ? void 0 : R.message) || R)
924
619
  });
925
620
  });
926
621
  }
927
622
  });
928
623
  }),
929
- folderGeneralRef: t,
624
+ pageGeneral: p,
625
+ folderGeneralRef: d,
930
626
  closeFolderSettingPanel: M,
931
- isShow: he,
932
- state: n,
933
- pageSettingState: a,
934
- closeFolderSetting: g
627
+ isShow: ve,
628
+ state: a,
629
+ pageSettingState: i,
630
+ closeFolderSetting: f
935
631
  };
936
632
  }
937
- }, Yt = { class: "page-setting-content" };
938
- function Zt(n, t, s, e, m, f) {
939
- const a = c("tiny-button"), l = c("svg-button"), o = c("button-group"), g = c("page-general"), u = c("tiny-collapse-item"), P = c("tiny-collapse"), _ = c("plugin-setting");
940
- return e.isShow ? (T(), A(_, {
633
+ }, Lt = { class: "page-setting-content" };
634
+ function Bt(a, t, s, e, m, i) {
635
+ const o = u("tiny-button"), g = u("svg-button"), n = u("button-group"), p = u("tiny-collapse-item"), d = u("tiny-collapse"), f = u("plugin-setting");
636
+ return e.isShow ? (N(), G(f, {
941
637
  key: 0,
942
638
  title: e.state.title,
943
639
  class: "pageFolder-plugin-setting"
944
640
  }, {
945
641
  header: y(() => [
946
- r(o, null, {
642
+ l(n, null, {
947
643
  default: y(() => [
948
- r(a, {
644
+ l(o, {
949
645
  type: "primary",
950
646
  onClick: e.saveFolderSetting
951
647
  }, {
952
648
  default: y(() => t[1] || (t[1] = [
953
- ae("保存")
649
+ $("保存")
954
650
  ])),
955
651
  _: 1
956
652
  }, 8, ["onClick"]),
957
- e.pageSettingState.isNew ? H("", !0) : (T(), A(l, {
653
+ e.pageSettingState.isNew ? H("", !0) : (N(), G(g, {
958
654
  key: 0,
959
655
  name: "delete",
960
656
  placement: "bottom",
961
657
  tips: "删除",
962
658
  onClick: e.deleteFolder
963
659
  }, null, 8, ["onClick"])),
964
- r(l, {
660
+ l(g, {
965
661
  class: "close-plugin-setting-icon",
966
662
  name: "close",
967
663
  onClick: e.closeFolderSetting
@@ -971,21 +667,21 @@ function Zt(n, t, s, e, m, f) {
971
667
  })
972
668
  ]),
973
669
  content: y(() => [
974
- x("div", Yt, [
975
- r(P, {
670
+ V("div", Lt, [
671
+ l(d, {
976
672
  modelValue: e.state.activeName,
977
- "onUpdate:modelValue": t[0] || (t[0] = (D) => e.state.activeName = D)
673
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => e.state.activeName = _)
978
674
  }, {
979
675
  default: y(() => [
980
- r(u, {
676
+ l(p, {
981
677
  title: "基本设置",
982
678
  name: "folderGeneralRef"
983
679
  }, {
984
680
  default: y(() => [
985
- r(g, {
681
+ (N(), G(Ee(e.pageGeneral), {
986
682
  ref: "folderGeneralRef",
987
683
  isFolder: s.isFolder
988
- }, null, 8, ["isFolder"])
684
+ }, null, 8, ["isFolder"]))
989
685
  ]),
990
686
  _: 1
991
687
  })
@@ -997,17 +693,17 @@ function Zt(n, t, s, e, m, f) {
997
693
  _: 1
998
694
  }, 8, ["title"])) : H("", !0);
999
695
  }
1000
- const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512"]]), {
1001
- ELEMENT_TAG: ea,
1002
- PAGE_STATUS: ta,
1003
- COMPONENT_NAME: aa
1004
- } = Re, na = {
696
+ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-970f6c12"]]), {
697
+ ELEMENT_TAG: qt,
698
+ PAGE_STATUS: Jt,
699
+ COMPONENT_NAME: Kt
700
+ } = Me, Xt = {
1005
701
  components: {
1006
- TinySearch: nt,
1007
- TinyTree: ot,
1008
- TinyCollapse: _e,
1009
- TinyCollapseItem: ye,
1010
- TinyIconSearch: dt()
702
+ TinySearch: at,
703
+ TinyTree: nt,
704
+ TinyCollapse: Se,
705
+ TinyCollapseItem: De,
706
+ TinyIconSearch: mt()
1011
707
  },
1012
708
  props: {
1013
709
  isFolder: {
@@ -1016,247 +712,247 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1016
712
  }
1017
713
  },
1018
714
  emits: ["openSettingPanel", "add"],
1019
- setup(n, {
715
+ setup(a, {
1020
716
  emit: t
1021
717
  }) {
1022
718
  const {
1023
719
  appInfoState: s
1024
- } = le(), {
720
+ } = ce(), {
1025
721
  confirm: e
1026
722
  } = Q(), {
1027
723
  initData: m,
1028
- pageState: f,
1029
- isBlock: a,
1030
- isSaved: l
1031
- } = fe(), {
1032
- pageSettingState: o,
1033
- changeTreeData: g,
1034
- isCurrentDataSame: u,
1035
- STATIC_PAGE_GROUP_ID: P,
724
+ pageState: i,
725
+ isBlock: o,
726
+ isSaved: g
727
+ } = _e(), {
728
+ pageSettingState: n,
729
+ changeTreeData: p,
730
+ isCurrentDataSame: d,
731
+ STATIC_PAGE_GROUP_ID: f,
1036
732
  COMMON_PAGE_GROUP_ID: _
1037
733
  } = L(), {
1038
734
  fetchPageList: D,
1039
- fetchPageDetail: S
1040
- } = ie, {
1041
- setBreadcrumbPage: p
1042
- } = Ke(), h = U([]), R = o.ROOT_ID, F = z({
735
+ fetchPageDetail: h
736
+ } = ge, {
737
+ setBreadcrumbPage: P
738
+ } = ze(), k = U([]), T = n.ROOT_ID, v = W({
1043
739
  pageSearchValue: "",
1044
- collapseValue: [P, _],
740
+ collapseValue: [f, _],
1045
741
  currentNodeData: {}
1046
- }), Z = (i, d, b) => {
1047
- const N = {
1048
- [R]: {
1049
- id: R,
742
+ }), X = (r, c, S) => {
743
+ const O = {
744
+ [T]: {
745
+ id: T,
1050
746
  name: "站点根目录",
1051
747
  children: []
1052
748
  }
1053
749
  };
1054
- return i.forEach((O) => {
1055
- N[O[b]] = O, O.parentId === R && N[R].children.push(O);
1056
- }), i.forEach((O) => {
1057
- let w = N[O[d]];
1058
- w && w.id !== R ? (w.children = w.children || [], w.children.push(O)) : w && w.id;
1059
- }), o.treeDataMapping = N, o.treeDataMapping;
1060
- }, X = (i) => {
1061
- Array.isArray(h == null ? void 0 : h.value) && Le(() => {
1062
- h.value.forEach((d) => {
1063
- d == null || d.filter(i);
750
+ return r.forEach((F) => {
751
+ O[F[S]] = F, F.parentId === T && O[T].children.push(F);
752
+ }), r.forEach((F) => {
753
+ let w = O[F[c]];
754
+ w && w.id !== T ? (w.children = w.children || [], w.children.push(F)) : w && w.id;
755
+ }), n.treeDataMapping = O, n.treeDataMapping;
756
+ }, R = (r) => {
757
+ Array.isArray(k == null ? void 0 : k.value) && je(() => {
758
+ k.value.forEach((c) => {
759
+ c == null || c.filter(r);
1064
760
  });
1065
761
  });
1066
- }, W = async (i, d) => {
1067
- const b = d || await D(i), N = {
762
+ }, q = async (r, c) => {
763
+ const S = c || await D(r), O = {
1068
764
  groupName: "静态页面",
1069
- groupId: P,
765
+ groupId: f,
1070
766
  data: []
1071
- }, O = {
767
+ }, F = {
1072
768
  groupName: "公共页面",
1073
769
  groupId: _,
1074
770
  data: []
1075
771
  };
1076
- b.forEach((j) => {
1077
- const Me = j.name ? j : {
1078
- ...j,
1079
- name: j.folderName,
772
+ S.forEach((A) => {
773
+ const Z = A.name ? A : {
774
+ ...A,
775
+ name: A.folderName,
1080
776
  group: "staticPages"
1081
- }, ve = j.meta ? {
1082
- ...j,
1083
- ...j.meta,
1084
- name: j.fileName,
777
+ }, Ie = A.meta ? {
778
+ ...A,
779
+ ...A.meta,
780
+ name: A.fileName,
1085
781
  isPage: !0,
1086
- isBody: j.meta.rootElement === ea.Body
1087
- } : Me, {
1088
- children: Na,
1089
- ...Ie
1090
- } = ve;
1091
- ve.group === "staticPages" ? N.data.push(Ie) : O.data.push(Ie);
782
+ isBody: A.meta.rootElement === qt.Body
783
+ } : Z, {
784
+ children: wa,
785
+ ...Te
786
+ } = Ie;
787
+ Ie.group === "staticPages" ? O.data.push(Te) : F.data.push(Te);
1092
788
  });
1093
- const w = Z([...N.data], "parentId", "id");
1094
- return N.data = w[R].children, o.pages = [N, O], X(F.pageSearchValue), o.pages;
789
+ const w = X([...O.data], "parentId", "id");
790
+ return O.data = w[T].children, n.pages = [O, F], R(v.pageSearchValue), n.pages;
1095
791
  };
1096
- o.updateTreeData = async () => await W(s.selectedId);
1097
- const ge = () => {
1098
- f.currentVm = null, f.hoverVm = null, f.properties = {}, f.pageSchema = null;
1099
- }, $ = (i) => {
1100
- const d = new URL(window.location);
1101
- d.searchParams.delete("blockid"), d.searchParams.set("pageid", i), window.history.pushState({}, "", d);
1102
- }, pe = (i) => {
1103
- if (i !== 0 && !i) {
1104
- $(""), m({
1105
- componentName: aa.Page
1106
- }, {}), oe().layoutState.pageStatus = {
792
+ n.updateTreeData = async () => await q(s.selectedId);
793
+ const pe = () => {
794
+ i.currentVm = null, i.hoverVm = null, i.properties = {}, i.pageSchema = null;
795
+ }, ae = (r) => {
796
+ const c = new URL(window.location);
797
+ c.searchParams.delete("blockid"), c.searchParams.set("pageid", r), window.history.pushState({}, "", c);
798
+ }, ue = (r) => {
799
+ if (r !== 0 && !r) {
800
+ ae(""), m({
801
+ componentName: Kt.Page
802
+ }, {}), se().layoutState.pageStatus = {
1107
803
  state: "empty",
1108
804
  data: {}
1109
805
  };
1110
806
  return;
1111
807
  }
1112
- S(i).then((d) => {
1113
- $(i), q(), M(), oe().closePlugin(), oe().layoutState.pageStatus = Te(d.occupier), m(d.page_content, d);
808
+ h(r).then((c) => {
809
+ ae(r), j(), M(), se().closePlugin(), se().layoutState.pageStatus = Oe(c.occupier), m(c.page_content, c);
1114
810
  });
1115
- }, ee = (i) => {
1116
- f.hoverVm = null, F.currentNodeData = i;
1117
- let d = "";
1118
- i.isPage && (d = (i == null ? void 0 : i.name) || ""), p([d]), ge(), pe(i.id);
1119
- }, ue = (i, d) => {
1120
- var O;
1121
- i.stopPropagation();
811
+ }, z = (r) => {
812
+ i.hoverVm = null, v.currentNodeData = r;
813
+ let c = "";
814
+ r.isPage && (c = (r == null ? void 0 : r.name) || ""), P([c]), pe(), ue(r.id);
815
+ }, de = (r, c) => {
816
+ var F;
817
+ r.stopPropagation();
1122
818
  const {
1123
- id: b,
1124
- isPage: N
1125
- } = d.data;
1126
- !a() && b === ((O = F == null ? void 0 : F.currentNodeData) == null ? void 0 : O.id) || !N || (l() && u() ? ee(d.data) : e({
819
+ id: S,
820
+ isPage: O
821
+ } = c.data;
822
+ !o() && S === ((F = v == null ? void 0 : v.currentNodeData) == null ? void 0 : F.id) || !O || (g() && d() ? z(c.data) : e({
1127
823
  title: "提示",
1128
- message: `${a() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
824
+ message: `${o() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
1129
825
  exec: () => {
1130
- g(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy), ee(d.data);
826
+ p(n.oldParentId, n.currentPageData.parentId), Object.assign(n.currentPageData, n.currentPageDataCopy), z(c.data);
1131
827
  }
1132
828
  }));
1133
- }, te = (i, d, b) => {
1134
- var N;
1135
- if (i.stopPropagation(), b && d.data.isPage) {
1136
- const O = ((N = d.data.occupier) == null ? void 0 : N.username) || "";
829
+ }, ne = (r, c, S) => {
830
+ var O;
831
+ if (r.stopPropagation(), S && c.data.isPage) {
832
+ const F = ((O = c.data.occupier) == null ? void 0 : O.username) || "";
1137
833
  Q().message({
1138
- message: `您点击的页面被${O}锁定,暂时无法编辑,请联系解锁`,
834
+ message: `您点击的页面被${F}锁定,暂时无法编辑,请联系解锁`,
1139
835
  status: "info"
1140
836
  });
1141
837
  return;
1142
838
  }
1143
- ce(o.currentPageData, o.currentPageDataCopy) ? t("openSettingPanel", d) : e({
839
+ ie(n.currentPageData, n.currentPageDataCopy) ? t("openSettingPanel", c) : e({
1144
840
  title: "提示",
1145
- message: `当前页面或文件夹${o.currentPageData.name}尚未保存,是否要继续切换?`,
841
+ message: `当前页面或文件夹${n.currentPageData.name}尚未保存,是否要继续切换?`,
1146
842
  exec: () => {
1147
- g(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy), t("openSettingPanel", d);
843
+ p(n.oldParentId, n.currentPageData.parentId), Object.assign(n.currentPageData, n.currentPageDataCopy), t("openSettingPanel", c);
1148
844
  }
1149
845
  });
1150
- }, Ce = (i, {
1151
- node: d,
1152
- data: b
846
+ }, me = (r, {
847
+ node: c,
848
+ data: S
1153
849
  }) => {
1154
- !b.isPage && !b.children ? b.trueFolder = !0 : b.trueFolder = !1;
1155
- const N = Te(b.occupier).state === ta.Lock, O = N ? r(c("SvgIcon"), {
850
+ !S.isPage && !S.children ? S.trueFolder = !0 : S.trueFolder = !1;
851
+ const O = Oe(S.occupier).state === Jt.Lock, F = O ? l(u("SvgIcon"), {
1156
852
  class: "page-edit-icon",
1157
853
  name: "locked-outline",
1158
- onMousedown: (w) => te(w, d, N)
854
+ onMousedown: (w) => ne(w, c, O)
1159
855
  }, null) : null;
1160
- return r("span", {
856
+ return l("span", {
1161
857
  class: "tiny-tree-node__label",
1162
- onMousedown: (w) => ue(w, d)
1163
- }, [r("span", {
858
+ onMousedown: (w) => de(w, c)
859
+ }, [l("span", {
1164
860
  class: "page-name-label",
1165
- title: d.label
1166
- }, [b.isPage ? r(c("SvgIcon"), {
861
+ title: c.label
862
+ }, [S.isPage ? l(u("SvgIcon"), {
1167
863
  name: "text-page-common",
1168
864
  class: "icon-page"
1169
- }, null) : null, b.trueFolder ? r(c("SvgIcon"), {
865
+ }, null) : null, S.trueFolder ? l(u("SvgIcon"), {
1170
866
  name: "text-page-folder-closed",
1171
867
  class: "folder-icon"
1172
- }, null) : null, r("span", {
868
+ }, null) : null, l("span", {
1173
869
  class: "label"
1174
- }, [d.label])]), r("span", {
870
+ }, [c.label])]), l("span", {
1175
871
  class: "icons"
1176
- }, [b.isPage ? O : null, b.isHome ? r("span", {
872
+ }, [S.isPage ? F : null, S.isHome ? l("span", {
1177
873
  class: "home"
1178
- }, [r(c("SvgIcon"), {
874
+ }, [l(u("SvgIcon"), {
1179
875
  class: "page-edit-icon",
1180
876
  name: "text-page-home"
1181
- }, null)]) : null, r(c("SvgIcon"), {
877
+ }, null)]) : null, l(u("SvgIcon"), {
1182
878
  name: "setting",
1183
879
  class: "setting page-edit-icon",
1184
- onMousedown: (w) => te(w, d, N)
880
+ onMousedown: (w) => ne(w, c, O)
1185
881
  }, null)])]);
1186
882
  };
1187
883
  Y(() => {
1188
- s.selectedId && W(s.selectedId);
884
+ s.selectedId && q(s.selectedId);
1189
885
  });
1190
- const v = (i, d) => {
1191
- var b;
1192
- return i ? ((b = d.name) == null ? void 0 : b.toLowerCase().indexOf(i == null ? void 0 : i.toLowerCase())) !== -1 : !0;
1193
- }, C = (i) => {
1194
- i && h.value.push(i);
1195
- }, I = (i) => {
1196
- i.stopPropagation(), i.preventDefault(), t("add");
1197
- }, k = r(c("SvgIcon"), {
886
+ const oe = (r, c) => {
887
+ var S;
888
+ return r ? ((S = c.name) == null ? void 0 : S.toLowerCase().indexOf(r == null ? void 0 : r.toLowerCase())) !== -1 : !0;
889
+ }, be = (r) => {
890
+ r && k.value.push(r);
891
+ }, b = (r) => {
892
+ r.stopPropagation(), r.preventDefault(), t("add");
893
+ }, C = l(u("SvgIcon"), {
1198
894
  name: "text-page-folder-closed",
1199
895
  class: "folder-icon"
1200
- }, null), E = r(c("SvgIcon"), {
896
+ }, null), I = l(u("SvgIcon"), {
1201
897
  name: "text-page-folder",
1202
898
  class: "folder-icon"
1203
899
  }, null);
1204
900
  return {
1205
- createPublicPage: I,
1206
- state: F,
1207
- switchPage: ee,
1208
- pageSettingState: o,
1209
- searchPageData: X,
1210
- renderContent: Ce,
1211
- refreshPageList: W,
1212
- filterPageTreeData: v,
1213
- getPageTreeRefs: C,
1214
- IconFolderOpened: mt(),
901
+ createPublicPage: b,
902
+ state: v,
903
+ switchPage: z,
904
+ pageSettingState: n,
905
+ searchPageData: R,
906
+ renderContent: me,
907
+ refreshPageList: q,
908
+ filterPageTreeData: oe,
909
+ getPageTreeRefs: be,
910
+ IconFolderOpened: Pt(),
1215
911
  IconFolderClosed: ft(),
1216
- shrinkIcon: E,
1217
- expandIcon: k
912
+ shrinkIcon: I,
913
+ expandIcon: C
1218
914
  };
1219
915
  }
1220
- }, oa = { class: "app-manage-search" }, sa = { class: "title" }, ra = { class: "app-manage-tree" };
1221
- function la(n, t, s, e, m, f) {
1222
- const a = c("tiny-icon-search"), l = c("tiny-search"), o = c("tiny-tree"), g = c("tiny-collapse-item"), u = c("tiny-collapse");
1223
- return T(), J(de, null, [
1224
- x("div", oa, [
1225
- r(l, {
916
+ }, Wt = { class: "app-manage-search" }, zt = { class: "title" }, Qt = { class: "app-manage-tree" };
917
+ function Yt(a, t, s, e, m, i) {
918
+ const o = u("tiny-icon-search"), g = u("tiny-search"), n = u("tiny-tree"), p = u("tiny-collapse-item"), d = u("tiny-collapse");
919
+ return N(), J(Pe, null, [
920
+ V("div", Wt, [
921
+ l(g, {
1226
922
  modelValue: e.state.pageSearchValue,
1227
923
  "onUpdate:modelValue": [
1228
- t[0] || (t[0] = (P) => e.state.pageSearchValue = P),
924
+ t[0] || (t[0] = (f) => e.state.pageSearchValue = f),
1229
925
  e.searchPageData
1230
926
  ],
1231
927
  clearable: "",
1232
928
  placeholder: "搜索"
1233
929
  }, {
1234
930
  prefix: y(() => [
1235
- r(a)
931
+ l(o)
1236
932
  ]),
1237
933
  _: 1
1238
934
  }, 8, ["modelValue", "onUpdate:modelValue"])
1239
935
  ]),
1240
- r(u, {
936
+ l(d, {
1241
937
  modelValue: e.state.collapseValue,
1242
- "onUpdate:modelValue": t[1] || (t[1] = (P) => e.state.collapseValue = P),
938
+ "onUpdate:modelValue": t[1] || (t[1] = (f) => e.state.collapseValue = f),
1243
939
  class: "page-manage-collapse lowcode-scrollbar"
1244
940
  }, {
1245
941
  default: y(() => [
1246
- (T(!0), J(de, null, Be(e.pageSettingState.pages, (P, _) => (T(), A(g, {
942
+ (N(!0), J(Pe, null, qe(e.pageSettingState.pages, (f, _) => (N(), G(p, {
1247
943
  key: _,
1248
- name: P.groupId
944
+ name: f.groupId
1249
945
  }, {
1250
946
  title: y(() => [
1251
- x("span", sa, me(P.groupName), 1)
947
+ V("span", zt, fe(f.groupName), 1)
1252
948
  ]),
1253
949
  default: y(() => [
1254
- x("div", ra, [
1255
- (T(), A(o, {
950
+ V("div", Qt, [
951
+ (N(), G(n, {
1256
952
  ref_for: !0,
1257
953
  ref: e.getPageTreeRefs,
1258
954
  key: e.pageSettingState.pageTreeKey,
1259
- data: P.data,
955
+ data: f.data,
1260
956
  props: {
1261
957
  children: "children",
1262
958
  label: "name"
@@ -1278,19 +974,19 @@ function la(n, t, s, e, m, f) {
1278
974
  }, 8, ["modelValue"])
1279
975
  ], 64);
1280
976
  }
1281
- const ca = /* @__PURE__ */ K(na, [["render", la], ["__scopeId", "data-v-796a5e7e"]]), ia = {
1282
- getPageById: async (n) => {
1283
- if (n)
1284
- return Se(n);
977
+ const Zt = /* @__PURE__ */ K(Xt, [["render", Yt], ["__scopeId", "data-v-325c92cd"]]), $t = {
978
+ getPageById: async (a) => {
979
+ if (a)
980
+ return he(a);
1285
981
  },
1286
- openPageSettingPanel: se
1287
- }, ga = {
982
+ openPageSettingPanel: re
983
+ }, ea = {
1288
984
  components: {
1289
- PageSetting: zt,
1290
- PluginPanel: Ze,
1291
- SvgButton: Pe,
1292
- PageFolderSetting: $t,
1293
- PageTree: ca
985
+ PageSetting: Mt,
986
+ PluginPanel: tt,
987
+ SvgButton: ye,
988
+ PageFolderSetting: jt,
989
+ PageTree: Zt
1294
990
  },
1295
991
  props: {
1296
992
  title: {
@@ -1300,114 +996,108 @@ const ca = /* @__PURE__ */ K(na, [["render", la], ["__scopeId", "data-v-796a5e7e
1300
996
  },
1301
997
  setup() {
1302
998
  const {
1303
- appInfoState: n
1304
- } = le(), {
999
+ appInfoState: a
1000
+ } = ce(), {
1305
1001
  pageState: t
1306
- } = fe(), {
1002
+ } = _e(), {
1307
1003
  pageSettingState: s,
1308
1004
  DEFAULT_PAGE: e,
1309
1005
  isTemporaryPage: m,
1310
- initCurrentPageData: f
1311
- } = L(), a = U(null), l = s.ROOT_ID, o = Xe().getDocsUrl("page"), g = z({
1006
+ initCurrentPageData: i
1007
+ } = L(), o = U(null), g = s.ROOT_ID, n = Qe().getDocsUrl("page"), p = W({
1312
1008
  isFolder: !1
1313
- }), u = (p) => {
1009
+ }), d = (P) => {
1314
1010
  M(), s.isNew = !0, s.currentPageData = {
1315
1011
  ...e,
1316
- parentId: l,
1012
+ parentId: g,
1317
1013
  route: "",
1318
1014
  name: "Untitled",
1319
1015
  page_content: {
1320
1016
  lifeCycles: {}
1321
1017
  },
1322
- group: p
1323
- }, s.currentPageDataCopy = ne(!0, {}, s.currentPageData), g.isFolder = !1, se();
1324
- }, P = () => {
1325
- q(), s.isNew = !0, s.currentPageData = {
1326
- parentId: l,
1018
+ group: P
1019
+ }, s.currentPageDataCopy = ee(!0, {}, s.currentPageData), p.isFolder = !1, re();
1020
+ }, f = () => {
1021
+ j(), s.isNew = !0, s.currentPageData = {
1022
+ parentId: g,
1327
1023
  route: "",
1328
1024
  name: "untitled"
1329
- }, s.currentPageDataCopy = ne(!0, {}, s.currentPageData), g.isFolder = !0, Fe();
1025
+ }, s.currentPageDataCopy = ee(!0, {}, s.currentPageData), p.isFolder = !0, ke();
1330
1026
  };
1331
1027
  Y(() => {
1332
- m.saved && se();
1028
+ m.saved && re();
1333
1029
  });
1334
- const _ = async (p) => {
1335
- var F;
1336
- g.isFolder = !p.data.isPage, s.isNew = !1;
1337
- const h = p.data.id !== s.currentPageData.id;
1338
- g.isFolder ? (h && q(), Fe()) : (h && M(), se());
1339
- const R = await Se((F = p.data) == null ? void 0 : F.id);
1340
- f(R);
1030
+ const _ = async (P) => {
1031
+ var v;
1032
+ p.isFolder = !P.data.isPage, s.isNew = !1;
1033
+ const k = P.data.id !== s.currentPageData.id;
1034
+ p.isFolder ? (k && j(), ke()) : (k && M(), re());
1035
+ const T = await he((v = P.data) == null ? void 0 : v.id);
1036
+ i(T);
1341
1037
  };
1342
- return je("openSettingPanel", _), {
1343
- state: g,
1344
- appInfoState: n,
1038
+ return Je("openSettingPanel", _), {
1039
+ state: p,
1040
+ appInfoState: a,
1345
1041
  pageState: t,
1346
- openNewPage: (p) => {
1347
- a.value.switchPage(p);
1042
+ openNewPage: (P) => {
1043
+ o.value.switchPage(P);
1348
1044
  },
1349
- pageTreeRef: a,
1045
+ pageTreeRef: o,
1350
1046
  pluginPanelClosed: () => {
1351
- q(), M();
1047
+ j(), M();
1352
1048
  },
1353
1049
  openSettingPanel: _,
1354
- createNewFolder: P,
1355
- createNewPage: u,
1356
- docsUrl: o
1050
+ createNewFolder: f,
1051
+ createNewPage: d,
1052
+ docsUrl: n
1357
1053
  };
1358
1054
  }
1359
1055
  };
1360
- function pa(n, t, s, e, m, f) {
1361
- const a = c("svg-button"), l = c("page-tree"), o = c("plugin-panel"), g = c("page-setting"), u = c("page-folder-setting");
1362
- return T(), J(de, null, [
1363
- r(o, {
1056
+ function ta(a, t, s, e, m, i) {
1057
+ const o = u("svg-button"), g = u("page-tree"), n = u("plugin-panel"), p = u("page-setting"), d = u("page-folder-setting");
1058
+ return N(), J(Pe, null, [
1059
+ l(n, {
1364
1060
  title: s.title,
1365
1061
  onClose: e.pluginPanelClosed,
1366
1062
  docsUrl: e.docsUrl,
1367
1063
  isShowDocsIcon: !0
1368
1064
  }, {
1369
1065
  header: y(() => [
1370
- r(a, {
1066
+ l(o, {
1371
1067
  class: "add-folder-icon",
1372
1068
  name: "add-folder",
1373
1069
  placement: "bottom",
1374
1070
  tips: "新建文件夹",
1375
1071
  onClick: e.createNewFolder
1376
1072
  }, null, 8, ["onClick"]),
1377
- r(a, {
1073
+ l(o, {
1378
1074
  class: "new-page-icon",
1379
1075
  name: "new-page",
1380
1076
  placement: "bottom",
1381
1077
  tips: "新建页面",
1382
- onClick: t[0] || (t[0] = (P) => e.createNewPage("staticPages"))
1078
+ onClick: t[0] || (t[0] = (f) => e.createNewPage("staticPages"))
1383
1079
  })
1384
1080
  ]),
1385
1081
  content: y(() => [
1386
- r(l, {
1082
+ l(g, {
1387
1083
  ref: "pageTreeRef",
1388
1084
  isFolder: e.state.isFolder,
1389
- onAdd: t[1] || (t[1] = (P) => e.createNewPage("publicPages")),
1085
+ onAdd: t[1] || (t[1] = (f) => e.createNewPage("publicPages")),
1390
1086
  onOpenSettingPanel: e.openSettingPanel
1391
1087
  }, null, 8, ["isFolder", "onOpenSettingPanel"])
1392
1088
  ]),
1393
1089
  _: 1
1394
1090
  }, 8, ["title", "onClose", "docsUrl"]),
1395
- r(g, {
1091
+ l(p, {
1396
1092
  isFolder: e.state.isFolder,
1397
1093
  onOpenNewPage: e.openNewPage
1398
1094
  }, null, 8, ["isFolder", "onOpenNewPage"]),
1399
- r(u, {
1095
+ l(d, {
1400
1096
  isFolder: e.state.isFolder
1401
1097
  }, null, 8, ["isFolder"])
1402
1098
  ], 64);
1403
1099
  }
1404
- const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f"]]), da = {
1405
- id: "engine.plugins.appmanage",
1406
- title: "页面",
1407
- type: "plugins",
1408
- icon: "plugin-icon-page",
1409
- align: "top"
1410
- }, ma = {
1100
+ const aa = /* @__PURE__ */ K(ea, [["render", ta], ["__scopeId", "data-v-2ede4a2b"]]), na = {
1411
1101
  app: "",
1412
1102
  name: "",
1413
1103
  route: "",
@@ -1431,7 +1121,7 @@ const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f
1431
1121
  parentId: "none",
1432
1122
  isBody: !1,
1433
1123
  group: "staticPages"
1434
- }, V = z({
1124
+ }, oa = U(null), E = W({
1435
1125
  currentPageDataCopy: {},
1436
1126
  // 记录当前页最开始的状态,当用户点击取消按钮的时候恢复到初始状态
1437
1127
  currentPageData: {},
@@ -1444,10 +1134,10 @@ const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f
1444
1134
  // 根节点ID
1445
1135
  updateTreeData: null,
1446
1136
  treeDataMapping: {}
1447
- }), fa = z({
1137
+ }), sa = W({
1448
1138
  saved: !1
1449
- }), Pa = () => {
1450
- const n = V.currentPageData || {}, t = V.currentPageDataCopy || {};
1139
+ }), ra = () => {
1140
+ const a = E.currentPageData || {}, t = E.currentPageDataCopy || {};
1451
1141
  let s = !0;
1452
1142
  return Object.keys(t).some((e) => {
1453
1143
  if (["children", "label", "createdBy", "assets", "occupier"].includes(e))
@@ -1457,52 +1147,369 @@ const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f
1457
1147
  inputs: t[e].inputs,
1458
1148
  outputs: t[e].outputs,
1459
1149
  lifeCycles: t[e].lifeCycles
1460
- }, f = {
1461
- inputs: n[e].inputs,
1462
- outputs: n[e].outputs,
1463
- lifeCycles: n[e].lifeCycles
1150
+ }, i = {
1151
+ inputs: a[e].inputs,
1152
+ outputs: a[e].outputs,
1153
+ lifeCycles: a[e].lifeCycles
1464
1154
  };
1465
- JSON.stringify(m) !== JSON.stringify(f) && (s = !1);
1155
+ JSON.stringify(m) !== JSON.stringify(i) && (s = !1);
1466
1156
  } else
1467
- t[e] !== n[e] && (s = !1);
1157
+ t[e] !== a[e] && (s = !1);
1468
1158
  return !s;
1469
1159
  }), s;
1470
- }, _a = (n, t) => {
1160
+ }, la = (a, t) => {
1471
1161
  var s, e;
1472
- if (n && t && n !== t) {
1473
- const m = V.treeDataMapping[n], f = V.treeDataMapping[t], a = V.currentPageData.id, l = (e = (s = f.children) == null ? void 0 : s.findIndex) == null ? void 0 : e.call(s, ({ id: o }) => o === a);
1474
- l > -1 && (f.children.splice(l, 1), m.children || (m.children = []), m.children.unshift(V.currentPageData), V.pageTreeKey++);
1162
+ if (a && t && a !== t) {
1163
+ const m = E.treeDataMapping[a], i = E.treeDataMapping[t], o = E.currentPageData.id, g = (e = (s = i.children) == null ? void 0 : s.findIndex) == null ? void 0 : e.call(s, ({ id: n }) => n === o);
1164
+ g > -1 && (i.children.splice(g, 1), m.children || (m.children = []), m.children.unshift(E.currentPageData), E.pageTreeKey++);
1475
1165
  }
1476
- }, ya = () => V.currentPageData.page_content || {}, Sa = (n) => {
1477
- V.currentPageData = n, V.currentPageDataCopy = ne(!0, {}, n), V.oldParentId = n.parentId;
1478
- }, Da = () => {
1479
- V.currentPageData = {}, V.currentPageDataCopy = {}, V.oldParentId = null;
1480
- }, ha = () => !ce(V.currentPageData, V.currentPageDataCopy), Ca = 0, va = 1, Ia = () => ({
1481
- DEFAULT_PAGE: ma,
1482
- pageSettingState: V,
1483
- isTemporaryPage: fa,
1484
- isCurrentDataSame: Pa,
1485
- changeTreeData: _a,
1486
- getPageContent: ya,
1487
- resetPageData: Da,
1488
- initCurrentPageData: Sa,
1489
- isChangePageData: ha,
1490
- STATIC_PAGE_GROUP_ID: Ca,
1491
- COMMON_PAGE_GROUP_ID: va
1492
- }), ba = {
1166
+ }, ca = () => E.currentPageData.page_content || {}, ia = (a) => {
1167
+ E.currentPageData = a, E.currentPageDataCopy = ee(!0, {}, a), E.oldParentId = a.parentId;
1168
+ }, ga = () => {
1169
+ E.currentPageData = {}, E.currentPageDataCopy = {}, E.oldParentId = null;
1170
+ }, pa = () => !ie(E.currentPageData, E.currentPageDataCopy), ua = 0, da = 1, ma = () => ({
1171
+ DEFAULT_PAGE: na,
1172
+ selectedTemplateCard: oa,
1173
+ pageSettingState: E,
1174
+ isTemporaryPage: sa,
1175
+ isCurrentDataSame: ra,
1176
+ changeTreeData: la,
1177
+ getPageContent: ca,
1178
+ resetPageData: ga,
1179
+ initCurrentPageData: ia,
1180
+ isChangePageData: pa,
1181
+ STATIC_PAGE_GROUP_ID: ua,
1182
+ COMMON_PAGE_GROUP_ID: da
1183
+ }), Pa = {
1493
1184
  id: "engine.service.page",
1494
1185
  type: "MetaService",
1495
- apis: Ia(),
1186
+ apis: ma(),
1496
1187
  composable: {
1497
- name: We.usePage
1188
+ name: Ye.usePage
1189
+ }
1190
+ }, fa = {
1191
+ components: {
1192
+ TinyCheckbox: Re
1193
+ },
1194
+ setup() {
1195
+ const { pageSettingState: a, STATIC_PAGE_GROUP_ID: t } = L(), { handleRouteHomeUpdate: s } = ge, { confirm: e } = Q(), m = W({
1196
+ checked: !1,
1197
+ selectDisable: !1
1198
+ });
1199
+ Y(() => {
1200
+ var p;
1201
+ const n = !!((p = a.currentPageData) != null && p.isHome);
1202
+ m.checked = n, m.selectDisable = n;
1203
+ });
1204
+ const i = le(() => {
1205
+ let n = "暂无主页";
1206
+ if (a.pages[t]) {
1207
+ const d = a.pages[t].data.filter((f) => f.isHome);
1208
+ d[0] && (n = d[0].name);
1209
+ }
1210
+ return n;
1211
+ }), o = Ke("openSettingPanel");
1212
+ return {
1213
+ pageSettingState: a,
1214
+ settingHome: () => {
1215
+ e({
1216
+ title: "提示",
1217
+ type: "warning ",
1218
+ message: "是否确定要将此页面设置为主页?您所做的任何未保存的更改都将被丢弃。",
1219
+ exec: () => {
1220
+ const { id: n } = a.currentPageData, p = a.ROOT_ID, d = { ...a.currentPageData };
1221
+ d.parentId = p, d.isHome = !0, s(n, d).then(() => {
1222
+ a.updateTreeData(), o({ data: a.currentPageData }), a.isNew = !1, He && gt({
1223
+ pageId: n,
1224
+ componentsTree: d
1225
+ }), x({ message: "主页设置成功!", type: "success" });
1226
+ }).catch(() => {
1227
+ x({ message: "主页设置失败!", type: "error" });
1228
+ });
1229
+ },
1230
+ cancel: () => {
1231
+ m.checked = !1;
1232
+ }
1233
+ });
1234
+ },
1235
+ homePage: i,
1236
+ state: m
1237
+ };
1238
+ }
1239
+ }, _a = { class: "home" }, ya = { class: "tip" }, Sa = { class: "home-page" };
1240
+ function Da(a, t, s, e, m, i) {
1241
+ const o = u("tiny-checkbox");
1242
+ return N(), J("div", _a, [
1243
+ l(o, {
1244
+ class: "selectHome",
1245
+ modelValue: e.state.checked,
1246
+ "onUpdate:modelValue": t[0] || (t[0] = (g) => e.state.checked = g),
1247
+ disabled: e.state.selectDisable,
1248
+ onChange: e.settingHome
1249
+ }, {
1250
+ default: y(() => t[1] || (t[1] = [
1251
+ $("设为主页")
1252
+ ])),
1253
+ _: 1
1254
+ }, 8, ["modelValue", "disabled", "onChange"]),
1255
+ V("div", ya, [
1256
+ t[2] || (t[2] = V("span", null, "当前主页是", -1)),
1257
+ V("span", Sa, "【" + fe(e.homePage) + "】", 1)
1258
+ ])
1259
+ ]);
1260
+ }
1261
+ const ha = /* @__PURE__ */ K(fa, [["render", Da], ["__scopeId", "data-v-bf1c3be4"]]), Ca = {
1262
+ components: {
1263
+ TinyForm: ot,
1264
+ TinyFormItem: st,
1265
+ TinyInput: Ue,
1266
+ TinySelect: rt,
1267
+ PageHome: ha,
1268
+ TinyRadio: lt
1269
+ },
1270
+ props: {
1271
+ modelValue: {
1272
+ type: Object,
1273
+ default: () => ({})
1274
+ },
1275
+ isFolder: {
1276
+ type: Boolean,
1277
+ default: !1
1278
+ }
1279
+ },
1280
+ setup() {
1281
+ const {
1282
+ pageSettingState: a,
1283
+ changeTreeData: t,
1284
+ STATIC_PAGE_GROUP_ID: s
1285
+ } = L(), e = a.ROOT_ID, m = U(a.currentPageData.parentId);
1286
+ Y(() => {
1287
+ m.value = a.oldParentId;
1288
+ });
1289
+ const i = le(() => {
1290
+ let D = a.currentPageData.route || "", h = a.currentPageData.parentId;
1291
+ for (; h !== e; ) {
1292
+ const P = a.treeDataMapping[h];
1293
+ if (!P)
1294
+ break;
1295
+ D = `${P.route}/${D}`, h = P.parentId;
1296
+ }
1297
+ return D.startsWith("/") && (D = D.slice(1)), D;
1298
+ }), o = {
1299
+ name: [{
1300
+ required: !0,
1301
+ message: "请输入页面 ID"
1302
+ }, {
1303
+ pattern: _t,
1304
+ message: "只允许包含英文字母,且为大写开头驼峰格式, 如DemoPage"
1305
+ }, {
1306
+ min: 3,
1307
+ max: 25,
1308
+ message: "长度在 3 到 25 个字符"
1309
+ }],
1310
+ route: [{
1311
+ required: !0,
1312
+ message: "请输入页面路由"
1313
+ }, {
1314
+ pattern: Fe,
1315
+ message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
1316
+ }]
1317
+ }, g = {
1318
+ name: [{
1319
+ required: !0,
1320
+ message: "请输入页面文件夹 ID"
1321
+ }, {
1322
+ pattern: yt,
1323
+ message: "只允许包含英文字母、数字、下横线_、中横线-, 且以英文字母开头"
1324
+ }, {
1325
+ min: 3,
1326
+ max: 25,
1327
+ message: "长度在 3 到 25 个字符"
1328
+ }],
1329
+ route: [{
1330
+ required: !0,
1331
+ message: "请输入页面文件夹路由"
1332
+ }, {
1333
+ pattern: Fe,
1334
+ message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
1335
+ }],
1336
+ group: [{
1337
+ required: !0,
1338
+ message: "必须选择页面类型"
1339
+ }]
1340
+ }, n = (D) => {
1341
+ const h = [];
1342
+ return D.forEach((P) => {
1343
+ !P.isPage && P.id !== a.currentPageData.id && (h.push(P), P.children || (P.children = []), P.children = n(P.children));
1344
+ }), h;
1345
+ }, p = le(() => {
1346
+ var v;
1347
+ const D = l(u("SvgIcon"), {
1348
+ name: "text-page-folder-closed",
1349
+ class: "folder-icon"
1350
+ }, null), h = l(u("SvgIcon"), {
1351
+ name: "text-page-folder",
1352
+ class: "folder-icon"
1353
+ }, null), P = ((v = a.pages[s]) == null ? void 0 : v.data) || [];
1354
+ return {
1355
+ data: [{
1356
+ name: "无",
1357
+ id: e
1358
+ }, ...n(JSON.parse(JSON.stringify(P)))],
1359
+ shrinkIcon: h,
1360
+ expandIcon: D,
1361
+ renderContent: (X, {
1362
+ node: R,
1363
+ data: q
1364
+ }) => l("span", {
1365
+ style: "display:flex"
1366
+ }, [R.isLeaf && q.id !== e ? l(u("svg-icon"), {
1367
+ name: "text-page-folder-closed",
1368
+ style: "margin-right:14px"
1369
+ }, null) : null, l("span", {
1370
+ class: "label"
1371
+ }, [R.label])])
1372
+ };
1373
+ }), d = U(null);
1374
+ return {
1375
+ pageRules: o,
1376
+ folderRules: g,
1377
+ pageSettingState: a,
1378
+ generalForm: d,
1379
+ validGeneralForm: () => new Promise((D, h) => {
1380
+ d.value.validate((P) => {
1381
+ P ? D(P) : h(P);
1382
+ });
1383
+ }),
1384
+ treeFolderOp: p,
1385
+ currentRoute: i,
1386
+ changeParentForderId: (D) => {
1387
+ t(D.id, m.value), m.value = D.id;
1388
+ }
1389
+ };
1498
1390
  }
1499
- }, ja = {
1500
- ...da,
1501
- apis: ia,
1502
- entry: ua,
1503
- metas: [ba]
1391
+ }, va = { class: "general-config" }, ba = { class: "tip" }, Ia = {
1392
+ key: 0,
1393
+ class: "text"
1394
+ }, Ta = {
1395
+ key: 1,
1396
+ class: "route-text"
1397
+ }, Na = { class: "text-dim" };
1398
+ function Oa(a, t, s, e, m, i) {
1399
+ const o = u("tiny-radio"), g = u("tiny-form-item"), n = u("tiny-input"), p = u("tiny-select"), d = u("tiny-form"), f = u("page-home");
1400
+ return N(), J("div", va, [
1401
+ l(d, {
1402
+ ref: "generalForm",
1403
+ model: e.pageSettingState.currentPageData,
1404
+ rules: s.isFolder ? e.folderRules : e.pageRules,
1405
+ "label-width": "120px",
1406
+ "validate-type": "text",
1407
+ "inline-message": !0,
1408
+ "label-align": !0,
1409
+ "label-position": "top",
1410
+ class: "general-config-form"
1411
+ }, {
1412
+ default: y(() => [
1413
+ s.isFolder ? H("", !0) : (N(), G(g, {
1414
+ key: 0,
1415
+ prop: "group",
1416
+ label: "页面类型",
1417
+ class: "form-item-page-type"
1418
+ }, {
1419
+ default: y(() => [
1420
+ l(o, {
1421
+ modelValue: e.pageSettingState.currentPageData.group,
1422
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => e.pageSettingState.currentPageData.group = _),
1423
+ class: "page-type-radio",
1424
+ label: "staticPages"
1425
+ }, {
1426
+ default: y(() => t[5] || (t[5] = [
1427
+ $(" 静态页面 ")
1428
+ ])),
1429
+ _: 1
1430
+ }, 8, ["modelValue"]),
1431
+ l(o, {
1432
+ modelValue: e.pageSettingState.currentPageData.group,
1433
+ "onUpdate:modelValue": t[1] || (t[1] = (_) => e.pageSettingState.currentPageData.group = _),
1434
+ class: "page-type-radio",
1435
+ label: "publicPages"
1436
+ }, {
1437
+ default: y(() => t[6] || (t[6] = [
1438
+ $(" 公共页面 ")
1439
+ ])),
1440
+ _: 1
1441
+ }, 8, ["modelValue"])
1442
+ ]),
1443
+ _: 1
1444
+ })),
1445
+ l(g, {
1446
+ prop: "name",
1447
+ label: `${s.isFolder ? "文件夹" : "页面"}名称`
1448
+ }, {
1449
+ default: y(() => [
1450
+ l(n, {
1451
+ modelValue: e.pageSettingState.currentPageData.name,
1452
+ "onUpdate:modelValue": t[2] || (t[2] = (_) => e.pageSettingState.currentPageData.name = _),
1453
+ placeholder: `请设置${s.isFolder ? "文件夹" : "页面"}名称`
1454
+ }, null, 8, ["modelValue", "placeholder"])
1455
+ ]),
1456
+ _: 1
1457
+ }, 8, ["label"]),
1458
+ e.pageSettingState.currentPageData.group !== "publicPages" ? (N(), G(g, {
1459
+ key: 1,
1460
+ label: "父文件夹",
1461
+ prop: "parentId"
1462
+ }, {
1463
+ default: y(() => [
1464
+ l(p, {
1465
+ modelValue: e.pageSettingState.currentPageData.parentId,
1466
+ "onUpdate:modelValue": t[3] || (t[3] = (_) => e.pageSettingState.currentPageData.parentId = _),
1467
+ "value-field": "id",
1468
+ "render-type": "tree",
1469
+ "tree-op": e.treeFolderOp,
1470
+ "text-field": "name",
1471
+ placeholder: "请选择父文件夹",
1472
+ "popper-class": "parent-fold-select-dropdown",
1473
+ onChange: e.changeParentForderId
1474
+ }, null, 8, ["modelValue", "tree-op", "onChange"])
1475
+ ]),
1476
+ _: 1
1477
+ })) : H("", !0),
1478
+ l(g, {
1479
+ label: "页面路由",
1480
+ prop: "route"
1481
+ }, {
1482
+ default: y(() => [
1483
+ l(n, {
1484
+ modelValue: e.pageSettingState.currentPageData.route,
1485
+ "onUpdate:modelValue": t[4] || (t[4] = (_) => e.pageSettingState.currentPageData.route = _),
1486
+ placeholder: "请设置路由"
1487
+ }, null, 8, ["modelValue"]),
1488
+ V("div", ba, [
1489
+ e.pageSettingState.currentPageData.route ? (N(), J("span", Ta, [
1490
+ t[7] || (t[7] = V("span", { class: "text" }, "website.com/", -1)),
1491
+ V("span", Na, fe(e.currentRoute), 1)
1492
+ ])) : (N(), J("span", Ia, "路由将以website.com开头"))
1493
+ ])
1494
+ ]),
1495
+ _: 1
1496
+ })
1497
+ ]),
1498
+ _: 1
1499
+ }, 8, ["model", "rules"]),
1500
+ !s.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (N(), G(f, { key: 0 })) : H("", !0)
1501
+ ]);
1502
+ }
1503
+ const Fa = /* @__PURE__ */ K(Ca, [["render", Oa], ["__scopeId", "data-v-7be2b6ba"]]), Xa = {
1504
+ ...te,
1505
+ apis: { ...$t, ...Be },
1506
+ entry: aa,
1507
+ components: {
1508
+ PageGeneral: Fa
1509
+ },
1510
+ metas: [Pa]
1504
1511
  };
1505
1512
  export {
1506
- ba as PageService,
1507
- ja as default
1513
+ Pa as PageService,
1514
+ Xa as default
1508
1515
  };