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