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