@opentiny/tiny-engine-plugin-page 2.3.0 → 2.4.0-rc.0

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 (3) hide show
  1. package/dist/index.js +1078 -1035
  2. package/dist/style.css +1 -1
  3. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,37 +1,32 @@
1
1
  import "./style.css";
2
- import { ref as K, watchEffect as Pe, resolveComponent as P, createBlock as H, openBlock as v, computed as $, createElementBlock as U, createVNode as d, createElementVNode as V, withCtx as S, reactive as le, createCommentVNode as j, resolveDynamicComponent as Je, createTextVNode as ue, Fragment as oe, renderList as Se, normalizeClass as ve, renderSlot as ot, toDisplayString as de, onMounted as st, onUnmounted as Be, provide as rt, inject as lt } from "vue";
3
- import { getMetaApi as G, META_SERVICE as B, usePage as ee, useBlock as ct, useModal as se, getMergeMeta as Ae, useNotify as M, useCanvas as re, getMergeRegistry as Ke, useLayout as he, useMessage as we, useHelp as it, useBreadcrumb as gt, getOptions as Me, HOOK_NAME as ut } from "@opentiny/tiny-engine-meta-register";
4
- import { BlockHistoryList as dt, MetaCodeEditor as pt, ButtonGroup as We, SvgButton as be, PluginSetting as Xe, LifeCycles as mt, PluginPanel as ft } from "@opentiny/tiny-engine-common";
5
- import { isEqual as pe, extend as me } from "@opentiny/vue-renderless/common/object";
6
- import { Checkbox as ke, CollapseItem as Te, Collapse as Fe, Button as ze, Input as Qe, Popover as Pt, Search as yt, Radio as _t, Select as ht, FormItem as Dt, Form as St } from "@opentiny/vue";
7
- import { constants as Oe } from "@opentiny/tiny-engine-utils";
8
- import { isVsCodeEnv as Ye } from "@opentiny/tiny-engine-common/js/environments";
9
- import { handlePageUpdate as Ze } from "@opentiny/tiny-engine-common/js/http";
10
- import { generatePage as vt, generateRouter as bt } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
11
- import { previewPage as Ct } from "@opentiny/tiny-engine-common/js/preview";
12
- import Nt from "@opentiny/vue-renderless/common/deps/throttle";
13
- import { IconSearch as It, IconFolderClosed as wt, IconFolderOpened as kt } from "@opentiny/vue-icon";
14
- import { getCanvasStatus as $e } from "@opentiny/tiny-engine-common/js/canvas";
15
- import { REGEXP_ROUTE as He, REGEXP_FOLDER_NAME as Tt, REGEXP_PAGE_NAME as Ft } from "@opentiny/tiny-engine-common/js/verification";
16
- const Ot = (a) => G(B.Http).get(`/app-center/api/pages/list/${a}`), Ee = (a) => G(B.Http).get(`/app-center/api/pages/detail/${a}`), Et = (a) => G(B.Http).get(`/app-center/api/pages/delete/${a}`), xt = (a) => G(B.Http).post("/app-center/api/pages/create", a), Vt = (a, t) => G(B.Http).post(`/app-center/api/pages/update/${a}`, t), Rt = (a) => G(B.Http).post("/app-center/api/pages/copy", a), et = (a) => G(B.Http).get(`/app-center/api/pages/histories?page=${a}`), Gt = (a) => G(B.Http).post("/app-center/api/pageHistory/restore", a), Bt = (a) => G(B.Http).get(`/app-center/api/pages/histories/${a}`), At = (a, t) => G(B.Http).post(`/app-center/api/pages/update/${a}`, t), ce = {
17
- fetchPageList: Ot,
18
- fetchPageDetail: Ee,
19
- requestDeletePage: Et,
20
- requestCreatePage: xt,
21
- requestCopyPage: Rt,
22
- fetchPageHistory: et,
23
- fetchHistoryDetail: Bt,
24
- handleRouteHomeUpdate: Vt,
25
- requestRestorePageHistory: Gt,
26
- requestUpdatePage: At
27
- }, te = (a, t) => {
28
- const n = a.__vccOpts || a;
29
- for (const [e, s] of t)
30
- n[e] = s;
31
- return n;
32
- }, Mt = {
2
+ import { ref as K, watchEffect as Se, resolveComponent as D, createBlock as H, openBlock as v, computed as z, createElementBlock as U, createVNode as p, createElementVNode as A, withCtx as C, reactive as ee, createCommentVNode as j, resolveDynamicComponent as ze, createTextVNode as ie, defineComponent as Qe, Fragment as ce, renderList as De, normalizeClass as he, renderSlot as ct, toDisplayString as ae, onMounted as ut, onUnmounted as Le, provide as He } from "vue";
3
+ import { getMetaApi as G, META_SERVICE as V, usePage as Y, useBlock as gt, useModal as oe, getMergeMeta as Ue, useNotify as M, useCanvas as se, getMergeRegistry as Ye, useLayout as ne, useMessage as Ne, useHelp as dt, useBreadcrumb as pt, getOptions as qe, HOOK_NAME as ft } from "@opentiny/tiny-engine-meta-register";
4
+ import { BlockHistoryList as mt, MetaCodeEditor as Pt, ButtonGroup as Ze, SvgButton as ve, PluginSetting as $e, LifeCycles as yt, PluginPanel as _t } from "@opentiny/tiny-engine-common";
5
+ import { isEqual as de, extend as pe } from "@opentiny/vue-renderless/common/object";
6
+ import { Checkbox as Dt, CollapseItem as Ie, Collapse as Ee, Button as et, Input as tt, Popover as ht, Search as St, Radio as vt, Select as Ct, FormItem as bt, Form as Ft } from "@opentiny/vue";
7
+ import { constants as we } from "@opentiny/tiny-engine-utils";
8
+ import { isVsCodeEnv as Nt } from "@opentiny/tiny-engine-common/js/environments";
9
+ import { handlePageUpdate as at } from "@opentiny/tiny-engine-common/js/http";
10
+ import { generatePage as It } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
11
+ import { previewPage as Et } from "@opentiny/tiny-engine-common/js/preview";
12
+ import wt from "@opentiny/vue-renderless/common/deps/throttle";
13
+ import { IconSearch as Tt, IconFolderClosed as kt, IconFolderOpened as Bt, iconFile as Ot } from "@opentiny/vue-icon";
14
+ import { getCanvasStatus as nt } from "@opentiny/tiny-engine-common/js/canvas";
15
+ import { REGEXP_ROUTE as je, REGEXP_FOLDER_NAME as xt, REGEXP_PAGE_NAME as At } from "@opentiny/tiny-engine-common/js/verification";
16
+ const Gt = (t) => G(V.Http).get(`/app-center/api/pages/list/${t}`), Te = (t) => G(V.Http).get(`/app-center/api/pages/detail/${t}`), Vt = (t) => G(V.Http).get(`/app-center/api/pages/delete/${t}`), Rt = (t) => G(V.Http).post("/app-center/api/pages/create", t), ot = (t, a) => G(V.Http).post(`/app-center/api/pages/update/${t}`, a), Mt = (t) => G(V.Http).post("/app-center/api/pages/copy", t), st = (t) => G(V.Http).get(`/app-center/api/pages/histories?page=${t}`), Lt = (t) => G(V.Http).post("/app-center/api/pageHistory/restore", t), Ht = (t) => G(V.Http).get(`/app-center/api/pages/histories/${t}`), Ut = (t, a) => G(V.Http).post(`/app-center/api/pages/update/${t}`, a), ue = {
17
+ fetchPageList: Gt,
18
+ fetchPageDetail: Te,
19
+ requestDeletePage: Vt,
20
+ requestCreatePage: Rt,
21
+ requestCopyPage: Mt,
22
+ fetchPageHistory: st,
23
+ fetchHistoryDetail: Ht,
24
+ handleRouteHomeUpdate: ot,
25
+ requestRestorePageHistory: Lt,
26
+ requestUpdatePage: Ut
27
+ }, qt = {
33
28
  components: {
34
- BlockHistoryList: dt
29
+ BlockHistoryList: mt
35
30
  },
36
31
  props: {
37
32
  curPageData: {
@@ -40,91 +35,96 @@ const Ot = (a) => G(B.Http).get(`/app-center/api/pages/list/${a}`), Ee = (a) =>
40
35
  }
41
36
  },
42
37
  emits: ["restorePage"],
43
- setup(a, { emit: t }) {
44
- const { pageSettingState: n, getFamily: e } = ee(), { getDateFromNow: s } = ct(), { confirm: o } = se(), r = K([]), c = (y) => {
45
- const { id: f, version: k } = G(B.GlobalService).getBaseInfo(), m = k ? `&app=${f}&version=${k}` : "";
46
- y ? et(y + m).then((h) => {
47
- h && (h.forEach((i) => {
48
- i.backupTitle = i.message, i.backupTime = s(new Date(i.time));
49
- }), r.value = h.reverse());
38
+ setup(t, { emit: a }) {
39
+ const { pageSettingState: n, getFamily: e } = Y(), { getDateFromNow: o } = gt(), { confirm: s } = oe(), r = K([]), c = (y) => {
40
+ const { id: m, version: h } = G(V.GlobalService).getBaseInfo(), f = h ? `&app=${m}&version=${h}` : "";
41
+ y ? st(y + f).then((b) => {
42
+ b && (b.forEach((w) => {
43
+ w.backupTitle = w.message, w.backupTime = o(new Date(w.time));
44
+ }), r.value = b.reverse());
50
45
  }) : r.value = [];
51
46
  };
52
- return Pe(() => {
53
- var f;
54
- const y = ((f = n.currentPageData) == null ? void 0 : f.id) || "";
47
+ return Se(() => {
48
+ var m;
49
+ const y = ((m = n.currentPageData) == null ? void 0 : m.id) || "";
55
50
  c(y);
56
51
  }), {
57
52
  list: r,
58
53
  previewHistory: async (y) => {
59
- var f, k, m, h;
54
+ var m, h, f, b;
60
55
  if (y) {
61
- const i = (k = (f = G(B.ThemeSwitch)) == null ? void 0 : f.getThemeState()) == null ? void 0 : k.theme, p = {
56
+ const w = (h = (m = G(V.ThemeSwitch)) == null ? void 0 : m.getThemeState()) == null ? void 0 : h.theme, B = {
62
57
  id: Number(y.page),
63
58
  history: y.id,
64
- framework: (m = Ae("engine.config")) == null ? void 0 : m.dslMode,
65
- platform: (h = Ae("engine.config")) == null ? void 0 : h.platformId,
59
+ framework: (f = Ue("engine.config")) == null ? void 0 : f.dslMode,
60
+ platform: (b = Ue("engine.config")) == null ? void 0 : b.platformId,
66
61
  pageInfo: {
67
62
  name: y.name,
68
63
  schema: y.page_content
69
64
  },
70
- theme: i
65
+ theme: w
71
66
  };
72
- p.ancestors = await e(p), Ct(p);
67
+ B.ancestors = await e(B), Et(B);
73
68
  }
74
69
  },
75
70
  restoreHistory: (y) => {
76
- o({
71
+ s({
77
72
  title: "提示",
78
73
  message: "您即将还原历史页面,是否继续还原?",
79
74
  exec: () => {
80
- t("restorePage", y);
75
+ a("restorePage", y);
81
76
  }
82
77
  });
83
78
  }
84
79
  };
85
80
  }
81
+ }, Z = (t, a) => {
82
+ const n = t.__vccOpts || t;
83
+ for (const [e, o] of a)
84
+ n[e] = o;
85
+ return n;
86
86
  };
87
- function Ht(a, t, n, e, s, o) {
88
- const r = P("block-history-list");
87
+ function jt(t, a, n, e, o, s) {
88
+ const r = D("block-history-list");
89
89
  return v(), H(r, {
90
90
  history: e.list,
91
91
  onPreview: e.previewHistory,
92
92
  onRestore: e.restoreHistory
93
93
  }, null, 8, ["history", "onPreview", "onRestore"]);
94
94
  }
95
- const Ut = /* @__PURE__ */ te(Mt, [["render", Ht]]), Lt = {
95
+ const Jt = /* @__PURE__ */ Z(qt, [["render", jt]]), Kt = {
96
96
  components: {
97
- MetaCodeEditor: pt,
98
- TinyCheckbox: ke
97
+ MetaCodeEditor: Pt,
98
+ TinyCheckbox: Dt
99
99
  },
100
100
  setup() {
101
- const a = K(""), t = K(""), { pageSettingState: n } = ee(), e = $(() => n.currentPageData);
102
- return Pe(() => {
103
- var c, l;
104
- a.value = ((c = n.currentPageData.page_content) == null ? void 0 : c.inputs) || "", t.value = ((l = n.currentPageData.page_content) == null ? void 0 : l.outputs) || "";
101
+ const t = K(""), a = K(""), { pageSettingState: n } = Y(), e = z(() => n.currentPageData);
102
+ return Se(() => {
103
+ var c, g;
104
+ t.value = ((c = n.currentPageData.page_content) == null ? void 0 : c.inputs) || "", a.value = ((g = n.currentPageData.page_content) == null ? void 0 : g.outputs) || "";
105
105
  }), {
106
- inputValue: a,
107
- outputValue: t,
106
+ inputValue: t,
107
+ outputValue: a,
108
108
  saveInputValue: (c) => {
109
109
  try {
110
- const l = JSON.parse(c.content);
111
- a.value = c.content, e.value.page_content.inputs = l;
112
- } catch (l) {
110
+ const g = JSON.parse(c.content);
111
+ t.value = c.content, e.value.page_content.inputs = g;
112
+ } catch (g) {
113
113
  M({
114
114
  title: "输入配置保存失败(必须符合JSON格式)",
115
- message: `${(l == null ? void 0 : l.message) || l}`,
115
+ message: `${(g == null ? void 0 : g.message) || g}`,
116
116
  type: "error"
117
117
  });
118
118
  }
119
119
  },
120
120
  saveOutputValue: (c) => {
121
121
  try {
122
- const l = JSON.parse(c.content);
123
- t.value = c.content, e.value.page_content.outputs = l;
124
- } catch (l) {
122
+ const g = JSON.parse(c.content);
123
+ a.value = c.content, e.value.page_content.outputs = g;
124
+ } catch (g) {
125
125
  M({
126
126
  title: "输出配置保存失败(必须符合JSON格式)",
127
- message: `${(l == null ? void 0 : l.message) || l}`,
127
+ message: `${(g == null ? void 0 : g.message) || g}`,
128
128
  type: "error"
129
129
  });
130
130
  }
@@ -133,11 +133,11 @@ const Ut = /* @__PURE__ */ te(Mt, [["render", Ht]]), Lt = {
133
133
  hasContent: (c) => Array.isArray(c) && c.length > 0 || typeof c == "object" && Object.keys(c).length > 0
134
134
  };
135
135
  }
136
- }, qt = { class: "input-or-output" };
137
- function jt(a, t, n, e, s, o) {
138
- const r = P("svg-icon"), c = P("meta-code-editor"), l = P("tiny-checkbox");
139
- return v(), U("div", qt, [
140
- d(c, {
136
+ }, Wt = { class: "input-or-output" };
137
+ function Xt(t, a, n, e, o, s) {
138
+ const r = D("svg-icon"), c = D("meta-code-editor"), g = D("tiny-checkbox");
139
+ return v(), U("div", Wt, [
140
+ p(c, {
141
141
  modelValue: e.inputValue,
142
142
  title: "输入配置",
143
143
  "button-text": "输入配置",
@@ -146,16 +146,16 @@ function jt(a, t, n, e, s, o) {
146
146
  single: "",
147
147
  onSave: e.saveInputValue
148
148
  }, {
149
- icon: S(() => [
150
- d(r, {
149
+ icon: C(() => [
150
+ p(r, {
151
151
  class: "edit-btn-icon",
152
152
  name: "to-edit"
153
153
  })
154
154
  ]),
155
155
  _: 1
156
156
  }, 8, ["modelValue", "buttonShowContent", "onSave"]),
157
- t[2] || (t[2] = V("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
158
- d(c, {
157
+ a[2] || (a[2] = A("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
158
+ p(c, {
159
159
  modelValue: e.outputValue,
160
160
  title: "输出配置",
161
161
  "button-text": "输出配置",
@@ -164,60 +164,60 @@ function jt(a, t, n, e, s, o) {
164
164
  single: "",
165
165
  onSave: e.saveOutputValue
166
166
  }, {
167
- icon: S(() => [
168
- d(r, {
167
+ icon: C(() => [
168
+ p(r, {
169
169
  class: "edit-btn-icon",
170
170
  name: "to-edit"
171
171
  })
172
172
  ]),
173
173
  _: 1
174
174
  }, 8, ["modelValue", "buttonShowContent", "onSave"]),
175
- t[3] || (t[3] = V("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
176
- d(l, {
175
+ a[3] || (a[3] = A("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
176
+ p(g, {
177
177
  class: "selectHome",
178
178
  modelValue: e.pageSettingState.currentPageData.isBody,
179
- "onUpdate:modelValue": t[0] || (t[0] = (_) => e.pageSettingState.currentPageData.isBody = _)
179
+ "onUpdate:modelValue": a[0] || (a[0] = (I) => e.pageSettingState.currentPageData.isBody = I)
180
180
  }, {
181
- default: S(() => t[1] || (t[1] = [
182
- V("span", null, "设为根元素为Body", -1)
181
+ default: C(() => a[1] || (a[1] = [
182
+ A("span", null, "设为根元素为Body", -1)
183
183
  ])),
184
184
  _: 1
185
185
  }, 8, ["modelValue"]),
186
- t[4] || (t[4] = V("div", { class: "input-output-div" }, "默认为div", -1))
186
+ a[4] || (a[4] = A("div", { class: "input-output-div" }, "默认为div", -1))
187
187
  ]);
188
188
  }
189
- const Jt = /* @__PURE__ */ te(Lt, [["render", jt], ["__scopeId", "data-v-093962cb"]]), fe = {
189
+ const zt = /* @__PURE__ */ Z(Kt, [["render", Xt], ["__scopeId", "data-v-c7b79c9b"]]), fe = {
190
190
  id: "engine.plugins.appmanage",
191
191
  title: "页面",
192
192
  type: "plugins",
193
193
  icon: "plugin-icon-page",
194
- align: "top"
194
+ align: "leftTop"
195
195
  }, {
196
- COMPONENT_NAME: Kt
197
- } = Oe, xe = K(!1), De = () => {
198
- xe.value = !0;
199
- }, Z = () => {
200
- xe.value = !1;
196
+ COMPONENT_NAME: Qt
197
+ } = we, ke = K(!1), _e = () => {
198
+ ke.value = !0;
199
+ }, Q = () => {
200
+ ke.value = !1;
201
201
  const {
202
- resetPageData: a
203
- } = ee();
204
- a();
205
- }, Ue = {
202
+ resetPageData: t
203
+ } = Y();
204
+ t();
205
+ }, Je = {
206
206
  general: "general",
207
207
  inputOutput: "inputOutput",
208
208
  lifeCycles: "lifeCycles",
209
209
  history: "history"
210
- }, Wt = {
210
+ }, Yt = {
211
211
  components: {
212
- TinyButton: ze,
213
- TinyCollapse: Fe,
214
- TinyCollapseItem: Te,
215
- PageInputOutput: Jt,
216
- LifeCycles: mt,
217
- PageHistory: Ut,
218
- PluginSetting: Xe,
219
- SvgButton: be,
220
- ButtonGroup: We
212
+ TinyButton: et,
213
+ TinyCollapse: Ee,
214
+ TinyCollapseItem: Ie,
215
+ PageInputOutput: zt,
216
+ LifeCycles: yt,
217
+ PageHistory: Jt,
218
+ PluginSetting: $e,
219
+ SvgButton: ve,
220
+ ButtonGroup: Ze
221
221
  },
222
222
  props: {
223
223
  isFolder: {
@@ -226,179 +226,198 @@ const Jt = /* @__PURE__ */ te(Lt, [["render", jt], ["__scopeId", "data-v-093962c
226
226
  }
227
227
  },
228
228
  emits: ["openNewPage"],
229
- setup(a, {
230
- emit: t
229
+ setup(t, {
230
+ emit: a
231
231
  }) {
232
- var Ie;
232
+ var Pe;
233
233
  const {
234
234
  requestCreatePage: n,
235
235
  requestDeletePage: e
236
- } = ce, {
237
- getDefaultPage: s,
238
- pageSettingState: o,
236
+ } = ue, {
237
+ getDefaultPage: o,
238
+ pageSettingState: s,
239
239
  changeTreeData: r,
240
240
  isCurrentDataSame: c,
241
- initCurrentPageData: l,
242
- isTemporaryPage: _,
241
+ initCurrentPageData: g,
242
+ isTemporaryPage: I,
243
243
  STATIC_PAGE_GROUP_ID: y
244
- } = ee(), {
245
- pageState: f,
246
- initData: k
247
- } = re(), {
248
- confirm: m
249
- } = se(), h = Ke(fe.type, fe.id), i = h.components.PageGeneral, p = (Ie = h == null ? void 0 : h.options) == null ? void 0 : Ie.beforeCreatePage, b = K(null), q = le({
250
- activeName: Object.values(Ue),
244
+ } = Y(), {
245
+ pageState: m,
246
+ initData: h
247
+ } = se(), {
248
+ confirm: f
249
+ } = oe(), b = Ye(fe.type, fe.id), w = b.components.PageGeneral, B = (Pe = b == null ? void 0 : b.options) == null ? void 0 : Pe.beforeCreatePage, R = K(null), {
250
+ PLUGIN_NAME: J,
251
+ getPluginByLayout: d
252
+ } = ne(), P = z(() => d(J.AppManage)), l = ee({
253
+ activeName: Object.values(Je),
251
254
  title: "页面设置",
252
255
  historyMessage: ""
253
- }), A = () => {
254
- pe(o.currentPageData, o.currentPageDataCopy) ? Z() : m({
256
+ }), u = () => {
257
+ de(s.currentPageData, s.currentPageDataCopy) ? Q() : f({
255
258
  title: "提示",
256
259
  message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
257
260
  exec: () => {
258
- o.isNew || (r(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy)), Z();
261
+ s.isNew || (r(s.oldParentId, s.currentPageData.parentId), Object.assign(s.currentPageData, s.currentPageDataCopy)), Q();
259
262
  }
260
263
  });
261
- }, X = async () => {
264
+ }, N = async () => {
262
265
  const {
263
- page_content: N,
264
- ...F
265
- } = s(), {
266
- page_content: E,
267
- ...x
268
- } = o.currentPageData, L = {
269
- ...F,
270
- ...x,
266
+ page_content: k,
267
+ ...T
268
+ } = o(), {
269
+ page_content: O,
270
+ ...i
271
+ } = s.currentPageData, _ = {
272
+ ...T,
273
+ ...i,
271
274
  page_content: {
272
- ...N,
273
- ...E,
274
- fileName: o.currentPageData.name
275
+ ...k,
276
+ ...O,
277
+ fileName: s.currentPageData.name
275
278
  },
276
- app: G(B.GlobalService).getBaseInfo().id,
279
+ app: G(V.GlobalService).getBaseInfo().id,
277
280
  isPage: !0
278
281
  };
279
- L.id && (delete L.id, delete L._id), p && await p(L), n(L).then((Q) => {
280
- o.updateTreeData(), o.isNew = !1, _.saved = !1, t("openNewPage", Q), Z(), he().closePlugin(), M({
282
+ _.id && (delete _.id, delete _._id), B && await B(_), n(_).then((S) => {
283
+ s.updateTreeData(), s.isNew = !1, I.saved = !1, a("openNewPage", S), Q(), ne().closePlugin(), M({
281
284
  type: "success",
282
285
  message: "新建页面成功!"
283
- }), Ye && vt(Q);
284
- }).catch((Q) => {
286
+ }), Nt && It(S);
287
+ }).catch((S) => {
285
288
  M({
286
289
  type: "error",
287
290
  title: "新建页面失败",
288
- message: JSON.stringify((Q == null ? void 0 : Q.message) || Q)
291
+ message: JSON.stringify((S == null ? void 0 : S.message) || S)
289
292
  });
290
293
  });
291
- }, g = (N, F) => {
294
+ }, F = (k, T, O = !0) => {
292
295
  var L;
293
- const E = o.currentPageDataCopy.route !== o.currentPageData.route, x = ((L = f == null ? void 0 : f.currentPage) == null ? void 0 : L.id) === N;
294
- return Ze(N, F, E, x);
295
- }, D = (N) => {
296
- N.id = N.page, ["page", "backupTime", "backupTitle", "time"].forEach((x) => delete N[x]);
297
- const E = {
298
- ...o.currentPageData,
299
- ...N,
296
+ const i = s.currentPageDataCopy.route !== s.currentPageData.route, _ = ((L = m == null ? void 0 : m.currentPage) == null ? void 0 : L.id) === k;
297
+ return at({
298
+ id: k,
299
+ params: T,
300
+ routerChange: i,
301
+ isCurEditPage: _,
302
+ isUpdateTree: O
303
+ });
304
+ }, q = (k) => {
305
+ k.id = k.page, ["page", "backupTime", "backupTitle", "time"].forEach((i) => delete k[i]);
306
+ const O = {
307
+ ...s.currentPageData,
308
+ ...k,
300
309
  message: "还原页面"
301
310
  };
302
- g(N.id, E).then((x) => {
303
- var L;
304
- ((L = f == null ? void 0 : f.currentPage) == null ? void 0 : L.id) === (x == null ? void 0 : x.id) && k(x.page_content, x);
311
+ F(k.id, O).then((i) => {
312
+ var _;
313
+ ((_ = m == null ? void 0 : m.currentPage) == null ? void 0 : _.id) === (i == null ? void 0 : i.id) && h(i.page_content, i);
305
314
  });
306
- }, T = async () => {
315
+ }, x = async () => {
307
316
  const {
308
- id: N,
309
- name: F,
310
- page_content: E
311
- } = o.currentPageData, x = {
312
- ...o.currentPageData,
317
+ id: k,
318
+ name: T,
319
+ page_content: O
320
+ } = s.currentPageData, i = {
321
+ ...s.currentPageData,
313
322
  page_content: {
314
- ...E,
315
- fileName: F
323
+ ...O,
324
+ fileName: T
316
325
  }
317
- }, L = await g(N, x);
318
- l(L);
319
- }, I = (N) => {
320
- if (!N)
326
+ }, _ = await F(k, i);
327
+ g(_);
328
+ }, re = (k) => {
329
+ if (!k)
321
330
  return;
322
- const F = o.currentPageData.page_content;
323
- F.lifeCycles = {
324
- ...F.lifeCycles || {},
325
- ...N
331
+ const T = s.currentPageData.page_content;
332
+ T.lifeCycles = {
333
+ ...T.lifeCycles || {},
334
+ ...k
326
335
  };
327
- }, z = () => {
328
- const N = o.currentPageData, F = me(!0, {}, N);
329
- o.isNew = !0, F.name = `${F.name}Copy`, F.route = `${F.route}Copy`, o.currentPageData = F, o.currentPageDataCopy = me(!0, {}, F);
330
- }, R = () => {
331
- c() ? z() : m({
336
+ }, $ = () => {
337
+ const k = s.currentPageData, T = pe(!0, {}, k);
338
+ s.isNew = !0, T.name = `${T.name}Copy`, T.route = `${T.route}Copy`, s.currentPageData = T, s.currentPageDataCopy = pe(!0, {}, T), s.defaultPage = null;
339
+ }, te = () => {
340
+ c() ? $() : f({
332
341
  title: "提示",
333
342
  message: "您即将复制的页面有更改未保存,是否确定跳过更改直接复制?",
334
343
  exec: () => {
335
- r(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy), z();
344
+ r(s.oldParentId, s.currentPageData.parentId), Object.assign(s.currentPageData, s.currentPageDataCopy), $();
336
345
  }
337
346
  });
338
- }, ie = () => {
339
- o.isNew ? (o.currentPageData.message = "Page auto save", X()) : m({
347
+ }, me = async () => {
348
+ var T;
349
+ const k = {
350
+ ...s.defaultPage,
351
+ isDefault: !0
352
+ };
353
+ await F((T = s.defaultPage) == null ? void 0 : T.id, k, !1);
354
+ }, Ae = () => {
355
+ s.isNew ? (s.currentPageData.message = "Page auto save", N()) : f({
340
356
  title: "创建历史备份信息",
341
357
  message: {
342
- render: () => d(Qe, {
358
+ render: () => p(tt, {
343
359
  placeholder: "历史备份信息",
344
- modelValue: q.historyMessage,
345
- "onUpdate:modelValue": (x) => q.historyMessage = x
360
+ modelValue: l.historyMessage,
361
+ "onUpdate:modelValue": (i) => l.historyMessage = i
346
362
  }, null)
347
363
  },
348
364
  exec: () => {
349
- o.currentPageData.message = q.historyMessage.trim() || "Page auto save", T(), q.historyMessage = "";
365
+ var i;
366
+ s.currentPageData.message = l.historyMessage.trim() || "Page auto save", (i = s.defaultPage) != null && i.id ? me().then(x) : x(), l.historyMessage = "";
350
367
  }
351
368
  });
352
- }, ne = () => {
353
- b.value.validGeneralForm().then(ie);
354
- }, ae = (N = []) => {
355
- if (!Array.isArray(N))
369
+ }, Ge = () => {
370
+ R.value.validGeneralForm().then(Ae);
371
+ }, le = (k = []) => {
372
+ if (!Array.isArray(k))
356
373
  return [];
357
- const F = [];
358
- return N.forEach((E) => {
359
- var x;
360
- if (E != null && E.isPage) {
361
- F.push(E);
374
+ const T = [];
375
+ return k.forEach((O) => {
376
+ var i;
377
+ if (O != null && O.isPage) {
378
+ T.push(O);
362
379
  return;
363
380
  }
364
- !(E != null && E.isPage) && ((x = E == null ? void 0 : E.children) != null && x.length) && F.push(...ae(E.children));
365
- }), F;
381
+ !(O != null && O.isPage) && ((i = O == null ? void 0 : O.children) != null && i.length) && T.push(...le(O.children));
382
+ }), T;
366
383
  };
367
384
  return {
368
- state: q,
369
- isShow: xe,
370
- savePageSetting: ne,
371
- copyPage: R,
372
- pageSettingState: o,
373
- pageGeneral: i,
374
- pageGeneralRef: b,
385
+ align: P,
386
+ PLUGIN_NAME: J,
387
+ state: l,
388
+ isShow: ke,
389
+ savePageSetting: Ge,
390
+ copyPage: te,
391
+ pageSettingState: s,
392
+ pageGeneral: w,
393
+ pageGeneralRef: R,
375
394
  deletePage: () => {
376
- var N, F;
377
- if ((F = (N = o.treeDataMapping[o.currentPageData.id]) == null ? void 0 : N.children) != null && F.length) {
395
+ var k, T;
396
+ if ((T = (k = s.treeDataMapping[s.currentPageData.id]) == null ? void 0 : k.children) != null && T.length) {
378
397
  M({
379
398
  type: "error",
380
399
  message: "此页面存在子页面或子文件夹,不能删除!"
381
400
  });
382
401
  return;
383
402
  }
384
- m({
403
+ f({
385
404
  title: "提示",
386
405
  message: "您是否要删除页面?",
387
406
  exec: () => {
388
- var x;
389
- const E = ((x = o.currentPageData) == null ? void 0 : x.id) || "";
390
- e(E).then(() => {
391
- o.updateTreeData().then((L) => {
392
- var W, ye;
393
- if (((W = f == null ? void 0 : f.currentPage) == null ? void 0 : W.id) !== E)
407
+ var i;
408
+ const O = ((i = s.currentPageData) == null ? void 0 : i.id) || "";
409
+ e(O).then(() => {
410
+ s.updateTreeData().then((_) => {
411
+ var ge, Me;
412
+ if (((ge = m == null ? void 0 : m.currentPage) == null ? void 0 : ge.id) !== O)
394
413
  return;
395
- const Q = ((ye = (L || []).find(({
396
- groupId: ge
397
- }) => ge === y)) == null ? void 0 : ye.data) || [], u = ae(Q), O = u.find((ge) => ge.isHome), w = u == null ? void 0 : u[0], J = {
398
- componentName: Kt.Page
414
+ const S = ((Me = (_ || []).find(({
415
+ groupId: Fe
416
+ }) => Fe === y)) == null ? void 0 : Me.data) || [], L = le(S), W = L.find((Fe) => Fe.isHome), be = L == null ? void 0 : L[0], Re = {
417
+ componentName: Qt.Page
399
418
  };
400
- t("openNewPage", O || w || J);
401
- }), Z(), M({
419
+ a("openNewPage", W || be || Re);
420
+ }), Q(), M({
402
421
  message: "删除页面成功!",
403
422
  type: "success"
404
423
  });
@@ -411,30 +430,32 @@ const Jt = /* @__PURE__ */ te(Lt, [["render", jt], ["__scopeId", "data-v-093962c
411
430
  }
412
431
  });
413
432
  },
414
- cancelPageSetting: A,
415
- closePageSettingPanel: Z,
416
- updatePageLifeCycles: I,
417
- restorePage: D,
418
- PAGE_SETTING_SESSION: Ue
433
+ cancelPageSetting: u,
434
+ closePageSettingPanel: Q,
435
+ updatePageLifeCycles: re,
436
+ restorePage: q,
437
+ PAGE_SETTING_SESSION: Je
419
438
  };
420
439
  }
421
- }, Xt = { class: "page-setting-content" }, zt = { class: "life-cycles-container" };
422
- function Qt(a, t, n, e, s, o) {
423
- const r = P("tiny-button"), c = P("svg-button"), l = P("button-group"), _ = P("tiny-collapse-item"), y = P("page-input-output"), f = P("life-cycles"), k = P("page-history"), m = P("tiny-collapse"), h = P("plugin-setting");
424
- return e.isShow ? (v(), H(h, {
440
+ }, Zt = { class: "page-setting-content" }, $t = { class: "life-cycles-container" };
441
+ function ea(t, a, n, e, o, s) {
442
+ const r = D("tiny-button"), c = D("svg-button"), g = D("button-group"), I = D("tiny-collapse-item"), y = D("page-input-output"), m = D("life-cycles"), h = D("page-history"), f = D("tiny-collapse"), b = D("plugin-setting");
443
+ return e.isShow ? (v(), H(b, {
425
444
  key: 0,
445
+ "fixed-name": e.PLUGIN_NAME.AppManage,
446
+ align: e.align,
426
447
  title: e.state.title,
427
448
  class: "page-plugin-setting"
428
449
  }, {
429
- header: S(() => [
430
- d(l, null, {
431
- default: S(() => [
432
- d(r, {
450
+ header: C(() => [
451
+ p(g, null, {
452
+ default: C(() => [
453
+ p(r, {
433
454
  type: "primary",
434
455
  onClick: e.savePageSetting
435
456
  }, {
436
- default: S(() => t[1] || (t[1] = [
437
- ue("保存")
457
+ default: C(() => a[1] || (a[1] = [
458
+ ie("保存")
438
459
  ])),
439
460
  _: 1
440
461
  }, 8, ["onClick"]),
@@ -451,7 +472,7 @@ function Qt(a, t, n, e, s, o) {
451
472
  tips: "删除页面",
452
473
  onClick: e.deletePage
453
474
  }, null, 8, ["onClick"])),
454
- d(c, {
475
+ p(c, {
455
476
  name: "close",
456
477
  onClick: e.cancelPageSetting
457
478
  }, null, 8, ["onClick"])
@@ -459,49 +480,49 @@ function Qt(a, t, n, e, s, o) {
459
480
  _: 1
460
481
  })
461
482
  ]),
462
- content: S(() => [
463
- V("div", Xt, [
464
- d(m, {
483
+ content: C(() => [
484
+ A("div", Zt, [
485
+ p(f, {
465
486
  modelValue: e.state.activeName,
466
- "onUpdate:modelValue": t[0] || (t[0] = (i) => e.state.activeName = i),
487
+ "onUpdate:modelValue": a[0] || (a[0] = (w) => e.state.activeName = w),
467
488
  class: "page-setting-collapse"
468
489
  }, {
469
- default: S(() => [
470
- d(_, {
490
+ default: C(() => [
491
+ p(I, {
471
492
  title: "基本设置",
472
493
  name: e.PAGE_SETTING_SESSION.general
473
494
  }, {
474
- default: S(() => [
475
- (v(), H(Je(e.pageGeneral), {
495
+ default: C(() => [
496
+ (v(), H(ze(e.pageGeneral), {
476
497
  ref: "pageGeneralRef",
477
498
  isFolder: n.isFolder
478
499
  }, null, 8, ["isFolder"]))
479
500
  ]),
480
501
  _: 1
481
502
  }, 8, ["name"]),
482
- e.pageSettingState.currentPageData.group !== "public" ? (v(), H(_, {
503
+ e.pageSettingState.currentPageData.group !== "public" ? (v(), H(I, {
483
504
  key: 0,
484
505
  class: "base-setting",
485
506
  title: "输入输出",
486
507
  name: e.PAGE_SETTING_SESSION.inputOutput
487
508
  }, {
488
- default: S(() => [
489
- d(y)
509
+ default: C(() => [
510
+ p(y)
490
511
  ]),
491
512
  _: 1
492
513
  }, 8, ["name"])) : j("", !0),
493
- e.pageSettingState.currentPageData.group !== "public" ? (v(), H(_, {
514
+ e.pageSettingState.currentPageData.group !== "public" ? (v(), H(I, {
494
515
  key: 1,
495
516
  class: "input-output",
496
517
  title: "页面生命周期配置",
497
518
  name: e.PAGE_SETTING_SESSION.lifeCycles
498
519
  }, {
499
- default: S(() => {
500
- var i;
520
+ default: C(() => {
521
+ var w;
501
522
  return [
502
- V("div", zt, [
503
- d(f, {
504
- bindLifeCycles: (i = e.pageSettingState.currentPageData.page_content) == null ? void 0 : i.lifeCycles,
523
+ A("div", $t, [
524
+ p(m, {
525
+ bindLifeCycles: (w = e.pageSettingState.currentPageData.page_content) == null ? void 0 : w.lifeCycles,
505
526
  onUpdatePageLifeCycles: e.updatePageLifeCycles
506
527
  }, null, 8, ["bindLifeCycles", "onUpdatePageLifeCycles"])
507
528
  ])
@@ -509,13 +530,13 @@ function Qt(a, t, n, e, s, o) {
509
530
  }),
510
531
  _: 1
511
532
  }, 8, ["name"])) : j("", !0),
512
- d(_, {
533
+ p(I, {
513
534
  class: "history-source",
514
535
  title: "历史备份",
515
536
  name: e.PAGE_SETTING_SESSION.history
516
537
  }, {
517
- default: S(() => [
518
- d(k, { onRestorePage: e.restorePage }, null, 8, ["onRestorePage"])
538
+ default: C(() => [
539
+ p(h, { onRestorePage: e.restorePage }, null, 8, ["onRestorePage"])
519
540
  ]),
520
541
  _: 1
521
542
  }, 8, ["name"])
@@ -525,24 +546,22 @@ function Qt(a, t, n, e, s, o) {
525
546
  ])
526
547
  ]),
527
548
  _: 1
528
- }, 8, ["title"])) : j("", !0);
549
+ }, 8, ["fixed-name", "align", "title"])) : j("", !0);
529
550
  }
530
- const Yt = /* @__PURE__ */ te(Wt, [["render", Qt], ["__scopeId", "data-v-85fa9e26"]]);
531
- let Ve = K(!1);
532
- const Le = () => {
533
- Ve.value = !0;
534
- }, Y = () => {
535
- Ve.value = !1;
536
- const { resetPageData: a } = ee();
537
- a();
538
- }, Zt = {
551
+ const ta = /* @__PURE__ */ Z(Yt, [["render", ea], ["__scopeId", "data-v-9c62533d"]]), Be = K(!1), Ke = () => {
552
+ Be.value = !0;
553
+ }, X = () => {
554
+ Be.value = !1;
555
+ const { resetPageData: t } = Y();
556
+ t();
557
+ }, aa = {
539
558
  components: {
540
- TinyButton: ze,
541
- TinyCollapse: Fe,
542
- TinyCollapseItem: Te,
543
- PluginSetting: Xe,
544
- SvgButton: be,
545
- ButtonGroup: We
559
+ TinyButton: et,
560
+ TinyCollapse: Ee,
561
+ TinyCollapseItem: Ie,
562
+ PluginSetting: $e,
563
+ SvgButton: ve,
564
+ ButtonGroup: Ze
546
565
  },
547
566
  props: {
548
567
  isFolder: {
@@ -551,59 +570,61 @@ const Le = () => {
551
570
  }
552
571
  },
553
572
  setup() {
554
- const a = le({
573
+ const t = ee({
555
574
  activeName: ["folderGeneralRef"],
556
575
  title: "文件夹设置"
557
- }), { requestCreatePage: t, requestUpdatePage: n, requestDeletePage: e } = ce, { pageSettingState: s, changeTreeData: o } = ee(), { confirm: r } = se(), l = Ke(fe.type, fe.id).components.PageGeneral, _ = K(null), y = () => {
558
- pe(s.currentPageData, s.currentPageDataCopy) ? Y() : r({
576
+ }), { requestCreatePage: a, requestUpdatePage: n, requestDeletePage: e } = ue, { pageSettingState: o, changeTreeData: s } = Y(), { confirm: r } = oe(), g = Ye(fe.type, fe.id).components.PageGeneral, I = K(null), { PLUGIN_NAME: y, getPluginByLayout: m } = ne(), h = z(() => m(y.AppManage)), f = () => {
577
+ de(o.currentPageData, o.currentPageDataCopy) ? X() : r({
559
578
  title: "提示",
560
579
  message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
561
580
  exec: () => {
562
- s.isNew || (o(s.oldParentId, s.currentPageData.parentId), Object.assign(s.currentPageData, s.currentPageDataCopy)), Y();
581
+ o.isNew || (s(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy)), X();
563
582
  }
564
583
  });
565
- }, f = () => {
566
- const p = {
567
- ...s.currentPageData,
568
- app: G(B.GlobalService).getBaseInfo().id,
584
+ }, b = () => {
585
+ const d = {
586
+ ...o.currentPageData,
587
+ app: G(V.GlobalService).getBaseInfo().id,
569
588
  isPage: !1
570
589
  };
571
- t(p).then(() => {
572
- s.updateTreeData(), s.isNew = !1, Y(), M({
590
+ a(d).then(() => {
591
+ o.updateTreeData(), o.isNew = !1, X(), M({
573
592
  type: "success",
574
593
  message: "新建文件夹成功!"
575
594
  });
576
- }).catch((b) => {
595
+ }).catch((P) => {
577
596
  M({
578
597
  type: "error",
579
598
  title: "新建文件夹失败",
580
- message: JSON.stringify((b == null ? void 0 : b.message) || b)
599
+ message: JSON.stringify((P == null ? void 0 : P.message) || P)
581
600
  });
582
601
  });
583
- }, k = () => {
584
- const { id: i } = s.currentPageData;
585
- n(i, { ...s.currentPageData, page_content: null }).then(() => {
586
- s.updateTreeData(), s.isNew = !1, Y(), M({
602
+ }, w = () => {
603
+ const { id: J } = o.currentPageData;
604
+ n(J, { ...o.currentPageData, page_content: null }).then(() => {
605
+ o.updateTreeData(), o.isNew = !1, X(), M({
587
606
  type: "success",
588
607
  message: "更新文件夹成功!"
589
608
  });
590
- }).catch((p) => {
609
+ }).catch((d) => {
591
610
  M({
592
611
  type: "error",
593
612
  title: "更新文件夹失败",
594
- message: JSON.stringify((p == null ? void 0 : p.message) || p)
613
+ message: JSON.stringify((d == null ? void 0 : d.message) || d)
595
614
  });
596
615
  });
597
616
  };
598
617
  return {
618
+ align: h,
619
+ PLUGIN_NAME: y,
599
620
  saveFolderSetting: () => {
600
- _.value.validGeneralForm().then(() => {
601
- s.isNew ? f() : k();
621
+ I.value.validGeneralForm().then(() => {
622
+ o.isNew ? b() : w();
602
623
  });
603
624
  },
604
- deleteFolder: Nt(5e3, !0, () => {
605
- var i, p;
606
- if ((p = (i = s.treeDataMapping[s.currentPageData.id]) == null ? void 0 : i.children) != null && p.length) {
625
+ deleteFolder: wt(5e3, !0, () => {
626
+ var J, d;
627
+ if ((d = (J = o.treeDataMapping[o.currentPageData.id]) == null ? void 0 : J.children) != null && d.length) {
607
628
  M({
608
629
  type: "error",
609
630
  message: "此文件夹不是空文件夹,不能删除!"
@@ -614,49 +635,51 @@ const Le = () => {
614
635
  title: "提示",
615
636
  message: "您是否要删除文件夹?",
616
637
  exec: () => {
617
- var q;
618
- const b = ((q = s.currentPageData) == null ? void 0 : q.id) || "";
619
- e(b).then(() => {
620
- s.updateTreeData(), Y(), M({
638
+ var l;
639
+ const P = ((l = o.currentPageData) == null ? void 0 : l.id) || "";
640
+ e(P).then(() => {
641
+ o.updateTreeData(), X(), M({
621
642
  type: "success",
622
643
  message: "删除文件夹成功!"
623
644
  });
624
- }).catch((A) => {
645
+ }).catch((u) => {
625
646
  M({
626
647
  type: "success",
627
648
  title: "删除文件夹失败!",
628
- message: JSON.stringify((A == null ? void 0 : A.message) || A)
649
+ message: JSON.stringify((u == null ? void 0 : u.message) || u)
629
650
  });
630
651
  });
631
652
  }
632
653
  });
633
654
  }),
634
- pageGeneral: l,
635
- folderGeneralRef: _,
636
- closeFolderSettingPanel: Y,
637
- isShow: Ve,
638
- state: a,
639
- pageSettingState: s,
640
- closeFolderSetting: y
655
+ pageGeneral: g,
656
+ folderGeneralRef: I,
657
+ closeFolderSettingPanel: X,
658
+ isShow: Be,
659
+ state: t,
660
+ pageSettingState: o,
661
+ closeFolderSetting: f
641
662
  };
642
663
  }
643
- }, $t = { class: "page-setting-content" };
644
- function ea(a, t, n, e, s, o) {
645
- const r = P("tiny-button"), c = P("svg-button"), l = P("button-group"), _ = P("tiny-collapse-item"), y = P("tiny-collapse"), f = P("plugin-setting");
646
- return e.isShow ? (v(), H(f, {
664
+ }, na = { class: "page-setting-content" };
665
+ function oa(t, a, n, e, o, s) {
666
+ const r = D("tiny-button"), c = D("svg-button"), g = D("button-group"), I = D("tiny-collapse-item"), y = D("tiny-collapse"), m = D("plugin-setting");
667
+ return e.isShow ? (v(), H(m, {
647
668
  key: 0,
669
+ "fixed-name": e.PLUGIN_NAME.AppManage,
670
+ align: e.align,
648
671
  title: e.state.title,
649
672
  class: "pageFolder-plugin-setting"
650
673
  }, {
651
- header: S(() => [
652
- d(l, null, {
653
- default: S(() => [
654
- d(r, {
674
+ header: C(() => [
675
+ p(g, null, {
676
+ default: C(() => [
677
+ p(r, {
655
678
  type: "primary",
656
679
  onClick: e.saveFolderSetting
657
680
  }, {
658
- default: S(() => t[1] || (t[1] = [
659
- ue("保存")
681
+ default: C(() => a[1] || (a[1] = [
682
+ ie("保存")
660
683
  ])),
661
684
  _: 1
662
685
  }, 8, ["onClick"]),
@@ -667,7 +690,7 @@ function ea(a, t, n, e, s, o) {
667
690
  tips: "删除",
668
691
  onClick: e.deleteFolder
669
692
  }, null, 8, ["onClick"])),
670
- d(c, {
693
+ p(c, {
671
694
  class: "close-plugin-setting-icon",
672
695
  name: "close",
673
696
  onClick: e.closeFolderSetting
@@ -676,19 +699,19 @@ function ea(a, t, n, e, s, o) {
676
699
  _: 1
677
700
  })
678
701
  ]),
679
- content: S(() => [
680
- V("div", $t, [
681
- d(y, {
702
+ content: C(() => [
703
+ A("div", na, [
704
+ p(y, {
682
705
  modelValue: e.state.activeName,
683
- "onUpdate:modelValue": t[0] || (t[0] = (k) => e.state.activeName = k)
706
+ "onUpdate:modelValue": a[0] || (a[0] = (h) => e.state.activeName = h)
684
707
  }, {
685
- default: S(() => [
686
- d(_, {
708
+ default: C(() => [
709
+ p(I, {
687
710
  title: "基本设置",
688
711
  name: "folderGeneralRef"
689
712
  }, {
690
- default: S(() => [
691
- (v(), H(Je(e.pageGeneral), {
713
+ default: C(() => [
714
+ (v(), H(ze(e.pageGeneral), {
692
715
  ref: "folderGeneralRef",
693
716
  isFolder: n.isFolder
694
717
  }, null, 8, ["isFolder"]))
@@ -701,15 +724,15 @@ function ea(a, t, n, e, s, o) {
701
724
  ])
702
725
  ]),
703
726
  _: 1
704
- }, 8, ["title"])) : j("", !0);
727
+ }, 8, ["fixed-name", "align", "title"])) : j("", !0);
705
728
  }
706
- const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3e"]]), aa = {
729
+ const sa = /* @__PURE__ */ Z(aa, [["render", oa], ["__scopeId", "data-v-21dedc52"]]), ra = {
707
730
  key: 0,
708
731
  width: "24",
709
732
  height: "24",
710
733
  viewBox: "0 0 24 24",
711
734
  xmlns: "http://www.w3.org/2000/svg"
712
- }, na = {
735
+ }, la = {
713
736
  key: 0,
714
737
  x1: "8",
715
738
  y1: "12",
@@ -717,7 +740,7 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
717
740
  y2: "12",
718
741
  stroke: "#EBEBEB",
719
742
  "stroke-width": "1"
720
- }, oa = {
743
+ }, ia = {
721
744
  key: 1,
722
745
  x1: "8",
723
746
  y1: "12",
@@ -725,7 +748,7 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
725
748
  y2: "24",
726
749
  stroke: "#EBEBEB",
727
750
  "stroke-width": "1"
728
- }, sa = {
751
+ }, ca = /* @__PURE__ */ Qe({
729
752
  __name: "LayerLines",
730
753
  props: {
731
754
  level: {
@@ -737,13 +760,13 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
737
760
  required: !0
738
761
  }
739
762
  },
740
- setup(a) {
741
- return (t, n) => (v(!0), U(oe, null, Se(a.level - 1, (e) => (v(), U("span", {
763
+ setup(t) {
764
+ return (a, n) => (v(!0), U(ce, null, De(t.level - 1, (e) => (v(), U("span", {
742
765
  key: e,
743
766
  class: "gap"
744
767
  }, [
745
- a.lineData[e] ? (v(), U("svg", aa, [
746
- n[0] || (n[0] = V("line", {
768
+ t.lineData[e] ? (v(), U("svg", ra, [
769
+ n[0] || (n[0] = A("line", {
747
770
  x1: "8",
748
771
  y1: "0",
749
772
  x2: "8",
@@ -751,12 +774,12 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
751
774
  stroke: "#EBEBEB",
752
775
  "stroke-width": "1"
753
776
  }, null, -1)),
754
- (a.lineData[e] & 1) === 1 ? (v(), U("line", na)) : j("", !0),
755
- (a.lineData[e] >> 1 & 1) === 1 ? (v(), U("line", oa)) : j("", !0)
777
+ (t.lineData[e] & 1) === 1 ? (v(), U("line", la)) : j("", !0),
778
+ (t.lineData[e] >> 1 & 1) === 1 ? (v(), U("line", ia)) : j("", !0)
756
779
  ])) : j("", !0)
757
780
  ]))), 128));
758
781
  }
759
- }, ra = /* @__PURE__ */ te(sa, [["__scopeId", "data-v-c0e056d7"]]), la = ["draggable", "onDragstart", "onDragover", "onDragenter", "onDrop"], ca = ["onClick"], ia = { class: "prefix-icon" }, ga = {
782
+ }), ua = /* @__PURE__ */ Z(ca, [["__scopeId", "data-v-fe0c65d9"]]), ga = ["draggable", "onDragstart", "onDragover", "onDragenter", "onDrop"], da = ["onClick"], pa = { class: "prefix-icon" }, fa = /* @__PURE__ */ Qe({
760
783
  __name: "Tree",
761
784
  props: {
762
785
  data: {
@@ -792,128 +815,128 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
792
815
  }
793
816
  },
794
817
  emits: ["clickRow", "moveNode"],
795
- setup(a, { emit: t }) {
796
- const n = a, e = t, s = (g, D, T = 0) => {
797
- const { idKey: I, labelKey: z, childrenKey: R } = n, ie = {
798
- id: g[I],
799
- label: g[z],
800
- parentId: D,
801
- level: T,
802
- rawData: g
803
- }, ne = [ie], ae = g[R];
804
- if (Array.isArray(ae))
805
- for (const Ne of ae)
806
- ne.push(...s(Ne, ie.id, T + 1));
807
- return ne;
808
- }, o = $(() => s({ [n.idKey]: n.rootId, [n.childrenKey]: n.data }).slice(1)), r = $(() => o.value.reduce((g, D) => (g[D.id] = D, g), {})), c = $(() => o.value.filter((g) => g.label.toLowerCase().includes(n.filterValue))), l = (g) => {
809
- const D = r.value[g];
810
- if (!D || !D.parentId)
818
+ setup(t, { emit: a }) {
819
+ const n = t, e = a, o = (l, u, N = 0) => {
820
+ const { idKey: F, labelKey: q, childrenKey: x } = n, re = {
821
+ id: l[F],
822
+ label: l[q],
823
+ parentId: u,
824
+ level: N,
825
+ rawData: l
826
+ }, $ = [re], te = l[x];
827
+ if (Array.isArray(te))
828
+ for (const me of te)
829
+ $.push(...o(me, re.id, N + 1));
830
+ return $;
831
+ }, s = z(() => o({ [n.idKey]: n.rootId, [n.childrenKey]: n.data }).slice(1)), r = z(() => s.value.reduce((l, u) => (l[u.id] = u, l), {})), c = z(() => s.value.filter((l) => l.label.toLowerCase().includes(n.filterValue))), g = (l) => {
832
+ const u = r.value[l];
833
+ if (!u || !u.parentId)
811
834
  return [];
812
- const T = l(D.parentId);
813
- return T.push(D.parentId), T;
814
- }, _ = $(() => {
815
- const g = /* @__PURE__ */ new Set();
816
- for (const D of c.value) {
817
- g.add(D.id);
818
- for (const T of l(D.id))
819
- g.add(T);
835
+ const N = g(u.parentId);
836
+ return N.push(u.parentId), N;
837
+ }, I = z(() => {
838
+ const l = /* @__PURE__ */ new Set();
839
+ for (const u of c.value) {
840
+ l.add(u.id);
841
+ for (const N of g(u.id))
842
+ l.add(N);
820
843
  }
821
- return o.value.filter((D) => g.has(D.id));
844
+ return s.value.filter((u) => l.has(u.id));
822
845
  }), y = {
823
846
  node: 1,
824
847
  // └
825
848
  layer: 2
826
- }, f = $(() => {
827
- const g = {}, D = _.value;
828
- for (const [T, I] of D.entries())
829
- if (g[T] = g[T] || {}, g[T][I.level - 1] = y.node, I.parentId !== n.rootId) {
830
- const z = D.findIndex((R) => R.id === I.parentId);
831
- for (let R = z + 1; R < T; R++)
832
- g[R][I.level - 1] = (g[R][I.level - 1] || 0) | y.layer;
849
+ }, m = z(() => {
850
+ const l = {}, u = I.value;
851
+ for (const [N, F] of u.entries())
852
+ if (l[N] = l[N] || {}, l[N][F.level - 1] = y.node, F.parentId !== n.rootId) {
853
+ const q = u.findIndex((x) => x.id === F.parentId);
854
+ for (let x = q + 1; x < N; x++)
855
+ l[x][F.level - 1] = (l[x][F.level - 1] || 0) | y.layer;
833
856
  }
834
- return g;
835
- }), k = (g) => {
836
- e("clickRow", g);
837
- }, m = K(null), h = K(null), i = (g, D) => {
838
- n.draggable && (m.value = D);
839
- }, p = (g, D) => {
857
+ return l;
858
+ }), h = (l) => {
859
+ e("clickRow", l);
860
+ }, f = K(null), b = K(null), w = (l, u) => {
861
+ n.draggable && (f.value = u);
862
+ }, B = (l, u) => {
840
863
  if (!n.draggable)
841
864
  return;
842
- l(D.id).includes(m.value.id) ? h.value = null : (g.preventDefault(), h.value = D.id);
843
- }, b = (g, D) => {
844
- g.preventDefault();
845
- const T = m.value;
846
- if (m.value = null, !T)
865
+ g(u.id).includes(f.value.id) ? b.value = null : (l.preventDefault(), b.value = u.id);
866
+ }, R = (l, u) => {
867
+ l.preventDefault();
868
+ const N = f.value;
869
+ if (f.value = null, !N)
847
870
  return;
848
- !l(D.id).includes(T.id) && T.id !== D.id && T.parentId !== D.id && e("moveNode", T, D);
849
- }, q = () => {
850
- h.value = null;
851
- }, A = (g) => {
852
- n.draggable && g.target === g.currentTarget && (g.preventDefault(), h.value = n.rootId);
853
- }, X = (g) => {
854
- n.draggable && g.target === g.currentTarget && (h.value = null);
871
+ !g(u.id).includes(N.id) && N.id !== u.id && N.parentId !== u.id && e("moveNode", N, u);
872
+ }, J = () => {
873
+ b.value = null;
874
+ }, d = (l) => {
875
+ n.draggable && l.target === l.currentTarget && (l.preventDefault(), b.value = n.rootId);
876
+ }, P = (l) => {
877
+ n.draggable && l.target === l.currentTarget && (b.value = null);
855
878
  };
856
- return (g, D) => {
857
- const T = P("svg-icon");
879
+ return (l, u) => {
880
+ const N = D("svg-icon");
858
881
  return v(), U("div", {
859
- class: ve(["draggable-tree", "border-transparent", { "hover-border-color": h.value === a.rootId }]),
860
- onDragover: A,
861
- onDragenter: A,
862
- onDragleave: X,
863
- onDrop: D[0] || (D[0] = (I) => b(I, { id: a.rootId }))
882
+ class: he(["draggable-tree", "border-transparent", { "hover-border-color": b.value === t.rootId }]),
883
+ onDragover: d,
884
+ onDragenter: d,
885
+ onDragleave: P,
886
+ onDrop: u[0] || (u[0] = (F) => R(F, { id: t.rootId }))
864
887
  }, [
865
- (v(!0), U(oe, null, Se(_.value, (I, z) => (v(), U("div", {
866
- class: ve([
888
+ (v(!0), U(ce, null, De(I.value, (F, q) => (v(), U("div", {
889
+ class: he([
867
890
  "row",
868
891
  "border-transparent",
869
892
  {
870
- active: String(a.active) === String(I.id),
871
- "hover-border-color": h.value === I.id
893
+ active: String(t.active) === String(F.id),
894
+ "hover-border-color": b.value === F.id
872
895
  }
873
896
  ]),
874
- key: I.id,
875
- draggable: a.draggable ? "true" : void 0,
876
- onDragstart: (R) => i(R, I),
877
- onDragover: (R) => p(R, I),
878
- onDragenter: (R) => p(R, I),
879
- onDrop: (R) => b(R, I),
880
- onDragend: q
897
+ key: F.id,
898
+ draggable: t.draggable ? "true" : void 0,
899
+ onDragstart: (x) => w(x, F),
900
+ onDragover: (x) => B(x, F),
901
+ onDragenter: (x) => B(x, F),
902
+ onDrop: (x) => R(x, F),
903
+ onDragend: J
881
904
  }, [
882
- V("div", {
905
+ A("div", {
883
906
  class: "content",
884
- onClick: (R) => k(I)
907
+ onClick: (x) => h(F)
885
908
  }, [
886
- d(ra, {
887
- "line-data": f.value[z],
888
- level: I.level
909
+ p(ua, {
910
+ "line-data": m.value[q],
911
+ level: F.level
889
912
  }, null, 8, ["line-data", "level"]),
890
- V("div", ia, [
891
- I.rawData.isPage ? (v(), H(T, {
913
+ A("div", pa, [
914
+ F.rawData.isPage ? (v(), H(N, {
892
915
  key: 0,
893
916
  name: "text-page-common"
894
- })) : (v(), H(T, {
917
+ })) : (v(), H(N, {
895
918
  key: 1,
896
919
  name: "text-page-folder-closed"
897
920
  }))
898
921
  ]),
899
- V("label", null, de(I.label), 1)
900
- ], 8, ca),
901
- ot(g.$slots, "row-suffix", { node: I }, void 0, !0)
902
- ], 42, la))), 128))
922
+ A("label", null, ae(F.label), 1)
923
+ ], 8, da),
924
+ ct(l.$slots, "row-suffix", { node: F }, void 0, !0)
925
+ ], 42, ga))), 128))
903
926
  ], 34);
904
927
  };
905
928
  }
906
- }, ua = /* @__PURE__ */ te(ga, [["__scopeId", "data-v-f6908d8b"]]), {
907
- PAGE_STATUS: da
908
- } = Oe, pa = {
929
+ }), ma = /* @__PURE__ */ Z(fa, [["__scopeId", "data-v-8e3037e1"]]), {
930
+ PAGE_STATUS: Pa
931
+ } = we, ya = {
909
932
  components: {
910
- TinySearch: yt,
911
- TinyCollapse: Fe,
912
- TinyCollapseItem: Te,
913
- TinyIconSearch: It(),
914
- TinyPopover: Pt,
915
- DraggableTree: ua,
916
- SvgButton: be
933
+ TinySearch: St,
934
+ TinyCollapse: Ee,
935
+ TinyCollapseItem: Ie,
936
+ TinyIconSearch: Tt(),
937
+ TinyPopover: ht,
938
+ DraggableTree: ma,
939
+ SvgButton: ve
917
940
  },
918
941
  props: {
919
942
  isFolder: {
@@ -921,98 +944,98 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
921
944
  default: !1
922
945
  }
923
946
  },
924
- emits: ["openSettingPanel", "add", "createPage", "createFolder"],
925
- setup(a, {
926
- emit: t
947
+ emits: ["openSettingPanel", "add", "createPage", "createFolder", "settingHome"],
948
+ setup(t, {
949
+ emit: a
927
950
  }) {
928
951
  const {
929
952
  confirm: n
930
- } = se(), {
953
+ } = oe(), {
931
954
  pageState: e,
932
- isBlock: s,
933
- isSaved: o
934
- } = re(), {
955
+ isBlock: o,
956
+ isSaved: s
957
+ } = se(), {
935
958
  pageSettingState: r,
936
959
  changeTreeData: c,
937
- isCurrentDataSame: l,
938
- getPageList: _,
960
+ isCurrentDataSame: g,
961
+ getPageList: I,
939
962
  resetPageData: y,
940
- STATIC_PAGE_GROUP_ID: f,
941
- COMMON_PAGE_GROUP_ID: k,
942
- switchPage: m
943
- } = ee(), {
944
- fetchPageDetail: h,
945
- requestUpdatePage: i
946
- } = ce, p = () => G(B.GlobalService).getBaseInfo().id, b = le({
963
+ STATIC_PAGE_GROUP_ID: m,
964
+ COMMON_PAGE_GROUP_ID: h,
965
+ switchPage: f
966
+ } = Y(), {
967
+ fetchPageDetail: b,
968
+ requestUpdatePage: w
969
+ } = ue, B = () => G(V.GlobalService).getBaseInfo().id, R = ee({
947
970
  pageSearchValue: "",
948
- collapseValue: [f, k],
971
+ collapseValue: [m, h],
949
972
  currentNodeData: {
950
- id: G(B.GlobalService).getBaseInfo().pageId
973
+ id: G(V.GlobalService).getBaseInfo().pageId
951
974
  }
952
975
  }), {
953
- subscribe: q,
954
- unsubscribe: A
955
- } = we();
956
- let X = null;
957
- st(() => {
958
- X = q({
976
+ subscribe: J,
977
+ unsubscribe: d
978
+ } = Ne();
979
+ let P = null;
980
+ ut(() => {
981
+ P = J({
959
982
  topic: "locationHistoryChanged",
960
- callback: (u) => {
961
- u.pageId ? b.currentNodeData = {
962
- id: u.pageId
963
- } : s() && (b.currentNodeData = {});
983
+ callback: (i) => {
984
+ i.pageId ? R.currentNodeData = {
985
+ id: i.pageId
986
+ } : o() && (R.currentNodeData = {});
964
987
  },
965
988
  subscriber: "pageTree"
966
989
  });
967
- }), Be(() => {
968
- X && A(X);
990
+ }), Le(() => {
991
+ P && d(P);
969
992
  });
970
- const g = async (u) => await _(u);
971
- r.updateTreeData = async () => await g(p());
972
- const D = (u) => {
973
- b.currentNodeData = u, m(u.id).then(() => {
974
- Z(), Y();
993
+ const l = async (i) => await I(i);
994
+ r.updateTreeData = async () => await l(B());
995
+ const u = (i) => {
996
+ R.currentNodeData = i, f(i.id).then(() => {
997
+ Q(), X();
975
998
  });
976
- }, T = (u, O) => {
999
+ }, N = (i, _) => {
977
1000
  var W;
978
1001
  const {
979
- id: w,
980
- isPage: J
981
- } = O;
982
- !s() && w === ((W = b == null ? void 0 : b.currentNodeData) == null ? void 0 : W.id) || !J || (o() && l() ? D(O) : n({
1002
+ id: S,
1003
+ isPage: L
1004
+ } = _;
1005
+ !o() && S === ((W = R == null ? void 0 : R.currentNodeData) == null ? void 0 : W.id) || !L || (s() && g() ? u(_) : n({
983
1006
  title: "提示",
984
- message: `${s() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
1007
+ message: `${o() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
985
1008
  exec: () => {
986
- c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), D(O);
1009
+ c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), u(_);
987
1010
  }
988
1011
  }));
989
- }, I = (u, O, w) => {
990
- var J;
991
- if (w && O.isPage) {
992
- const W = ((J = O.occupier) == null ? void 0 : J.username) || "";
993
- se().message({
1012
+ }, F = (i, _, S) => {
1013
+ var L;
1014
+ if (S && _.isPage) {
1015
+ const W = ((L = _.occupier) == null ? void 0 : L.username) || "";
1016
+ oe().message({
994
1017
  message: `您点击的页面被${W}锁定,暂时无法编辑,请联系解锁`
995
1018
  });
996
1019
  return;
997
1020
  }
998
- pe(r.currentPageData, r.currentPageDataCopy) ? t("openSettingPanel", O) : n({
1021
+ de(r.currentPageData, r.currentPageDataCopy) ? a("openSettingPanel", _) : n({
999
1022
  title: "提示",
1000
1023
  message: `当前页面或文件夹${r.currentPageData.name}尚未保存,是否要继续切换?`,
1001
1024
  exec: () => {
1002
- c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), t("openSettingPanel", O);
1025
+ c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), a("openSettingPanel", _);
1003
1026
  }
1004
1027
  });
1005
- }, z = {}, R = (u, O) => {
1006
- z[O] = u;
1007
- }, ie = (u) => {
1008
- T(null, u.rawData);
1009
- }, ne = (u) => $e(u.occupier).state === da.Lock, ae = (u) => {
1010
- I(null, u.rawData, ne(u.rawData));
1011
- }, N = [
1028
+ }, q = {}, x = (i, _) => {
1029
+ q[_] = i;
1030
+ }, re = (i) => {
1031
+ N(null, i.rawData);
1032
+ }, $ = (i) => nt(i.occupier).state === Pa.Lock, te = (i) => {
1033
+ F(null, i.rawData, $(i.rawData));
1034
+ }, le = [
1012
1035
  {
1013
1036
  type: "settings",
1014
1037
  label: "设置",
1015
- action: ae
1038
+ action: te
1016
1039
  },
1017
1040
  {
1018
1041
  type: "divider"
@@ -1020,190 +1043,201 @@ const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3
1020
1043
  {
1021
1044
  type: "createPage",
1022
1045
  label: "新建子页面",
1023
- action: (u) => {
1024
- t("createPage", "staticPages", u.id);
1046
+ action: (i) => {
1047
+ a("createPage", "staticPages", i.id);
1025
1048
  }
1026
1049
  },
1027
1050
  {
1028
1051
  type: "createFolder",
1029
1052
  label: "新建子文件夹",
1030
- action: (u) => {
1031
- t("createFolder", u.id);
1053
+ action: (i) => {
1054
+ a("createFolder", i.id);
1055
+ }
1056
+ },
1057
+ {
1058
+ type: "settingHome",
1059
+ label: "设置为主页",
1060
+ action: (i) => {
1061
+ a("settingHome", i);
1032
1062
  }
1033
1063
  }
1034
1064
  // TODO 复制和删除的逻辑耦合在其他组件内,暂时屏蔽
1035
1065
  // { type: 'divider' },
1036
1066
  // { type: 'copy', label: '复制页面', action: copyPage },
1037
1067
  // { type: 'delete', label: '删除', class: ['danger'], action: deleteNode }
1038
- ].map((u) => ({
1039
- ...u,
1040
- action: (O) => {
1041
- var w, J, W;
1042
- (w = u.action) == null || w.call(u, O), (W = (J = z[O.id]) == null ? void 0 : J.doClose) == null || W.call(J);
1068
+ ].map((i) => ({
1069
+ ...i,
1070
+ action: (_) => {
1071
+ var S, L, W;
1072
+ (S = i.action) == null || S.call(i, _), (W = (L = q[_.id]) == null ? void 0 : L.doClose) == null || W.call(L);
1043
1073
  }
1044
- })), F = (u, O) => u === k ? N.slice(0, 1) : O.rawData.isPage ? N : N.filter((w) => w.type !== "copy"), E = (u) => {
1074
+ })), Ve = (i, _) => i === h ? le.slice(0, 1) : !_.rawData.isPage || _.rawData.group === "public" ? le.filter((S) => S.type !== "settingHome") : le, Pe = (i) => {
1045
1075
  var ge;
1046
1076
  const {
1047
- id: O,
1048
- name: w,
1049
- page_content: J
1050
- } = u, W = {
1051
- ...u,
1077
+ id: _,
1078
+ name: S,
1079
+ page_content: L
1080
+ } = i, W = {
1081
+ ...i,
1052
1082
  page_content: {
1053
- ...J,
1054
- fileName: w
1083
+ ...L,
1084
+ fileName: S
1055
1085
  }
1056
- }, ye = ((ge = e == null ? void 0 : e.currentPage) == null ? void 0 : ge.id) === O;
1057
- return Ze(O, W, !1, ye);
1058
- }, x = (u) => {
1086
+ }, be = ((ge = e == null ? void 0 : e.currentPage) == null ? void 0 : ge.id) === _;
1087
+ return at({
1088
+ id: _,
1089
+ params: W,
1090
+ isCurEditPage: be
1091
+ });
1092
+ }, k = (i) => {
1059
1093
  const {
1060
- id: O
1061
- } = u;
1062
- return i(O, {
1063
- ...u,
1094
+ id: _
1095
+ } = i;
1096
+ return w(_, {
1097
+ ...i,
1064
1098
  page_content: null
1065
1099
  }).then(() => {
1066
1100
  M({
1067
1101
  type: "success",
1068
1102
  message: "更新文件夹成功!"
1069
1103
  });
1070
- }).catch((w) => {
1104
+ }).catch((S) => {
1071
1105
  M({
1072
1106
  type: "error",
1073
1107
  title: "更新文件夹失败",
1074
- message: JSON.stringify((w == null ? void 0 : w.message) || w)
1108
+ message: JSON.stringify((S == null ? void 0 : S.message) || S)
1075
1109
  });
1076
1110
  }).finally(() => {
1077
1111
  r.updateTreeData(), r.isNew = !1;
1078
1112
  });
1079
- }, L = (u, O) => {
1080
- pe(r.currentPageData, r.currentPageDataCopy) ? (Z(), Y(), r.currentPageData.id = u.id, c(O.id, u.parentId), y(), h(u.id).then((w) => {
1081
- w.parentId = O.id, w.isPage ? E(w) : x(w);
1082
- }).catch((w) => {
1113
+ }, T = (i, _) => {
1114
+ de(r.currentPageData, r.currentPageDataCopy) ? (Q(), X(), r.currentPageData.id = i.id, c(_.id, i.parentId), y(), b(i.id).then((S) => {
1115
+ S.parentId = _.id, S.isPage ? Pe(S) : k(S);
1116
+ }).catch((S) => {
1083
1117
  M({
1084
1118
  type: "error",
1085
1119
  title: "移动页面文件/文件夹失败",
1086
- message: JSON.stringify((w == null ? void 0 : w.message) || w)
1120
+ message: JSON.stringify((S == null ? void 0 : S.message) || S)
1087
1121
  });
1088
1122
  })) : n({
1089
1123
  title: "提示",
1090
1124
  message: "更改尚未保存,是否要放弃这些更改?",
1091
1125
  exec: () => {
1092
- r.isNew || (c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy)), Z();
1126
+ r.isNew || (c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy)), Q();
1093
1127
  }
1094
1128
  });
1095
1129
  };
1096
- we().subscribe({
1130
+ Ne().subscribe({
1097
1131
  topic: "app_id_changed",
1098
1132
  subscriber: "page_tree_app_id_changed",
1099
- callback: (u) => {
1100
- g(u);
1133
+ callback: (i) => {
1134
+ l(i);
1101
1135
  }
1102
1136
  });
1103
- const Q = (u) => {
1104
- u.stopPropagation(), u.preventDefault(), t("add");
1137
+ const O = (i) => {
1138
+ i.stopPropagation(), i.preventDefault(), a("add");
1105
1139
  };
1106
- return Be(() => {
1107
- we().unsubscribe({
1140
+ return Le(() => {
1141
+ Ne().unsubscribe({
1108
1142
  topic: "app_id_changed",
1109
1143
  subscriber: "page_tree_app_id_changed"
1110
1144
  });
1111
1145
  }), {
1112
- createPublicPage: Q,
1113
- state: b,
1114
- switchPage: D,
1146
+ createPublicPage: O,
1147
+ state: R,
1148
+ switchPage: u,
1115
1149
  pageSettingState: r,
1116
- setPopoverRef: R,
1117
- IconFolderOpened: kt(),
1118
- IconFolderClosed: wt(),
1119
- getRowOperations: F,
1120
- handleClickRow: ie,
1121
- handleMoveNode: L,
1122
- isPageLocked: ne,
1123
- handleClickPageSettings: ae,
1124
- STATIC_PAGE_GROUP_ID: f
1150
+ setPopoverRef: x,
1151
+ IconFolderOpened: Bt(),
1152
+ IconFolderClosed: kt(),
1153
+ getRowOperations: Ve,
1154
+ handleClickRow: re,
1155
+ handleMoveNode: T,
1156
+ isPageLocked: $,
1157
+ handleClickPageSettings: te,
1158
+ STATIC_PAGE_GROUP_ID: m
1125
1159
  };
1126
1160
  }
1127
- }, ma = { class: "app-manage-search" }, fa = { class: "title" }, Pa = { class: "app-manage-tree" }, ya = {
1128
- class: /* @__PURE__ */ ve(["actions"])
1129
- }, _a = { class: "operation-list" }, ha = ["onClick"];
1130
- function Da(a, t, n, e, s, o) {
1131
- const r = P("tiny-icon-search"), c = P("tiny-search"), l = P("svg-button"), _ = P("tiny-popover"), y = P("draggable-tree"), f = P("tiny-collapse-item"), k = P("tiny-collapse");
1132
- return v(), U(oe, null, [
1133
- V("div", ma, [
1134
- d(c, {
1161
+ }, _a = { class: "app-manage-search" }, Da = { class: "title" }, ha = { class: "app-manage-tree" }, Sa = {
1162
+ class: /* @__PURE__ */ he(["actions"])
1163
+ }, va = { class: "operation-list" }, Ca = ["onClick"];
1164
+ function ba(t, a, n, e, o, s) {
1165
+ const r = D("tiny-icon-search"), c = D("tiny-search"), g = D("svg-button"), I = D("tiny-popover"), y = D("draggable-tree"), m = D("tiny-collapse-item"), h = D("tiny-collapse");
1166
+ return v(), U(ce, null, [
1167
+ A("div", _a, [
1168
+ p(c, {
1135
1169
  modelValue: e.state.pageSearchValue,
1136
- "onUpdate:modelValue": t[0] || (t[0] = (m) => e.state.pageSearchValue = m),
1170
+ "onUpdate:modelValue": a[0] || (a[0] = (f) => e.state.pageSearchValue = f),
1137
1171
  clearable: "",
1138
1172
  placeholder: "搜索"
1139
1173
  }, {
1140
- prefix: S(() => [
1141
- d(r)
1174
+ prefix: C(() => [
1175
+ p(r)
1142
1176
  ]),
1143
1177
  _: 1
1144
1178
  }, 8, ["modelValue"])
1145
1179
  ]),
1146
- d(k, {
1180
+ p(h, {
1147
1181
  modelValue: e.state.collapseValue,
1148
- "onUpdate:modelValue": t[1] || (t[1] = (m) => e.state.collapseValue = m),
1182
+ "onUpdate:modelValue": a[1] || (a[1] = (f) => e.state.collapseValue = f),
1149
1183
  class: "page-manage-collapse lowcode-scrollbar"
1150
1184
  }, {
1151
- default: S(() => [
1152
- (v(!0), U(oe, null, Se(e.pageSettingState.pages, (m, h) => (v(), H(f, {
1153
- key: h,
1154
- name: m.groupId
1185
+ default: C(() => [
1186
+ (v(!0), U(ce, null, De(e.pageSettingState.pages, (f, b) => (v(), H(m, {
1187
+ key: b,
1188
+ name: f.groupId
1155
1189
  }, {
1156
- title: S(() => [
1157
- V("span", fa, de(m.groupName), 1)
1190
+ title: C(() => [
1191
+ A("span", Da, ae(f.groupName), 1)
1158
1192
  ]),
1159
- default: S(() => [
1160
- V("div", Pa, [
1161
- d(y, {
1162
- data: m.data,
1193
+ default: C(() => [
1194
+ A("div", ha, [
1195
+ p(y, {
1196
+ data: f.data,
1163
1197
  "label-key": "name",
1164
1198
  active: e.state.currentNodeData.id,
1165
1199
  "filter-value": e.state.pageSearchValue,
1166
1200
  "root-id": e.pageSettingState.ROOT_ID,
1167
- draggable: m.groupId === e.STATIC_PAGE_GROUP_ID,
1201
+ draggable: f.groupId === e.STATIC_PAGE_GROUP_ID,
1168
1202
  onClickRow: e.handleClickRow,
1169
1203
  onMoveNode: e.handleMoveNode
1170
1204
  }, {
1171
- "row-suffix": S(({ node: i }) => [
1172
- V("div", ya, [
1173
- e.isPageLocked(i.rawData) ? (v(), H(l, {
1205
+ "row-suffix": C(({ node: w }) => [
1206
+ A("div", Sa, [
1207
+ e.isPageLocked(w.rawData) ? (v(), H(g, {
1174
1208
  key: 0,
1175
1209
  name: "locked",
1176
1210
  hoverBgColor: !1
1177
1211
  })) : j("", !0),
1178
- i.rawData.isHome ? (v(), H(l, {
1212
+ w.rawData.isHome ? (v(), H(g, {
1179
1213
  key: 1,
1180
1214
  name: "home",
1181
1215
  hoverBgColor: !1
1182
1216
  })) : j("", !0),
1183
- d(_, {
1217
+ p(I, {
1184
1218
  ref_for: !0,
1185
- ref: (p) => e.setPopoverRef(p, i.id),
1219
+ ref: (B) => e.setPopoverRef(B, w.id),
1186
1220
  placement: "bottom-start",
1187
1221
  "visible-arrow": !1,
1188
1222
  "popper-class": "page-tree-row-operation-list"
1189
1223
  }, {
1190
- reference: S(() => [
1191
- d(l, {
1224
+ reference: C(() => [
1225
+ p(g, {
1192
1226
  name: "ellipsis",
1193
1227
  class: "auto-hidden",
1194
1228
  hoverBgColor: !1
1195
1229
  })
1196
1230
  ]),
1197
- default: S(() => [
1198
- V("div", _a, [
1199
- (v(!0), U(oe, null, Se(e.getRowOperations(m.groupId, i), (p, b) => (v(), U("div", {
1200
- key: b,
1201
- class: ve([p.type === "divider" ? "divider" : "item"].concat(p.class || [])),
1202
- onClick: (q) => {
1203
- var A;
1204
- return (A = p.action) == null ? void 0 : A.call(p, i);
1231
+ default: C(() => [
1232
+ A("div", va, [
1233
+ (v(!0), U(ce, null, De(e.getRowOperations(f.groupId, w), (B, R) => (v(), U("div", {
1234
+ key: R,
1235
+ class: he([B.type === "divider" ? "divider" : "item"].concat(B.class || [])),
1236
+ onClick: (J) => {
1237
+ var d;
1238
+ return (d = B.action) == null ? void 0 : d.call(B, w);
1205
1239
  }
1206
- }, de(p.label), 11, ha))), 128))
1240
+ }, ae(B.label), 11, Ca))), 128))
1207
1241
  ])
1208
1242
  ]),
1209
1243
  _: 2
@@ -1221,138 +1255,180 @@ function Da(a, t, n, e, s, o) {
1221
1255
  }, 8, ["modelValue"])
1222
1256
  ], 64);
1223
1257
  }
1224
- const Sa = /* @__PURE__ */ te(pa, [["render", Da], ["__scopeId", "data-v-566ba8c5"]]), va = {
1225
- getPageById: async (a) => {
1226
- if (a)
1227
- return Ee(a);
1258
+ const Fa = /* @__PURE__ */ Z(ya, [["render", ba], ["__scopeId", "data-v-51086e15"]]), Na = {
1259
+ getPageById: async (t) => {
1260
+ if (t)
1261
+ return Te(t);
1228
1262
  },
1229
- openPageSettingPanel: De
1230
- }, ba = {
1263
+ openPageSettingPanel: _e
1264
+ }, Ia = {
1231
1265
  components: {
1232
- PageSetting: Yt,
1233
- PluginPanel: ft,
1234
- SvgButton: be,
1235
- PageFolderSetting: ta,
1236
- PageTree: Sa
1266
+ PageSetting: ta,
1267
+ PluginPanel: _t,
1268
+ SvgButton: ve,
1269
+ PageFolderSetting: sa,
1270
+ PageTree: Fa
1237
1271
  },
1238
1272
  props: {
1239
1273
  title: {
1240
1274
  type: String,
1241
1275
  default: "页面"
1276
+ },
1277
+ fixedPanels: {
1278
+ type: Array
1242
1279
  }
1243
1280
  },
1244
- setup() {
1281
+ emits: ["close"],
1282
+ setup(t, {
1283
+ emit: a
1284
+ }) {
1245
1285
  const {
1246
- pageState: a
1247
- } = re(), {
1248
- pageSettingState: t,
1249
- getDefaultPage: n,
1250
- isTemporaryPage: e,
1251
- initCurrentPageData: s
1252
- } = ee(), o = K(null), r = t.ROOT_ID, c = it().getDocsUrl("page"), l = le({
1286
+ confirm: n
1287
+ } = oe(), {
1288
+ pageState: e
1289
+ } = se(), {
1290
+ pageSettingState: o,
1291
+ getDefaultPage: s,
1292
+ isTemporaryPage: r,
1293
+ initCurrentPageData: c
1294
+ } = Y(), {
1295
+ PLUGIN_NAME: g
1296
+ } = ne(), I = ee({
1297
+ emitEvent: a
1298
+ });
1299
+ He("panelState", I);
1300
+ const y = K(null), m = o.ROOT_ID, h = dt().getDocsUrl("page"), f = ee({
1253
1301
  isFolder: !1
1254
- }), _ = (h, i = r) => {
1255
- Y(), t.isNew = !0;
1302
+ }), b = (P, l = m) => {
1303
+ X(), o.isNew = !0;
1256
1304
  try {
1257
- const p = n();
1258
- if (!p)
1305
+ const u = s();
1306
+ if (!u)
1259
1307
  throw new Error("Failed to get default page configuration");
1260
- t.currentPageData = {
1261
- ...n(),
1262
- ...p,
1263
- parentId: i,
1308
+ o.currentPageData = {
1309
+ ...s(),
1310
+ ...u,
1311
+ parentId: l,
1264
1312
  route: "",
1265
1313
  name: "Untitled",
1266
1314
  page_content: {
1267
1315
  lifeCycles: {}
1268
1316
  },
1269
- group: h
1317
+ group: P
1270
1318
  };
1271
- } catch {
1319
+ } catch (u) {
1320
+ throw new Error(u);
1272
1321
  }
1273
- t.currentPageDataCopy = me(!0, {}, t.currentPageData), l.isFolder = !1, De();
1274
- }, y = (h = r) => {
1275
- Z(), t.isNew = !0, t.currentPageData = {
1276
- parentId: h,
1322
+ o.currentPageDataCopy = pe(!0, {}, o.currentPageData), f.isFolder = !1, _e();
1323
+ }, w = (P = m) => {
1324
+ Q(), o.isNew = !0, o.currentPageData = {
1325
+ parentId: P,
1277
1326
  route: "",
1278
1327
  name: "untitled"
1279
- }, t.currentPageDataCopy = me(!0, {}, t.currentPageData), l.isFolder = !0, Le();
1328
+ }, o.currentPageDataCopy = pe(!0, {}, o.currentPageData), f.isFolder = !0, Ke();
1329
+ }, B = (P) => {
1330
+ n({
1331
+ title: "提示",
1332
+ type: "warning ",
1333
+ message: "是否确定要将此页面设置为主页?",
1334
+ exec: () => {
1335
+ const l = {
1336
+ ...P.rawData,
1337
+ isHome: !0
1338
+ };
1339
+ ot(P.id, l).then(() => {
1340
+ o.updateTreeData(), o.isNew = !1, M({
1341
+ message: "主页设置成功!",
1342
+ type: "success"
1343
+ });
1344
+ }).catch(() => {
1345
+ M({
1346
+ message: "主页设置失败!",
1347
+ type: "error"
1348
+ });
1349
+ });
1350
+ }
1351
+ });
1280
1352
  };
1281
- Pe(() => {
1282
- e.saved && De();
1353
+ Se(() => {
1354
+ r.saved && _e();
1283
1355
  });
1284
- const f = async (h) => {
1285
- l.isFolder = !h.isPage, t.isNew = !1;
1286
- const i = h.id !== t.currentPageData.id;
1287
- l.isFolder ? (i && Z(), Le()) : (i && Y(), De());
1288
- const p = await Ee(h == null ? void 0 : h.id);
1289
- s(p);
1356
+ const R = async (P) => {
1357
+ f.isFolder = !P.isPage, o.isNew = !1;
1358
+ const l = P.id !== o.currentPageData.id;
1359
+ f.isFolder ? (l && Q(), Ke()) : (l && X(), _e());
1360
+ const u = await Te(P == null ? void 0 : P.id);
1361
+ c(u);
1290
1362
  };
1291
- return rt("openSettingPanel", f), {
1292
- state: l,
1293
- pageState: a,
1294
- openNewPage: (h) => {
1295
- o.value.switchPage(h);
1363
+ return He("openSettingPanel", R), {
1364
+ PLUGIN_NAME: g,
1365
+ state: f,
1366
+ pageState: e,
1367
+ openNewPage: (P) => {
1368
+ y.value.switchPage(P);
1296
1369
  },
1297
- pageTreeRef: o,
1370
+ pageTreeRef: y,
1298
1371
  pluginPanelClosed: () => {
1299
- Z(), Y();
1372
+ a("close"), Q(), X();
1300
1373
  },
1301
- openSettingPanel: f,
1302
- createNewFolder: y,
1303
- createNewPage: _,
1304
- docsUrl: c
1374
+ openSettingPanel: R,
1375
+ createNewFolder: w,
1376
+ createNewPage: b,
1377
+ docsUrl: h,
1378
+ settingHome: B
1305
1379
  };
1306
1380
  }
1307
- };
1308
- function Ca(a, t, n, e, s, o) {
1309
- const r = P("svg-button"), c = P("page-tree"), l = P("plugin-panel"), _ = P("page-setting"), y = P("page-folder-setting");
1310
- return v(), U(oe, null, [
1311
- d(l, {
1381
+ }, Ea = { class: "plugin-page" };
1382
+ function wa(t, a, n, e, o, s) {
1383
+ const r = D("svg-button"), c = D("page-tree"), g = D("plugin-panel"), I = D("page-setting"), y = D("page-folder-setting");
1384
+ return v(), U("div", Ea, [
1385
+ p(g, {
1312
1386
  title: n.title,
1387
+ "fixed-name": e.PLUGIN_NAME.AppManage,
1388
+ fixedPanels: n.fixedPanels,
1313
1389
  onClose: e.pluginPanelClosed,
1314
1390
  docsUrl: e.docsUrl,
1315
- isShowDocsIcon: !0,
1316
- class: "page-manage"
1391
+ isShowDocsIcon: !0
1317
1392
  }, {
1318
- header: S(() => [
1319
- d(r, {
1393
+ header: C(() => [
1394
+ p(r, {
1320
1395
  class: "add-folder-icon",
1321
1396
  name: "add-folder",
1322
1397
  placement: "bottom",
1323
1398
  tips: "新建文件夹",
1324
- onClick: t[0] || (t[0] = (f) => e.createNewFolder())
1399
+ onClick: a[0] || (a[0] = (m) => e.createNewFolder())
1325
1400
  }),
1326
- d(r, {
1401
+ p(r, {
1327
1402
  class: "new-page-icon",
1328
1403
  name: "new-page",
1329
1404
  placement: "bottom",
1330
1405
  tips: "新建页面",
1331
- onClick: t[1] || (t[1] = (f) => e.createNewPage("staticPages"))
1406
+ onClick: a[1] || (a[1] = (m) => e.createNewPage("staticPages"))
1332
1407
  })
1333
1408
  ]),
1334
- content: S(() => [
1335
- d(c, {
1409
+ content: C(() => [
1410
+ p(c, {
1336
1411
  ref: "pageTreeRef",
1337
1412
  isFolder: e.state.isFolder,
1338
- onAdd: t[2] || (t[2] = (f) => e.createNewPage("publicPages")),
1413
+ onAdd: a[2] || (a[2] = (m) => e.createNewPage("publicPages")),
1339
1414
  onOpenSettingPanel: e.openSettingPanel,
1340
1415
  onCreatePage: e.createNewPage,
1341
- onCreateFolder: e.createNewFolder
1342
- }, null, 8, ["isFolder", "onOpenSettingPanel", "onCreatePage", "onCreateFolder"])
1416
+ onCreateFolder: e.createNewFolder,
1417
+ onSettingHome: e.settingHome
1418
+ }, null, 8, ["isFolder", "onOpenSettingPanel", "onCreatePage", "onCreateFolder", "onSettingHome"])
1343
1419
  ]),
1344
1420
  _: 1
1345
- }, 8, ["title", "onClose", "docsUrl"]),
1346
- d(_, {
1421
+ }, 8, ["title", "fixed-name", "fixedPanels", "onClose", "docsUrl"]),
1422
+ p(I, {
1347
1423
  isFolder: e.state.isFolder,
1348
1424
  onOpenNewPage: e.openNewPage
1349
1425
  }, null, 8, ["isFolder", "onOpenNewPage"]),
1350
- d(y, {
1426
+ p(y, {
1351
1427
  isFolder: e.state.isFolder
1352
1428
  }, null, 8, ["isFolder"])
1353
- ], 64);
1429
+ ]);
1354
1430
  }
1355
- const Na = /* @__PURE__ */ te(ba, [["render", Ca], ["__scopeId", "data-v-6fa41cfe"]]), { ELEMENT_TAG: Ia, COMPONENT_NAME: wa } = Oe, _e = {
1431
+ const Ta = /* @__PURE__ */ Z(Ia, [["render", wa], ["__scopeId", "data-v-7bd6cd0f"]]), { ELEMENT_TAG: ka, COMPONENT_NAME: Ba } = we, ye = {
1356
1432
  app: "",
1357
1433
  name: "",
1358
1434
  route: "",
@@ -1376,7 +1452,7 @@ const Na = /* @__PURE__ */ te(ba, [["render", Ca], ["__scopeId", "data-v-6fa41cf
1376
1452
  parentId: "none",
1377
1453
  isBody: !1,
1378
1454
  group: "staticPages"
1379
- }, ka = K(null), C = le({
1455
+ }, Oa = K(null), E = ee({
1380
1456
  currentPageDataCopy: {},
1381
1457
  // 记录当前页最开始的状态,当用户点击取消按钮的时候恢复到初始状态
1382
1458
  currentPageData: {},
@@ -1387,292 +1463,221 @@ const Na = /* @__PURE__ */ te(ba, [["render", Ca], ["__scopeId", "data-v-6fa41cf
1387
1463
  ROOT_ID: "0",
1388
1464
  // 根节点ID
1389
1465
  updateTreeData: null,
1390
- treeDataMapping: {}
1391
- }), Ta = le({
1466
+ treeDataMapping: {},
1467
+ defaultPage: null
1468
+ // 当前页设置的默认页
1469
+ }), xa = ee({
1392
1470
  saved: !1
1393
- }), Re = 0, tt = 1, Fa = (a, t) => {
1394
- var s, o;
1395
- if (!((s = a == null ? void 0 : a.pageBaseStyle) != null && s.className) || !((o = a == null ? void 0 : a.pageBaseStyle) != null && o.style))
1471
+ }), Oe = 0, rt = 1, Aa = (t, a) => {
1472
+ var o, s;
1473
+ if (!((o = t == null ? void 0 : t.pageBaseStyle) != null && o.className) || !((s = t == null ? void 0 : t.pageBaseStyle) != null && s.style))
1396
1474
  return "";
1397
1475
  const n = (r, c) => `.${r} {
1398
1476
  ${c.trim()}
1399
1477
  }
1400
- `, e = `.${a.pageBaseStyle.className}{\r
1401
- ${a.pageBaseStyle.style}\r
1478
+ `, e = `.${t.pageBaseStyle.className}{\r
1479
+ ${t.pageBaseStyle.style}\r
1402
1480
  }\r
1403
1481
  `;
1404
- return t.useBaseStyle ? [
1405
- n(a.pageBaseStyle.className, a.pageBaseStyle.style),
1406
- n(t.blockBaseStyle.className, t.blockBaseStyle.style),
1407
- n(t.componentBaseStyle.className, t.componentBaseStyle.style)
1482
+ return a.useBaseStyle ? [
1483
+ n(t.pageBaseStyle.className, t.pageBaseStyle.style),
1484
+ n(a.blockBaseStyle.className, a.blockBaseStyle.style),
1485
+ n(a.componentBaseStyle.className, a.componentBaseStyle.style)
1408
1486
  ].join(`
1409
1487
  `) : e;
1410
- }, Oa = () => {
1411
- const a = Me("engine.plugins.materials"), t = Me("engine.plugins.appmanage");
1412
- return !a || !t || !t.pageBaseStyle ? { ..._e } : {
1413
- ..._e,
1488
+ }, Ga = () => {
1489
+ const t = qe("engine.plugins.materials"), a = qe("engine.plugins.appmanage");
1490
+ return !t || !a || !a.pageBaseStyle ? { ...ye } : {
1491
+ ...ye,
1414
1492
  page_content: {
1415
- ..._e.page_content,
1493
+ ...ye.page_content,
1416
1494
  props: {
1417
- ..._e.page_content.props,
1418
- className: t.pageBaseStyle.className
1495
+ ...ye.page_content.props,
1496
+ className: a.pageBaseStyle.className
1419
1497
  },
1420
- css: Fa(t, a)
1498
+ css: Aa(a, t)
1421
1499
  }
1422
1500
  };
1423
- }, Ea = () => {
1424
- const a = C.currentPageData || {}, t = C.currentPageDataCopy || {};
1501
+ }, Va = () => {
1502
+ const t = E.currentPageData || {}, a = E.currentPageDataCopy || {};
1425
1503
  let n = !0;
1426
- return Object.keys(t).some((e) => {
1504
+ return Object.keys(a).some((e) => {
1427
1505
  if (["children", "label", "createdBy", "assets", "occupier"].includes(e))
1428
1506
  return !1;
1429
1507
  if (e === "page_content") {
1430
- const s = {
1431
- inputs: t[e].inputs,
1432
- outputs: t[e].outputs,
1433
- lifeCycles: t[e].lifeCycles
1434
- }, o = {
1508
+ const o = {
1435
1509
  inputs: a[e].inputs,
1436
1510
  outputs: a[e].outputs,
1437
1511
  lifeCycles: a[e].lifeCycles
1512
+ }, s = {
1513
+ inputs: t[e].inputs,
1514
+ outputs: t[e].outputs,
1515
+ lifeCycles: t[e].lifeCycles
1438
1516
  };
1439
- JSON.stringify(s) !== JSON.stringify(o) && (n = !1);
1517
+ JSON.stringify(o) !== JSON.stringify(s) && (n = !1);
1440
1518
  } else
1441
- t[e] !== a[e] && (n = !1);
1519
+ a[e] !== t[e] && (n = !1);
1442
1520
  return !n;
1443
1521
  }), n;
1444
- }, qe = (a) => a === C.ROOT_ID ? { id: C.ROOT_ID, children: C.pages[Re].data } : C.treeDataMapping[a], xa = (a, t) => {
1522
+ }, We = (t) => t === E.ROOT_ID ? { id: E.ROOT_ID, children: E.pages[Oe].data } : E.treeDataMapping[t], Ra = (t, a) => {
1445
1523
  var n, e;
1446
- if (a && t && String(a) !== String(t)) {
1447
- const s = qe(a), o = qe(t);
1448
- if (!s || !o)
1524
+ if (t && a && String(t) !== String(a)) {
1525
+ const o = We(t), s = We(a);
1526
+ if (!o || !s)
1449
1527
  return;
1450
- const r = C.currentPageData.id, c = (e = (n = o.children) == null ? void 0 : n.findIndex) == null ? void 0 : e.call(n, ({ id: l }) => l === r);
1528
+ const r = E.currentPageData.id, c = (e = (n = s.children) == null ? void 0 : n.findIndex) == null ? void 0 : e.call(n, ({ id: g }) => g === r);
1451
1529
  if (c > -1) {
1452
- const l = o.children.splice(c, 1)[0];
1453
- s.children || (s.children = []), s.children.unshift(l);
1530
+ const g = s.children.splice(c, 1)[0];
1531
+ o.children || (o.children = []), o.children.unshift(g);
1454
1532
  }
1455
1533
  }
1456
- }, Va = () => C.currentPageData.page_content || {}, Ra = (a) => {
1457
- C.currentPageData = a, C.currentPageDataCopy = me(!0, {}, a), C.oldParentId = a.parentId;
1458
- }, Ga = () => {
1459
- C.currentPageData = {}, C.currentPageDataCopy = {}, C.oldParentId = null;
1460
- }, Ba = () => !pe(C.currentPageData, C.currentPageDataCopy), je = (a) => {
1461
- const { ROOT_ID: t } = C, n = { [t]: { id: t } };
1462
- return a.forEach((e) => {
1534
+ }, Ma = () => E.currentPageData.page_content || {}, La = (t) => {
1535
+ E.currentPageData = t, E.currentPageDataCopy = pe(!0, {}, t), E.oldParentId = t.parentId;
1536
+ }, Ha = () => {
1537
+ E.currentPageData = {}, E.currentPageDataCopy = {}, E.oldParentId = null, E.defaultPage = null;
1538
+ }, Ua = () => !de(E.currentPageData, E.currentPageDataCopy), Xe = (t) => {
1539
+ const { ROOT_ID: a } = E, n = { [a]: { id: a } };
1540
+ return t.forEach((e) => {
1463
1541
  n[e.id] = e;
1464
- }), a.forEach((e) => {
1465
- const s = n[e.parentId];
1466
- s && (s.children = s.children || [], s.children.push(e));
1542
+ }), t.forEach((e) => {
1543
+ const o = n[e.parentId];
1544
+ o && (o.children = o.children || [], o.children.push(e));
1467
1545
  }), n;
1468
- }, Ce = async (a) => {
1469
- const t = await ce.fetchPageList(a || G(B.GlobalService).getBaseInfo().id), n = { groupName: "静态页面", groupId: Re, data: [] }, e = { groupName: "公共页面", groupId: tt, data: [] };
1470
- t.forEach((r) => {
1471
- const c = r.name ? r : { ...r, name: r.folderName, group: "staticPages" }, l = r.meta ? {
1546
+ }, Ce = async (t) => {
1547
+ const a = await ue.fetchPageList(t || G(V.GlobalService).getBaseInfo().id), n = { groupName: "静态页面", groupId: Oe, data: [] }, e = { groupName: "公共页面", groupId: rt, data: [] };
1548
+ a.forEach((r) => {
1549
+ const c = r.name ? r : { ...r, name: r.folderName, group: "staticPages" }, g = r.meta ? {
1472
1550
  ...r,
1473
1551
  ...r.meta,
1474
1552
  name: r.fileName,
1475
1553
  isPage: !0,
1476
- isBody: r.meta.rootElement === Ia.Body
1477
- } : c, { children: _, ...y } = l;
1478
- l.group === "staticPages" ? n.data.push(y) : e.data.push(y);
1554
+ isBody: r.meta.rootElement === ka.Body
1555
+ } : c, { children: I, ...y } = g;
1556
+ g.group === "staticPages" ? n.data.push(y) : e.data.push(y);
1479
1557
  });
1480
- const s = je(n.data), o = je(e.data);
1481
- return C.treeDataMapping = { ...s, ...o }, n.data = s[C.ROOT_ID].children, C.pages = [n, e], C.pages;
1482
- }, Ge = (a) => {
1483
- if (a === C.ROOT_ID)
1558
+ const o = Xe(n.data), s = Xe(e.data);
1559
+ return E.treeDataMapping = { ...o, ...s }, n.data = o[E.ROOT_ID].children, E.pages = [n, e], E.pages;
1560
+ }, xe = (t) => {
1561
+ if (t === E.ROOT_ID)
1484
1562
  return [];
1485
- const t = C.treeDataMapping[a];
1486
- return [t].concat(Ge(t.parentId));
1487
- }, Aa = async (a, t) => {
1488
- if (C.pages.length === 0 && await Ce(), !C.treeDataMapping[a])
1563
+ const a = E.treeDataMapping[t];
1564
+ return [a].concat(xe(a.parentId));
1565
+ }, qa = async (t, a) => {
1566
+ if (E.pages.length === 0 && await Ce(), !E.treeDataMapping[t])
1489
1567
  return null;
1490
- const e = Ge(a).slice(1).reverse(), s = t ? () => !0 : (o) => o.isPage;
1491
- return e.filter(s).map((o) => o.id);
1492
- }, at = (a) => {
1493
- if (a.every((n) => n.isPage))
1494
- return a;
1495
- const t = a.map((n) => n.isPage ? n : (n.children || []).map((e) => ({
1568
+ const e = xe(t).slice(1).reverse(), o = a ? () => !0 : (s) => s.isPage;
1569
+ return e.filter(o).map((s) => s.id);
1570
+ }, lt = (t) => {
1571
+ if (t.every((n) => n.isPage))
1572
+ return t;
1573
+ const a = t.map((n) => n.isPage ? n : (n.children || []).map((e) => ({
1496
1574
  ...e,
1497
1575
  routePath: `${n.routePath || n.route}/${e.route}`
1498
1576
  }))).flat();
1499
- return at(t);
1500
- }, Ma = async (a) => {
1501
- C.pages.length === 0 && await Ce();
1502
- const t = C.treeDataMapping[a];
1503
- return Array.isArray(t == null ? void 0 : t.children) ? at(t.children) : [];
1504
- }, Ha = () => {
1505
- const { pageState: a } = re();
1506
- a.currentVm = null, a.hoverVm = null, a.properties = {}, a.pageSchema = null;
1507
- }, nt = (a, t = !1) => {
1508
- if (Ha(), a !== 0 && !a) {
1509
- t ? G(B.GlobalService).updateParams({ pageId: "", previewId: "" }) : G(B.GlobalService).updatePageId(""), re().initData({ componentName: wa.Page }, {}), he().layoutState.pageStatus = {
1577
+ return lt(a);
1578
+ }, ja = async (t) => {
1579
+ E.pages.length === 0 && await Ce();
1580
+ const a = E.treeDataMapping[t];
1581
+ return Array.isArray(a == null ? void 0 : a.children) ? lt(a.children) : [];
1582
+ }, Ja = () => {
1583
+ const { pageState: t } = se();
1584
+ t.currentVm = null, t.hoverVm = null, t.properties = {}, t.pageSchema = null;
1585
+ }, it = (t, a = !1) => {
1586
+ if (Ja(), t !== 0 && !t) {
1587
+ a ? G(V.GlobalService).updateParams({ pageId: "", previewId: "" }) : G(V.GlobalService).updatePageId(""), se().initData({ componentName: Ba.Page }, {}), ne().layoutState.pageStatus = {
1510
1588
  state: "empty",
1511
1589
  data: {}
1512
1590
  };
1513
1591
  return;
1514
1592
  }
1515
- return ce.fetchPageDetail(a).then((n) => {
1516
- n.isPage && gt().setBreadcrumbPage([n.name]), t ? G(B.GlobalService).updateParams({ pageId: a, previewId: "" }) : G(B.GlobalService).updatePageId(a), he().closePlugin(), he().layoutState.pageStatus = $e(n.occupier), re().initData(n.page_content, n);
1593
+ return ue.fetchPageDetail(t).then((n) => {
1594
+ n.isPage && pt().setBreadcrumbPage([n.name]), a ? G(V.GlobalService).updateParams({ pageId: t, previewId: "" }) : G(V.GlobalService).updatePageId(t), ne().closePlugin(), ne().layoutState.pageStatus = nt(n.occupier), se().initData(n.page_content, n);
1517
1595
  }).catch(() => {
1518
1596
  M({
1519
1597
  type: "error",
1520
1598
  message: "切换页面失败,目标页面不存在"
1521
1599
  });
1522
1600
  });
1523
- }, Ua = (a, t = !1) => {
1601
+ }, Ka = (t, a = !1) => {
1524
1602
  (() => {
1525
- const { isSaved: e, isBlock: s } = re();
1526
- return new Promise((o) => {
1603
+ const { isSaved: e, isBlock: o } = se();
1604
+ return new Promise((s) => {
1527
1605
  if (e()) {
1528
- o(!0);
1606
+ s(!0);
1529
1607
  return;
1530
1608
  }
1531
- se().confirm({
1609
+ oe().confirm({
1532
1610
  title: "提示",
1533
- message: `${s() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
1611
+ message: `${o() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
1534
1612
  exec: () => {
1535
- o(!0);
1613
+ s(!0);
1536
1614
  },
1537
1615
  cancel: () => {
1538
- o(!1);
1616
+ s(!1);
1539
1617
  }
1540
1618
  });
1541
1619
  });
1542
1620
  })().then((e) => {
1543
- e && nt(a, t);
1621
+ e && it(t, a);
1544
1622
  });
1545
- }, La = (a, t) => {
1623
+ }, Wa = (t, a) => {
1546
1624
  var n, e;
1547
- t.id && ((n = t.pageInfo) != null && n.schema) && a.id === t.id && (a.page_content = (e = t.pageInfo) == null ? void 0 : e.schema);
1548
- }, qa = async (a) => {
1549
- if (!a.page_content)
1625
+ a.id && ((n = a.pageInfo) != null && n.schema) && t.id === a.id && (t.page_content = (e = a.pageInfo) == null ? void 0 : e.schema);
1626
+ }, Xa = async (t) => {
1627
+ if (!t.page_content)
1550
1628
  try {
1551
- const t = await ce.fetchPageDetail(a.id);
1552
- a.page_content = t.page_content;
1553
- } catch {
1554
- a.page_content = {};
1629
+ const a = await ue.fetchPageDetail(t.id);
1630
+ t.page_content = a.page_content;
1631
+ } catch (a) {
1632
+ throw t.page_content = {}, new Error(a);
1555
1633
  }
1556
- }, ja = (a, t, n, e) => {
1557
- var s;
1558
- a.parentId !== e && !t.find((o) => o.id === a.parentId) && (a.parentId = (s = t[n - 1]) != null && s.id ? t[n - 1].id : e);
1559
- }, Ja = async (a, t) => {
1560
- const { ROOT_ID: n } = C;
1561
- a.length > 0 && await Promise.all(
1562
- a.map(async (e, s) => {
1563
- La(e, t), await qa(e), ja(e, a, s, n);
1634
+ }, za = (t, a, n, e) => {
1635
+ var o;
1636
+ t.parentId !== e && !a.find((s) => s.id === t.parentId) && (t.parentId = (o = a[n - 1]) != null && o.id ? a[n - 1].id : e);
1637
+ }, Qa = async (t, a) => {
1638
+ const { ROOT_ID: n } = E;
1639
+ t.length > 0 && await Promise.all(
1640
+ t.map(async (e, o) => {
1641
+ Wa(e, a), await Xa(e), za(e, t, o, n);
1564
1642
  })
1565
1643
  );
1566
- }, Ka = async (a) => {
1567
- C.pages.length === 0 && await Ce();
1568
- const t = Ge(a.id).filter((n) => n.isPage).reverse();
1569
- return await Ja(t, a), t;
1570
- }, Wa = () => ({
1571
- getDefaultPage: Oa,
1572
- selectedTemplateCard: ka,
1573
- pageSettingState: C,
1574
- isTemporaryPage: Ta,
1575
- isCurrentDataSame: Ea,
1576
- changeTreeData: xa,
1577
- getPageContent: Va,
1578
- resetPageData: Ga,
1579
- initCurrentPageData: Ra,
1580
- isChangePageData: Ba,
1644
+ }, Ya = async (t) => {
1645
+ E.pages.length === 0 && await Ce();
1646
+ const a = xe(t.id).filter((n) => n.isPage).reverse();
1647
+ return await Qa(a, t), a;
1648
+ }, Za = () => ({
1649
+ getDefaultPage: Ga,
1650
+ selectedTemplateCard: Oa,
1651
+ pageSettingState: E,
1652
+ isTemporaryPage: xa,
1653
+ isCurrentDataSame: Va,
1654
+ changeTreeData: Ra,
1655
+ getPageContent: Ma,
1656
+ resetPageData: Ha,
1657
+ initCurrentPageData: La,
1658
+ isChangePageData: Ua,
1581
1659
  getPageList: Ce,
1582
- getAncestors: Aa,
1583
- switchPage: nt,
1584
- switchPageWithConfirm: Ua,
1585
- getFamily: Ka,
1586
- getPageChildren: Ma,
1587
- STATIC_PAGE_GROUP_ID: Re,
1588
- COMMON_PAGE_GROUP_ID: tt
1589
- }), Xa = {
1660
+ getAncestors: qa,
1661
+ switchPage: it,
1662
+ switchPageWithConfirm: Ka,
1663
+ getFamily: Ya,
1664
+ getPageChildren: ja,
1665
+ STATIC_PAGE_GROUP_ID: Oe,
1666
+ COMMON_PAGE_GROUP_ID: rt
1667
+ }), $a = {
1590
1668
  id: "engine.service.page",
1591
1669
  type: "MetaService",
1592
- apis: Wa(),
1670
+ apis: Za(),
1593
1671
  composable: {
1594
- name: ut.usePage
1595
- }
1596
- }, za = {
1597
- components: {
1598
- TinyCheckbox: ke
1599
- },
1600
- setup() {
1601
- const { pageSettingState: a, STATIC_PAGE_GROUP_ID: t } = ee(), { handleRouteHomeUpdate: n } = ce, { confirm: e } = se(), s = le({
1602
- checked: !1,
1603
- selectDisable: !1
1604
- });
1605
- Pe(() => {
1606
- var _;
1607
- const l = !!((_ = a.currentPageData) != null && _.isHome);
1608
- s.checked = l, s.selectDisable = l;
1609
- });
1610
- const o = $(() => {
1611
- let l = "暂无主页";
1612
- if (a.pages[t]) {
1613
- const y = a.pages[t].data.filter((f) => f.isHome);
1614
- y[0] && (l = y[0].name);
1615
- }
1616
- return l;
1617
- }), r = lt("openSettingPanel");
1618
- return {
1619
- pageSettingState: a,
1620
- settingHome: () => {
1621
- e({
1622
- title: "提示",
1623
- type: "warning ",
1624
- message: "是否确定要将此页面设置为主页?您所做的任何未保存的更改都将被丢弃。",
1625
- exec: () => {
1626
- const { id: l } = a.currentPageData, _ = { ...a.currentPageData };
1627
- _.isHome = !0, n(l, _).then(() => {
1628
- a.updateTreeData(), r(a.currentPageData), a.isNew = !1, Ye && bt({
1629
- pageId: l,
1630
- componentsTree: _
1631
- }), M({ message: "主页设置成功!", type: "success" });
1632
- }).catch(() => {
1633
- M({ message: "主页设置失败!", type: "error" });
1634
- });
1635
- },
1636
- cancel: () => {
1637
- s.checked = !1;
1638
- }
1639
- });
1640
- },
1641
- homePage: o,
1642
- state: s
1643
- };
1672
+ name: ft.usePage
1644
1673
  }
1645
- }, Qa = { class: "home" }, Ya = { class: "tip" }, Za = { class: "home-page" };
1646
- function $a(a, t, n, e, s, o) {
1647
- const r = P("tiny-checkbox");
1648
- return v(), U("div", Qa, [
1649
- d(r, {
1650
- class: "selectHome",
1651
- modelValue: e.state.checked,
1652
- "onUpdate:modelValue": t[0] || (t[0] = (c) => e.state.checked = c),
1653
- disabled: e.state.selectDisable,
1654
- onChange: e.settingHome
1655
- }, {
1656
- default: S(() => t[1] || (t[1] = [
1657
- ue("设为主页")
1658
- ])),
1659
- _: 1
1660
- }, 8, ["modelValue", "disabled", "onChange"]),
1661
- V("div", Ya, [
1662
- t[2] || (t[2] = V("span", null, "当前主页是", -1)),
1663
- V("span", Za, "【" + de(e.homePage) + "】", 1)
1664
- ])
1665
- ]);
1666
- }
1667
- const en = /* @__PURE__ */ te(za, [["render", $a], ["__scopeId", "data-v-b77a4074"]]), tn = {
1674
+ }, en = {
1668
1675
  components: {
1669
- TinyForm: St,
1670
- TinyFormItem: Dt,
1671
- TinyInput: Qe,
1672
- TinySelect: ht,
1673
- PageHome: en,
1674
- TinyRadio: _t,
1675
- TinyCheckbox: ke
1676
+ TinyForm: Ft,
1677
+ TinyFormItem: bt,
1678
+ TinyInput: tt,
1679
+ TinySelect: Ct,
1680
+ TinyRadio: vt
1676
1681
  },
1677
1682
  props: {
1678
1683
  modelValue: {
@@ -1686,35 +1691,56 @@ const en = /* @__PURE__ */ te(za, [["render", $a], ["__scopeId", "data-v-b77a407
1686
1691
  },
1687
1692
  setup() {
1688
1693
  const {
1689
- pageSettingState: a,
1690
- changeTreeData: t,
1691
- STATIC_PAGE_GROUP_ID: n
1692
- } = ee(), e = a.ROOT_ID, s = $({
1694
+ pageSettingState: t,
1695
+ changeTreeData: a,
1696
+ STATIC_PAGE_GROUP_ID: n,
1697
+ getPageChildren: e
1698
+ } = Y(), o = t.ROOT_ID, s = z({
1693
1699
  get() {
1694
- return String(a.currentPageData.parentId);
1700
+ return String(t.currentPageData.parentId);
1695
1701
  },
1696
- set(i) {
1697
- a.currentPageData.parentId = i;
1702
+ set(d) {
1703
+ t.currentPageData.parentId = d;
1698
1704
  }
1699
- }), o = K(s.value);
1700
- Pe(() => {
1701
- o.value = a.oldParentId;
1705
+ }), r = K(s.value), c = ee({
1706
+ childPageList: [],
1707
+ childPageOp: [],
1708
+ defaultPageId: ""
1709
+ }), g = async (d) => {
1710
+ var P;
1711
+ if (t.isNew)
1712
+ c.childPageList = [], c.childPageOp = [], c.defaultPageId = "";
1713
+ else {
1714
+ c.childPageList = await e(d);
1715
+ const l = (P = c.childPageList) == null ? void 0 : P.find((u) => u.isDefault);
1716
+ t.defaultPage = l || null, c.defaultPageId = l ? l.id : "", c.childPageOp = c.childPageList.map((u) => ({
1717
+ value: u.id,
1718
+ label: u.name,
1719
+ icon: Ot()
1720
+ }));
1721
+ }
1722
+ }, I = () => {
1723
+ t.defaultPage = c.childPageList.find((d) => d.id === c.defaultPageId);
1724
+ };
1725
+ Se(() => {
1726
+ var d;
1727
+ r.value = t.oldParentId, g((d = t.currentPageData) == null ? void 0 : d.id);
1702
1728
  });
1703
- const r = $(() => {
1704
- let i = a.currentPageData.route || "", p = s;
1705
- for (; p !== e; ) {
1706
- const b = a.treeDataMapping[p];
1707
- if (!b)
1729
+ const y = z(() => {
1730
+ let d = t.currentPageData.route || "", P = s.value;
1731
+ for (; P !== o; ) {
1732
+ const l = t.treeDataMapping[P];
1733
+ if (!l)
1708
1734
  break;
1709
- i = `${b.route}/${i}`, p = b.parentId;
1735
+ d = `${l.route}/${d}`, P = l.parentId;
1710
1736
  }
1711
- return i.startsWith("/") && (i = i.slice(1)), i;
1712
- }), c = {
1737
+ return d.startsWith("/") && (d = d.slice(1)), d;
1738
+ }), m = {
1713
1739
  name: [{
1714
1740
  required: !0,
1715
1741
  message: "请输入页面 ID"
1716
1742
  }, {
1717
- pattern: Ft,
1743
+ pattern: At,
1718
1744
  message: "只允许包含英文字母,且为大写开头驼峰格式, 如DemoPage"
1719
1745
  }, {
1720
1746
  min: 3,
@@ -1725,15 +1751,15 @@ const en = /* @__PURE__ */ te(za, [["render", $a], ["__scopeId", "data-v-b77a407
1725
1751
  required: !0,
1726
1752
  message: "请输入页面路由"
1727
1753
  }, {
1728
- pattern: He,
1754
+ pattern: je,
1729
1755
  message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
1730
1756
  }]
1731
- }, l = {
1757
+ }, h = {
1732
1758
  name: [{
1733
1759
  required: !0,
1734
1760
  message: "请输入页面文件夹 ID"
1735
1761
  }, {
1736
- pattern: Tt,
1762
+ pattern: xt,
1737
1763
  message: "只允许包含英文字母、数字、下横线_、中横线-, 且以英文字母开头"
1738
1764
  }, {
1739
1765
  min: 3,
@@ -1744,76 +1770,81 @@ const en = /* @__PURE__ */ te(za, [["render", $a], ["__scopeId", "data-v-b77a407
1744
1770
  required: !0,
1745
1771
  message: "请输入页面文件夹路由"
1746
1772
  }, {
1747
- pattern: He,
1773
+ pattern: je,
1748
1774
  message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
1749
1775
  }],
1750
1776
  group: [{
1751
1777
  required: !0,
1752
1778
  message: "必须选择页面类型"
1753
1779
  }]
1754
- }, _ = (i) => {
1780
+ }, f = (d) => {
1755
1781
  const {
1756
- id: p,
1757
- name: b,
1758
- isPage: q,
1759
- children: A
1760
- } = i, X = {
1761
- id: String(p),
1762
- name: b,
1763
- isPage: q
1782
+ id: P,
1783
+ name: l,
1784
+ isPage: u,
1785
+ children: N
1786
+ } = d, F = {
1787
+ id: String(P),
1788
+ name: l,
1789
+ isPage: u
1764
1790
  };
1765
- return Array.isArray(A) && (X.children = A.filter((g) => g.id !== a.currentPageData.id).map((g) => _(g))), X;
1766
- }, y = (i) => i.id === e ? null : i.isPage ? d(P("SvgIcon"), {
1791
+ return Array.isArray(N) && (F.children = N.filter((q) => q.id !== t.currentPageData.id).map((q) => f(q))), F;
1792
+ }, b = (d) => d.id === o ? null : d.isPage ? p(D("SvgIcon"), {
1767
1793
  name: "text-page-common"
1768
- }, null) : d(P("SvgIcon"), {
1794
+ }, null) : p(D("SvgIcon"), {
1769
1795
  name: "text-page-folder"
1770
- }, null), f = $(() => {
1771
- var A;
1772
- const i = ((A = a.pages[n]) == null ? void 0 : A.data) || [];
1796
+ }, null), w = z(() => {
1797
+ var N;
1798
+ const d = ((N = t.pages[n]) == null ? void 0 : N.data) || [];
1773
1799
  return {
1774
- data: _({
1800
+ data: f({
1775
1801
  children: [{
1776
1802
  name: "无",
1777
- id: e
1778
- }].concat(i)
1803
+ id: o
1804
+ }].concat(d)
1779
1805
  }).children,
1780
1806
  shrinkIcon: null,
1781
1807
  expandIcon: null,
1782
- renderContent: (X, {
1783
- node: g,
1784
- data: D
1785
- }) => d(oe, null, [y(D), d("div", null, [g.label])])
1808
+ renderContent: (F, {
1809
+ node: q,
1810
+ data: x
1811
+ }) => p(ce, null, [b(x), p("div", null, [q.label])])
1786
1812
  };
1787
- }), k = K(null);
1813
+ }), B = K(null);
1788
1814
  return {
1789
- pageRules: c,
1790
- folderRules: l,
1791
- pageSettingState: a,
1815
+ pageRules: m,
1816
+ folderRules: h,
1817
+ pageSettingState: t,
1792
1818
  pageParentId: s,
1793
- generalForm: k,
1794
- validGeneralForm: () => new Promise((i, p) => {
1795
- k.value.validate((b) => {
1796
- b ? i(b) : p(b);
1819
+ generalForm: B,
1820
+ validGeneralForm: () => new Promise((d, P) => {
1821
+ B.value.validate((l) => {
1822
+ l ? d(l) : P(l);
1797
1823
  });
1798
1824
  }),
1799
- treeFolderOp: f,
1800
- currentRoute: r,
1801
- changeParentForderId: (i) => {
1802
- t(i.id, o.value), o.value = i.id;
1803
- }
1825
+ treeFolderOp: w,
1826
+ currentRoute: y,
1827
+ changeParentForderId: (d) => {
1828
+ a(d.id, r.value), r.value = d.id;
1829
+ },
1830
+ state: c,
1831
+ changeDefaultPage: I
1804
1832
  };
1805
1833
  }
1806
- }, an = { class: "general-config" }, nn = { class: "tip" }, on = {
1834
+ }, tn = { class: "general-config" }, an = { class: "tip" }, nn = {
1807
1835
  key: 0,
1808
1836
  class: "text"
1809
- }, sn = {
1837
+ }, on = {
1810
1838
  key: 1,
1811
1839
  class: "route-text"
1812
- }, rn = { class: "text-dim" };
1813
- function ln(a, t, n, e, s, o) {
1814
- const r = P("tiny-radio"), c = P("tiny-form-item"), l = P("tiny-input"), _ = P("tiny-select"), y = P("tiny-checkbox"), f = P("tiny-form"), k = P("page-home");
1815
- return v(), U("div", an, [
1816
- d(f, {
1840
+ }, sn = { class: "text-dim" }, rn = {
1841
+ key: 0,
1842
+ class: "tip default-page"
1843
+ }, ln = { class: "text" }, cn = { class: "text-dim" }, un = { class: "text-dim" };
1844
+ function gn(t, a, n, e, o, s) {
1845
+ const r = D("tiny-radio"), c = D("tiny-form-item"), g = D("tiny-input"), I = D("tiny-select"), y = D("tiny-form");
1846
+ return v(), U("div", tn, [
1847
+ p(y, {
1817
1848
  ref: "generalForm",
1818
1849
  model: e.pageSettingState.currentPageData,
1819
1850
  rules: n.isFolder ? e.folderRules : e.pageRules,
@@ -1824,118 +1855,130 @@ function ln(a, t, n, e, s, o) {
1824
1855
  "label-position": "top",
1825
1856
  class: "general-config-form"
1826
1857
  }, {
1827
- default: S(() => [
1828
- n.isFolder ? j("", !0) : (v(), H(c, {
1829
- key: 0,
1830
- prop: "group",
1831
- label: "页面类型",
1832
- class: "form-item-page-type"
1833
- }, {
1834
- default: S(() => [
1835
- d(r, {
1836
- modelValue: e.pageSettingState.currentPageData.group,
1837
- "onUpdate:modelValue": t[0] || (t[0] = (m) => e.pageSettingState.currentPageData.group = m),
1838
- class: "page-type-radio",
1839
- label: "staticPages"
1840
- }, {
1841
- default: S(() => t[6] || (t[6] = [
1842
- ue(" 静态页面 ")
1843
- ])),
1844
- _: 1
1845
- }, 8, ["modelValue"]),
1846
- d(r, {
1847
- modelValue: e.pageSettingState.currentPageData.group,
1848
- "onUpdate:modelValue": t[1] || (t[1] = (m) => e.pageSettingState.currentPageData.group = m),
1849
- class: "page-type-radio",
1850
- label: "publicPages"
1851
- }, {
1852
- default: S(() => t[7] || (t[7] = [
1853
- ue(" 公共页面 ")
1854
- ])),
1855
- _: 1
1856
- }, 8, ["modelValue"])
1857
- ]),
1858
- _: 1
1859
- })),
1860
- d(c, {
1861
- prop: "name",
1862
- label: `${n.isFolder ? "文件夹" : "页面"}名称`
1863
- }, {
1864
- default: S(() => [
1865
- d(l, {
1866
- modelValue: e.pageSettingState.currentPageData.name,
1867
- "onUpdate:modelValue": t[2] || (t[2] = (m) => e.pageSettingState.currentPageData.name = m),
1868
- placeholder: `请设置${n.isFolder ? "文件夹" : "页面"}名称`
1869
- }, null, 8, ["modelValue", "placeholder"])
1870
- ]),
1871
- _: 1
1872
- }, 8, ["label"]),
1873
- e.pageSettingState.currentPageData.group !== "publicPages" ? (v(), H(c, {
1874
- key: 1,
1875
- label: "父文件夹/父页面",
1876
- prop: "parentId"
1877
- }, {
1878
- default: S(() => [
1879
- d(_, {
1880
- modelValue: e.pageParentId,
1881
- "onUpdate:modelValue": t[3] || (t[3] = (m) => e.pageParentId = m),
1882
- "value-field": "id",
1883
- "render-type": "tree",
1884
- "tree-op": e.treeFolderOp,
1885
- "text-field": "name",
1886
- placeholder: "请选择父文件夹/父页面",
1887
- "popper-class": "parent-fold-select-dropdown",
1888
- onChange: e.changeParentForderId
1889
- }, null, 8, ["modelValue", "tree-op", "onChange"])
1890
- ]),
1891
- _: 1
1892
- })) : j("", !0),
1893
- d(c, {
1894
- label: "页面路由",
1895
- prop: "route"
1896
- }, {
1897
- default: S(() => [
1898
- d(l, {
1899
- modelValue: e.pageSettingState.currentPageData.route,
1900
- "onUpdate:modelValue": t[4] || (t[4] = (m) => e.pageSettingState.currentPageData.route = m),
1901
- placeholder: "请设置路由"
1902
- }, null, 8, ["modelValue"]),
1903
- V("div", nn, [
1904
- e.pageSettingState.currentPageData.route ? (v(), U("span", sn, [
1905
- t[8] || (t[8] = V("span", { class: "text" }, "website.com/", -1)),
1906
- V("span", rn, de(e.currentRoute), 1)
1907
- ])) : (v(), U("span", on, "路由将以website.com开头"))
1908
- ])
1909
- ]),
1910
- _: 1
1911
- }),
1912
- e.pageSettingState.currentPageData.group !== "publicPages" ? (v(), H(c, {
1913
- key: 2,
1914
- prop: "isDefault"
1915
- }, {
1916
- default: S(() => [
1917
- d(y, {
1918
- modelValue: e.pageSettingState.currentPageData.isDefault,
1919
- "onUpdate:modelValue": t[5] || (t[5] = (m) => e.pageSettingState.currentPageData.isDefault = m)
1920
- }, {
1921
- default: S(() => t[9] || (t[9] = [
1922
- ue("设为默认页")
1923
- ])),
1924
- _: 1
1925
- }, 8, ["modelValue"])
1926
- ]),
1927
- _: 1
1928
- })) : j("", !0)
1929
- ]),
1858
+ default: C(() => {
1859
+ var m;
1860
+ return [
1861
+ n.isFolder ? j("", !0) : (v(), H(c, {
1862
+ key: 0,
1863
+ prop: "group",
1864
+ label: "页面类型",
1865
+ class: "form-item-page-type"
1866
+ }, {
1867
+ default: C(() => [
1868
+ p(r, {
1869
+ modelValue: e.pageSettingState.currentPageData.group,
1870
+ "onUpdate:modelValue": a[0] || (a[0] = (h) => e.pageSettingState.currentPageData.group = h),
1871
+ class: "page-type-radio",
1872
+ label: "staticPages"
1873
+ }, {
1874
+ default: C(() => a[6] || (a[6] = [
1875
+ ie(" 静态页面 ")
1876
+ ])),
1877
+ _: 1
1878
+ }, 8, ["modelValue"]),
1879
+ p(r, {
1880
+ modelValue: e.pageSettingState.currentPageData.group,
1881
+ "onUpdate:modelValue": a[1] || (a[1] = (h) => e.pageSettingState.currentPageData.group = h),
1882
+ class: "page-type-radio",
1883
+ label: "publicPages"
1884
+ }, {
1885
+ default: C(() => a[7] || (a[7] = [
1886
+ ie(" 公共页面 ")
1887
+ ])),
1888
+ _: 1
1889
+ }, 8, ["modelValue"])
1890
+ ]),
1891
+ _: 1
1892
+ })),
1893
+ p(c, {
1894
+ prop: "name",
1895
+ label: `${n.isFolder ? "文件夹" : "页面"}名称`
1896
+ }, {
1897
+ default: C(() => [
1898
+ p(g, {
1899
+ modelValue: e.pageSettingState.currentPageData.name,
1900
+ "onUpdate:modelValue": a[2] || (a[2] = (h) => e.pageSettingState.currentPageData.name = h),
1901
+ placeholder: `请设置${n.isFolder ? "文件夹" : "页面"}名称`
1902
+ }, null, 8, ["modelValue", "placeholder"])
1903
+ ]),
1904
+ _: 1
1905
+ }, 8, ["label"]),
1906
+ e.pageSettingState.currentPageData.group !== "publicPages" ? (v(), H(c, {
1907
+ key: 1,
1908
+ label: "父文件夹/父页面",
1909
+ prop: "parentId"
1910
+ }, {
1911
+ default: C(() => [
1912
+ p(I, {
1913
+ modelValue: e.pageParentId,
1914
+ "onUpdate:modelValue": a[3] || (a[3] = (h) => e.pageParentId = h),
1915
+ "value-field": "id",
1916
+ "render-type": "tree",
1917
+ "tree-op": e.treeFolderOp,
1918
+ "text-field": "name",
1919
+ placeholder: "请选择父文件夹/父页面",
1920
+ "popper-class": "parent-fold-select-dropdown",
1921
+ onChange: e.changeParentForderId
1922
+ }, null, 8, ["modelValue", "tree-op", "onChange"])
1923
+ ]),
1924
+ _: 1
1925
+ })) : j("", !0),
1926
+ p(c, {
1927
+ label: "页面路由",
1928
+ prop: "route"
1929
+ }, {
1930
+ default: C(() => [
1931
+ p(g, {
1932
+ modelValue: e.pageSettingState.currentPageData.route,
1933
+ "onUpdate:modelValue": a[4] || (a[4] = (h) => e.pageSettingState.currentPageData.route = h),
1934
+ placeholder: "请设置路由"
1935
+ }, null, 8, ["modelValue"]),
1936
+ A("div", an, [
1937
+ e.pageSettingState.currentPageData.route ? (v(), U("span", on, [
1938
+ a[8] || (a[8] = A("span", { class: "text" }, "website.com/", -1)),
1939
+ A("span", sn, ae(e.currentRoute), 1)
1940
+ ])) : (v(), U("span", nn, "路由将以website.com开头"))
1941
+ ])
1942
+ ]),
1943
+ _: 1
1944
+ }),
1945
+ e.pageSettingState.currentPageData.group !== "publicPages" && !n.isFolder && ((m = e.state.childPageOp) != null && m.length) ? (v(), H(c, {
1946
+ key: 2,
1947
+ label: "设置默认跳转页",
1948
+ prop: "isDefault"
1949
+ }, {
1950
+ default: C(() => {
1951
+ var h, f;
1952
+ return [
1953
+ p(I, {
1954
+ modelValue: e.state.defaultPageId,
1955
+ "onUpdate:modelValue": a[5] || (a[5] = (b) => e.state.defaultPageId = b),
1956
+ options: e.state.childPageOp,
1957
+ placeholder: "请选择默认跳转页",
1958
+ onChange: e.changeDefaultPage
1959
+ }, null, 8, ["modelValue", "options", "onChange"]),
1960
+ e.state.defaultPageId ? (v(), U("div", rn, [
1961
+ A("span", ln, [
1962
+ a[9] || (a[9] = ie("访问")),
1963
+ A("span", cn, "/" + ae(e.currentRoute), 1),
1964
+ a[10] || (a[10] = ie("路由,默认跳转")),
1965
+ A("span", un, "/" + ae(e.currentRoute) + "/" + ae((f = (h = e.pageSettingState) == null ? void 0 : h.defaultPage) == null ? void 0 : f.route), 1)
1966
+ ])
1967
+ ])) : j("", !0)
1968
+ ];
1969
+ }),
1970
+ _: 1
1971
+ })) : j("", !0)
1972
+ ];
1973
+ }),
1930
1974
  _: 1
1931
- }, 8, ["model", "rules"]),
1932
- !n.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (v(), H(k, { key: 0 })) : j("", !0)
1975
+ }, 8, ["model", "rules"])
1933
1976
  ]);
1934
1977
  }
1935
- const cn = /* @__PURE__ */ te(tn, [["render", ln], ["__scopeId", "data-v-830716e8"]]), Nn = {
1978
+ const dn = /* @__PURE__ */ Z(en, [["render", gn], ["__scopeId", "data-v-c387ad80"]]), En = {
1936
1979
  ...fe,
1937
- apis: va,
1938
- entry: Na,
1980
+ apis: Na,
1981
+ entry: Ta,
1939
1982
  options: {
1940
1983
  pageBaseStyle: {
1941
1984
  className: "page-base-style",
@@ -1943,11 +1986,11 @@ const cn = /* @__PURE__ */ te(tn, [["render", ln], ["__scopeId", "data-v-830716e
1943
1986
  }
1944
1987
  },
1945
1988
  components: {
1946
- PageGeneral: cn
1989
+ PageGeneral: dn
1947
1990
  },
1948
- metas: [Xa]
1991
+ metas: [$a]
1949
1992
  };
1950
1993
  export {
1951
- Xa as PageService,
1952
- Nn as default
1994
+ $a as PageService,
1995
+ En as default
1953
1996
  };