@opentiny/tiny-engine-plugin-page 2.0.0-alpha.2 → 2.0.0-alpha.3

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 (2) hide show
  1. package/dist/index.js +249 -254
  2. package/package.json +11 -10
package/dist/index.js CHANGED
@@ -1,51 +1,50 @@
1
1
  import "./style.css";
2
- import { reactive as z, watchEffect as Y, computed as re, inject as He, resolveComponent as c, openBlock as N, createElementBlock as J, createVNode as r, withCtx as y, createTextVNode as ae, createElementVNode as V, toDisplayString as _e, ref as U, createBlock as A, createCommentVNode as H, nextTick as Le, Fragment as de, renderList as Be, provide as je } from "vue";
3
- import { usePage as L, useModal as Q, useNotify as R, useBlock as qe, useEditorInfo as Je, getMergeMeta as be, useApp as le, useCanvas as me, useLayout as oe, useBreadcrumb as Ke, useHelp as Xe, HOOK_NAME as We } from "@opentiny/tiny-engine-meta-register";
2
+ import { reactive as z, watchEffect as Y, computed as re, inject as He, resolveComponent as c, openBlock as T, createElementBlock as J, createVNode as r, withCtx as y, createTextVNode as ae, createElementVNode as x, toDisplayString as me, ref as U, createBlock as A, createCommentVNode as H, nextTick as Le, Fragment as de, renderList as Be, provide as je } from "vue";
3
+ import { usePage as L, useModal as Q, useNotify as G, useBlock as qe, useEditorInfo as Je, getMergeMeta as be, useApp as le, useCanvas as fe, useLayout as oe, useBreadcrumb as Ke, useHelp as Xe, HOOK_NAME as We } from "@opentiny/tiny-engine-meta-register";
4
4
  import { BlockHistoryList as ze, MetaCodeEditor as Qe, LifeCycles as Ye, PluginSetting as ke, SvgButton as Pe, ButtonGroup as we, PluginPanel as Ze } from "@opentiny/tiny-engine-common";
5
5
  import { isEqual as ce, extend as ne } from "@opentiny/vue-renderless/common/object";
6
- import { Checkbox as xe, Form as $e, FormItem as et, Input as Ee, Select as tt, Radio as at, Button as Ve, Collapse as fe, CollapseItem as ye, Search as nt, Tree as ot } from "@opentiny/vue";
7
- import { constants as Ge } from "@opentiny/tiny-engine-utils";
8
- import { isVsCodeEnv as Re } from "@opentiny/tiny-engine-common/js/environments";
6
+ import { Checkbox as Ee, Form as $e, FormItem as et, Input as Ve, Select as tt, Radio as at, Button as xe, Collapse as _e, CollapseItem as ye, Search as nt, Tree as ot } from "@opentiny/vue";
7
+ import { constants as Re } from "@opentiny/tiny-engine-utils";
8
+ import { isVsCodeEnv as Ge } from "@opentiny/tiny-engine-common/js/environments";
9
9
  import { handlePageUpdate as st } from "@opentiny/tiny-engine-common/js/http";
10
10
  import { generateRouter as rt, generatePage as lt } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
11
- import { REGEXP_PAGE_NAME as ct, REGEXP_ROUTE as Te, REGEXP_FOLDER_NAME as it } from "@opentiny/tiny-engine-common/js/verification";
11
+ import { REGEXP_PAGE_NAME as ct, REGEXP_ROUTE as Ne, REGEXP_FOLDER_NAME as it } from "@opentiny/tiny-engine-common/js/verification";
12
12
  import { useHttp as gt } from "@opentiny/tiny-engine-http";
13
13
  import { previewPage as pt } from "@opentiny/tiny-engine-common/js/preview";
14
14
  import ut from "@opentiny/vue-renderless/common/deps/throttle";
15
- import { IconSearch as dt, IconFolderOpened as _t, IconFolderClosed as mt } from "@opentiny/vue-icon";
16
- import { getCanvasStatus as Ne } from "@opentiny/tiny-engine-common/js/canvas";
17
- const B = gt(), Pt = (n) => B.get(`/app-center/api/pages/list/${n}`), Se = (n) => B.get(`/app-center/api/pages/detail/${n}`), ft = (n) => B.get(`/app-center/api/pages/delete/${n}`), yt = (n) => B.post("/app-center/api/pages/create", n), St = (n, t) => B.post(`/app-center/api/pages/update/${n}`, t), Dt = (n) => B.post("/app-center/api/pages/copy", n), Ae = (n) => B.get(`/app-center/api/pages/histories?page=${n}`), ht = (n) => B.post("/app-center/api/pageHistory/restore", n), vt = (n) => B.get(`/app-center/api/pages/histories/${n}`), Ct = (n, t) => B.post(`/app-center/api/pages/update/${n}`, t), ie = {
15
+ import { IconSearch as dt, IconFolderOpened as mt, IconFolderClosed as ft } from "@opentiny/vue-icon";
16
+ import { getCanvasStatus as Te } from "@opentiny/tiny-engine-common/js/canvas";
17
+ const B = gt(), Pt = (n) => B.get(`/app-center/api/pages/list/${n}`), Se = (n) => B.get(`/app-center/api/pages/detail/${n}`), _t = (n) => B.get(`/app-center/api/pages/delete/${n}`), yt = (n) => B.post("/app-center/api/pages/create", n), St = (n, t) => B.post(`/app-center/api/pages/update/${n}`, t), Dt = (n) => B.post("/app-center/api/pages/copy", n), Ae = (n) => B.get(`/app-center/api/pages/histories?page=${n}`), ht = (n) => B.post("/app-center/api/pageHistory/restore", n), Ct = (n) => B.get(`/app-center/api/pages/histories/${n}`), vt = (n, t) => B.post(`/app-center/api/pages/update/${n}`, t), ie = {
18
18
  fetchPageList: Pt,
19
19
  fetchPageDetail: Se,
20
- requestDeletePage: ft,
20
+ requestDeletePage: _t,
21
21
  requestCreatePage: yt,
22
22
  requestCopyPage: Dt,
23
23
  fetchPageHistory: Ae,
24
- fetchHistoryDetail: vt,
24
+ fetchHistoryDetail: Ct,
25
25
  handleRouteHomeUpdate: St,
26
26
  requestRestorePageHistory: ht,
27
- requestUpdatePage: Ct
28
- };
29
- const K = (n, t) => {
27
+ requestUpdatePage: vt
28
+ }, K = (n, t) => {
30
29
  const s = n.__vccOpts || n;
31
- for (const [e, _] of t)
32
- s[e] = _;
30
+ for (const [e, m] of t)
31
+ s[e] = m;
33
32
  return s;
34
33
  }, It = {
35
34
  components: {
36
- TinyCheckbox: xe
35
+ TinyCheckbox: Ee
37
36
  },
38
37
  setup() {
39
- const { pageSettingState: n, STATIC_PAGE_GROUP_ID: t } = L(), { handleRouteHomeUpdate: s } = ie, { confirm: e } = Q(), _ = z({
38
+ const { pageSettingState: n, STATIC_PAGE_GROUP_ID: t } = L(), { handleRouteHomeUpdate: s } = ie, { confirm: e } = Q(), m = z({
40
39
  checked: !1,
41
40
  selectDisable: !1
42
41
  });
43
42
  Y(() => {
44
43
  var g;
45
44
  const o = !!((g = n.currentPageData) != null && g.isHome);
46
- _.checked = o, _.selectDisable = o;
45
+ m.checked = o, m.selectDisable = o;
47
46
  });
48
- const m = re(() => {
47
+ const f = re(() => {
49
48
  let o = "暂无主页";
50
49
  if (n.pages[t]) {
51
50
  const u = n.pages[t].data.filter((P) => P.isHome);
@@ -63,27 +62,27 @@ const K = (n, t) => {
63
62
  exec: () => {
64
63
  const { id: o } = n.currentPageData, g = n.ROOT_ID, u = { ...n.currentPageData };
65
64
  u.parentId = g, u.isHome = !0, s(o, u).then(() => {
66
- n.updateTreeData(), a({ data: n.currentPageData }), n.isNew = !1, Re && rt({
65
+ n.updateTreeData(), a({ data: n.currentPageData }), n.isNew = !1, Ge && rt({
67
66
  pageId: o,
68
67
  componentsTree: u
69
- }), R({ message: "主页设置成功!", type: "success" });
68
+ }), G({ message: "主页设置成功!", type: "success" });
70
69
  }).catch(() => {
71
- R({ message: "主页设置失败!", type: "error" });
70
+ G({ message: "主页设置失败!", type: "error" });
72
71
  });
73
72
  },
74
73
  cancel: () => {
75
- _.checked = !1;
74
+ m.checked = !1;
76
75
  }
77
76
  });
78
77
  },
79
- homePage: m,
80
- state: _
78
+ homePage: f,
79
+ state: m
81
80
  };
82
81
  }
83
- }, bt = { class: "home" }, Tt = { class: "tip" }, Nt = { class: "home-page" };
84
- function Ot(n, t, s, e, _, m) {
82
+ }, bt = { class: "home" }, Nt = { class: "tip" }, Tt = { class: "home-page" };
83
+ function Ot(n, t, s, e, m, f) {
85
84
  const a = c("tiny-checkbox");
86
- return N(), J("div", bt, [
85
+ return T(), J("div", bt, [
87
86
  r(a, {
88
87
  class: "selectHome",
89
88
  modelValue: e.state.checked,
@@ -96,9 +95,9 @@ function Ot(n, t, s, e, _, m) {
96
95
  ])),
97
96
  _: 1
98
97
  }, 8, ["modelValue", "disabled", "onChange"]),
99
- V("div", Tt, [
100
- t[2] || (t[2] = V("span", null, "当前主页是", -1)),
101
- V("span", Nt, "【" + _e(e.homePage) + "】", 1)
98
+ x("div", Nt, [
99
+ t[2] || (t[2] = x("span", null, "当前主页是", -1)),
100
+ x("span", Tt, "【" + me(e.homePage) + "】", 1)
102
101
  ])
103
102
  ]);
104
103
  }
@@ -106,7 +105,7 @@ const Ft = /* @__PURE__ */ K(It, [["render", Ot], ["__scopeId", "data-v-b15de911
106
105
  components: {
107
106
  TinyForm: $e,
108
107
  TinyFormItem: et,
109
- TinyInput: Ee,
108
+ TinyInput: Ve,
110
109
  TinySelect: tt,
111
110
  PageHome: Ft,
112
111
  TinyRadio: at
@@ -126,11 +125,11 @@ const Ft = /* @__PURE__ */ K(It, [["render", Ot], ["__scopeId", "data-v-b15de911
126
125
  pageSettingState: n,
127
126
  changeTreeData: t,
128
127
  STATIC_PAGE_GROUP_ID: s
129
- } = L(), e = n.ROOT_ID, _ = U(n.currentPageData.parentId);
128
+ } = L(), e = n.ROOT_ID, m = U(n.currentPageData.parentId);
130
129
  Y(() => {
131
- _.value = n.oldParentId;
130
+ m.value = n.oldParentId;
132
131
  });
133
- const m = re(() => {
132
+ const f = re(() => {
134
133
  let D = n.currentPageData.route || "", S = n.currentPageData.parentId;
135
134
  for (; S !== e; ) {
136
135
  const p = n.treeDataMapping[S];
@@ -155,7 +154,7 @@ const Ft = /* @__PURE__ */ K(It, [["render", Ot], ["__scopeId", "data-v-b15de911
155
154
  required: !0,
156
155
  message: "请输入页面路由"
157
156
  }, {
158
- pattern: Te,
157
+ pattern: Ne,
159
158
  message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
160
159
  }]
161
160
  }, l = {
@@ -174,7 +173,7 @@ const Ft = /* @__PURE__ */ K(It, [["render", Ot], ["__scopeId", "data-v-b15de911
174
173
  required: !0,
175
174
  message: "请输入页面文件夹路由"
176
175
  }, {
177
- pattern: Te,
176
+ pattern: Ne,
178
177
  message: "只允许包含英文字母、数字、下横线_、中横线-、正斜杠/, 且以英文字母开头"
179
178
  }],
180
179
  group: [{
@@ -226,23 +225,22 @@ const Ft = /* @__PURE__ */ K(It, [["render", Ot], ["__scopeId", "data-v-b15de911
226
225
  });
227
226
  }),
228
227
  treeFolderOp: g,
229
- currentRoute: m,
228
+ currentRoute: f,
230
229
  changeParentForderId: (D) => {
231
- t(D.id, _.value), _.value = D.id;
230
+ t(D.id, m.value), m.value = D.id;
232
231
  }
233
232
  };
234
233
  }
235
- };
236
- const wt = { class: "general-config" }, xt = { class: "tip" }, Et = {
234
+ }, wt = { class: "general-config" }, Et = { class: "tip" }, Vt = {
237
235
  key: 0,
238
236
  class: "text"
239
- }, Vt = {
237
+ }, xt = {
240
238
  key: 1,
241
239
  class: "route-text"
242
- }, Gt = { class: "text-dim" };
243
- function Rt(n, t, s, e, _, m) {
240
+ }, Rt = { class: "text-dim" };
241
+ function Gt(n, t, s, e, m, f) {
244
242
  const a = c("tiny-radio"), l = c("tiny-form-item"), o = c("tiny-input"), g = c("tiny-select"), u = c("tiny-form"), P = c("page-home");
245
- return N(), J("div", wt, [
243
+ return T(), J("div", wt, [
246
244
  r(u, {
247
245
  ref: "generalForm",
248
246
  model: e.pageSettingState.currentPageData,
@@ -255,7 +253,7 @@ function Rt(n, t, s, e, _, m) {
255
253
  class: "general-config-form"
256
254
  }, {
257
255
  default: y(() => [
258
- s.isFolder ? H("", !0) : (N(), A(l, {
256
+ s.isFolder ? H("", !0) : (T(), A(l, {
259
257
  key: 0,
260
258
  prop: "group",
261
259
  label: "页面类型",
@@ -264,7 +262,7 @@ function Rt(n, t, s, e, _, m) {
264
262
  default: y(() => [
265
263
  r(a, {
266
264
  modelValue: e.pageSettingState.currentPageData.group,
267
- "onUpdate:modelValue": t[0] || (t[0] = (f) => e.pageSettingState.currentPageData.group = f),
265
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => e.pageSettingState.currentPageData.group = _),
268
266
  class: "page-type-radio",
269
267
  label: "staticPages"
270
268
  }, {
@@ -275,7 +273,7 @@ function Rt(n, t, s, e, _, m) {
275
273
  }, 8, ["modelValue"]),
276
274
  r(a, {
277
275
  modelValue: e.pageSettingState.currentPageData.group,
278
- "onUpdate:modelValue": t[1] || (t[1] = (f) => e.pageSettingState.currentPageData.group = f),
276
+ "onUpdate:modelValue": t[1] || (t[1] = (_) => e.pageSettingState.currentPageData.group = _),
279
277
  class: "page-type-radio",
280
278
  label: "publicPages"
281
279
  }, {
@@ -294,13 +292,13 @@ function Rt(n, t, s, e, _, m) {
294
292
  default: y(() => [
295
293
  r(o, {
296
294
  modelValue: e.pageSettingState.currentPageData.name,
297
- "onUpdate:modelValue": t[2] || (t[2] = (f) => e.pageSettingState.currentPageData.name = f),
295
+ "onUpdate:modelValue": t[2] || (t[2] = (_) => e.pageSettingState.currentPageData.name = _),
298
296
  placeholder: `请设置${s.isFolder ? "文件夹" : "页面"}名称`
299
297
  }, null, 8, ["modelValue", "placeholder"])
300
298
  ]),
301
299
  _: 1
302
300
  }, 8, ["label"]),
303
- e.pageSettingState.currentPageData.group !== "publicPages" ? (N(), A(l, {
301
+ e.pageSettingState.currentPageData.group !== "publicPages" ? (T(), A(l, {
304
302
  key: 1,
305
303
  label: "父文件夹",
306
304
  prop: "parentId"
@@ -308,7 +306,7 @@ function Rt(n, t, s, e, _, m) {
308
306
  default: y(() => [
309
307
  r(g, {
310
308
  modelValue: e.pageSettingState.currentPageData.parentId,
311
- "onUpdate:modelValue": t[3] || (t[3] = (f) => e.pageSettingState.currentPageData.parentId = f),
309
+ "onUpdate:modelValue": t[3] || (t[3] = (_) => e.pageSettingState.currentPageData.parentId = _),
312
310
  "value-field": "id",
313
311
  "render-type": "tree",
314
312
  "tree-op": e.treeFolderOp,
@@ -327,14 +325,14 @@ function Rt(n, t, s, e, _, m) {
327
325
  default: y(() => [
328
326
  r(o, {
329
327
  modelValue: e.pageSettingState.currentPageData.route,
330
- "onUpdate:modelValue": t[4] || (t[4] = (f) => e.pageSettingState.currentPageData.route = f),
328
+ "onUpdate:modelValue": t[4] || (t[4] = (_) => e.pageSettingState.currentPageData.route = _),
331
329
  placeholder: "请设置路由"
332
330
  }, null, 8, ["modelValue"]),
333
- V("div", xt, [
334
- e.pageSettingState.currentPageData.route ? (N(), J("span", Vt, [
335
- t[7] || (t[7] = V("span", { class: "text" }, "website.com/", -1)),
336
- V("span", Gt, _e(e.currentRoute), 1)
337
- ])) : (N(), J("span", Et, "路由将以website.com开头"))
331
+ x("div", Et, [
332
+ e.pageSettingState.currentPageData.route ? (T(), J("span", xt, [
333
+ t[7] || (t[7] = x("span", { class: "text" }, "website.com/", -1)),
334
+ x("span", Rt, me(e.currentRoute), 1)
335
+ ])) : (T(), J("span", Vt, "路由将以website.com开头"))
338
336
  ])
339
337
  ]),
340
338
  _: 1
@@ -342,10 +340,10 @@ function Rt(n, t, s, e, _, m) {
342
340
  ]),
343
341
  _: 1
344
342
  }, 8, ["model", "rules"]),
345
- !s.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (N(), A(P, { key: 0 })) : H("", !0)
343
+ !s.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (T(), A(P, { key: 0 })) : H("", !0)
346
344
  ]);
347
345
  }
348
- const Ue = /* @__PURE__ */ K(kt, [["render", Rt], ["__scopeId", "data-v-98016952"]]), At = {
346
+ const Ue = /* @__PURE__ */ K(kt, [["render", Gt], ["__scopeId", "data-v-98016952"]]), At = {
349
347
  components: {
350
348
  BlockHistoryList: ze
351
349
  },
@@ -357,20 +355,20 @@ const Ue = /* @__PURE__ */ K(kt, [["render", Rt], ["__scopeId", "data-v-98016952
357
355
  },
358
356
  emits: ["restorePage"],
359
357
  setup(n, { emit: t }) {
360
- const { pageSettingState: s } = L(), { getDateFromNow: e } = qe(), { confirm: _ } = Q(), m = U([]), a = (g) => {
361
- const { id: u, version: P } = Je().useInfo(), f = P ? `&app=${u}&version=${P}` : "";
362
- g ? Ae(g + f).then((D) => {
358
+ const { pageSettingState: s } = L(), { getDateFromNow: e } = qe(), { confirm: m } = Q(), f = U([]), a = (g) => {
359
+ const { id: u, version: P } = Je().useInfo(), _ = P ? `&app=${u}&version=${P}` : "";
360
+ g ? Ae(g + _).then((D) => {
363
361
  D && (D.forEach((S) => {
364
362
  S.backupTitle = S.message, S.backupTime = e(new Date(S.time));
365
- }), m.value = D.reverse());
366
- }) : m.value = [];
363
+ }), f.value = D.reverse());
364
+ }) : f.value = [];
367
365
  };
368
366
  return Y(() => {
369
367
  var u;
370
368
  const g = ((u = s.currentPageData) == null ? void 0 : u.id) || "";
371
369
  a(g);
372
370
  }), {
373
- list: m,
371
+ list: f,
374
372
  previewHistory: (g) => {
375
373
  var u, P;
376
374
  g && pt({
@@ -381,7 +379,7 @@ const Ue = /* @__PURE__ */ K(kt, [["render", Rt], ["__scopeId", "data-v-98016952
381
379
  });
382
380
  },
383
381
  restoreHistory: (g) => {
384
- _({
382
+ m({
385
383
  title: "提示",
386
384
  message: "您即将还原历史页面,是否继续还原?",
387
385
  exec: () => {
@@ -392,19 +390,18 @@ const Ue = /* @__PURE__ */ K(kt, [["render", Rt], ["__scopeId", "data-v-98016952
392
390
  };
393
391
  }
394
392
  };
395
- function Ut(n, t, s, e, _, m) {
393
+ function Ut(n, t, s, e, m, f) {
396
394
  const a = c("block-history-list");
397
- return N(), A(a, {
395
+ return T(), A(a, {
398
396
  history: e.list,
399
397
  onPreview: e.previewHistory,
400
398
  onRestore: e.restoreHistory
401
399
  }, null, 8, ["history", "onPreview", "onRestore"]);
402
400
  }
403
- const Mt = /* @__PURE__ */ K(At, [["render", Ut]]);
404
- const Ht = {
401
+ const Mt = /* @__PURE__ */ K(At, [["render", Ut]]), Ht = {
405
402
  components: {
406
403
  MetaCodeEditor: Qe,
407
- TinyCheckbox: xe
404
+ TinyCheckbox: Ee
408
405
  },
409
406
  setup() {
410
407
  const n = U(""), t = U(""), { pageSettingState: s } = L(), e = re(() => s.currentPageData);
@@ -419,7 +416,7 @@ const Ht = {
419
416
  const o = JSON.parse(l.content);
420
417
  n.value = l.content, e.value.page_content.inputs = o;
421
418
  } catch (o) {
422
- R({
419
+ G({
423
420
  title: "输入配置保存失败(必须符合JSON格式)",
424
421
  message: `${(o == null ? void 0 : o.message) || o}`,
425
422
  type: "error"
@@ -431,7 +428,7 @@ const Ht = {
431
428
  const o = JSON.parse(l.content);
432
429
  t.value = l.content, e.value.page_content.outputs = o;
433
430
  } catch (o) {
434
- R({
431
+ G({
435
432
  title: "输出配置保存失败(必须符合JSON格式)",
436
433
  message: `${(o == null ? void 0 : o.message) || o}`,
437
434
  type: "error"
@@ -443,9 +440,9 @@ const Ht = {
443
440
  };
444
441
  }
445
442
  }, Lt = { class: "input-or-output" };
446
- function Bt(n, t, s, e, _, m) {
443
+ function Bt(n, t, s, e, m, f) {
447
444
  const a = c("svg-icon"), l = c("meta-code-editor"), o = c("tiny-checkbox");
448
- return N(), J("div", Lt, [
445
+ return T(), J("div", Lt, [
449
446
  r(l, {
450
447
  modelValue: e.inputValue,
451
448
  title: "输入配置",
@@ -463,7 +460,7 @@ function Bt(n, t, s, e, _, m) {
463
460
  ]),
464
461
  _: 1
465
462
  }, 8, ["modelValue", "buttonShowContent", "onSave"]),
466
- t[2] || (t[2] = V("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
463
+ t[2] || (t[2] = x("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
467
464
  r(l, {
468
465
  modelValue: e.outputValue,
469
466
  title: "输出配置",
@@ -481,23 +478,23 @@ function Bt(n, t, s, e, _, m) {
481
478
  ]),
482
479
  _: 1
483
480
  }, 8, ["modelValue", "buttonShowContent", "onSave"]),
484
- t[3] || (t[3] = V("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
481
+ t[3] || (t[3] = x("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
485
482
  r(o, {
486
483
  class: "selectHome",
487
484
  modelValue: e.pageSettingState.currentPageData.isBody,
488
485
  "onUpdate:modelValue": t[0] || (t[0] = (g) => e.pageSettingState.currentPageData.isBody = g)
489
486
  }, {
490
487
  default: y(() => t[1] || (t[1] = [
491
- V("span", null, "设为根元素为Body", -1)
488
+ x("span", null, "设为根元素为Body", -1)
492
489
  ])),
493
490
  _: 1
494
491
  }, 8, ["modelValue"]),
495
- t[4] || (t[4] = V("div", { class: "input-output-div" }, "默认为div", -1))
492
+ t[4] || (t[4] = x("div", { class: "input-output-div" }, "默认为div", -1))
496
493
  ]);
497
494
  }
498
495
  const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379"]]), {
499
496
  COMPONENT_NAME: qt
500
- } = Ge, De = U(!1), se = () => {
497
+ } = Re, De = U(!1), se = () => {
501
498
  De.value = !0;
502
499
  }, q = () => {
503
500
  De.value = !1;
@@ -512,8 +509,8 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
512
509
  history: "history"
513
510
  }, Jt = {
514
511
  components: {
515
- TinyButton: Ve,
516
- TinyCollapse: fe,
512
+ TinyButton: xe,
513
+ TinyCollapse: _e,
517
514
  TinyCollapseItem: ye,
518
515
  PageInputOutput: jt,
519
516
  LifeCycles: Ye,
@@ -537,9 +534,9 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
537
534
  requestCreatePage: s,
538
535
  requestDeletePage: e
539
536
  } = ie, {
540
- appInfoState: _
537
+ appInfoState: m
541
538
  } = le(), {
542
- DEFAULT_PAGE: m,
539
+ DEFAULT_PAGE: f,
543
540
  pageSettingState: a,
544
541
  changeTreeData: l,
545
542
  isCurrentDataSame: o,
@@ -547,15 +544,15 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
547
544
  isTemporaryPage: u,
548
545
  STATIC_PAGE_GROUP_ID: P
549
546
  } = L(), {
550
- pageState: f,
547
+ pageState: _,
551
548
  initData: D
552
- } = me(), {
549
+ } = fe(), {
553
550
  confirm: S
554
551
  } = Q(), p = U(null), h = z({
555
552
  activeName: Object.values(Oe),
556
553
  title: "页面设置",
557
554
  historyMessage: ""
558
- }), G = () => {
555
+ }), R = () => {
559
556
  ce(a.currentPageData, a.currentPageDataCopy) ? q() : S({
560
557
  title: "提示",
561
558
  message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
@@ -565,72 +562,72 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
565
562
  });
566
563
  }, F = () => {
567
564
  const {
568
- page_content: C,
569
- ...v
570
- } = m, {
565
+ page_content: v,
566
+ ...C
567
+ } = f, {
571
568
  page_content: I,
572
569
  ...k
573
- } = a.currentPageData, x = {
574
- ...v,
570
+ } = a.currentPageData, E = {
571
+ ...C,
575
572
  ...k,
576
573
  page_content: {
577
- ...C,
574
+ ...v,
578
575
  ...I,
579
576
  fileName: a.currentPageData.name
580
577
  },
581
- app: _.selectedId,
578
+ app: m.selectedId,
582
579
  isPage: !0
583
580
  };
584
- x.id && (delete x.id, delete x._id), s(x).then((i) => {
585
- a.updateTreeData(), a.isNew = !1, u.saved = !1, t("openNewPage", i), q(), oe().closePlugin(), R({
581
+ E.id && (delete E.id, delete E._id), s(E).then((i) => {
582
+ a.updateTreeData(), a.isNew = !1, u.saved = !1, t("openNewPage", i), q(), oe().closePlugin(), G({
586
583
  type: "success",
587
584
  message: "新建页面成功!"
588
- }), Re && lt(i);
585
+ }), Ge && lt(i);
589
586
  }).catch((i) => {
590
- R({
587
+ G({
591
588
  type: "error",
592
589
  title: "新建页面失败",
593
590
  message: JSON.stringify((i == null ? void 0 : i.message) || i)
594
591
  });
595
592
  });
596
- }, Z = (C, v) => {
593
+ }, Z = (v, C) => {
597
594
  const I = a.currentPageDataCopy.route !== a.currentPageData.route;
598
- return st(C, v, I);
599
- }, X = (C) => {
600
- C.id = C.page, ["page", "backupTime", "backupTitle", "time"].forEach((k) => delete C[k]);
595
+ return st(v, C, I);
596
+ }, X = (v) => {
597
+ v.id = v.page, ["page", "backupTime", "backupTitle", "time"].forEach((k) => delete v[k]);
601
598
  const I = {
602
599
  ...a.currentPageData,
603
- ...C,
600
+ ...v,
604
601
  message: "还原页面"
605
602
  };
606
- Z(C.id, I).then((k) => {
607
- var x;
608
- ((x = f == null ? void 0 : f.currentPage) == null ? void 0 : x.id) === (k == null ? void 0 : k.id) && D(k.page_content, k);
603
+ Z(v.id, I).then((k) => {
604
+ var E;
605
+ ((E = _ == null ? void 0 : _.currentPage) == null ? void 0 : E.id) === (k == null ? void 0 : k.id) && D(k.page_content, k);
609
606
  });
610
607
  }, W = async () => {
611
608
  const {
612
- id: C,
613
- name: v,
609
+ id: v,
610
+ name: C,
614
611
  page_content: I
615
612
  } = a.currentPageData, k = {
616
613
  ...a.currentPageData,
617
614
  page_content: {
618
615
  ...I,
619
- fileName: v
616
+ fileName: C
620
617
  }
621
- }, x = await Z(C, k);
622
- g(x);
623
- }, ge = (C) => {
624
- if (!C)
618
+ }, E = await Z(v, k);
619
+ g(E);
620
+ }, ge = (v) => {
621
+ if (!v)
625
622
  return;
626
- const v = a.currentPageData.page_content;
627
- v.lifeCycles = {
628
- ...v.lifeCycles || {},
629
- ...C
623
+ const C = a.currentPageData.page_content;
624
+ C.lifeCycles = {
625
+ ...C.lifeCycles || {},
626
+ ...v
630
627
  };
631
628
  }, $ = () => {
632
- const C = a.currentPageData, v = ne(!0, {}, C);
633
- a.isNew = !0, v.name = `${v.name}Copy`, v.route = `${v.route}Copy`, a.currentPageData = v, a.currentPageDataCopy = ne(!0, {}, v);
629
+ const v = a.currentPageData, C = ne(!0, {}, v);
630
+ a.isNew = !0, C.name = `${C.name}Copy`, C.route = `${C.route}Copy`, a.currentPageData = C, a.currentPageDataCopy = ne(!0, {}, C);
634
631
  }, pe = () => {
635
632
  o() ? $() : S({
636
633
  title: "提示",
@@ -644,10 +641,10 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
644
641
  title: "创建历史备份信息",
645
642
  status: "custom",
646
643
  message: {
647
- render: () => r(Ee, {
644
+ render: () => r(Ve, {
648
645
  placeholder: "历史备份信息",
649
646
  modelValue: h.historyMessage,
650
- "onUpdate:modelValue": (x) => h.historyMessage = x
647
+ "onUpdate:modelValue": (E) => h.historyMessage = E
651
648
  }, null)
652
649
  },
653
650
  exec: () => {
@@ -656,18 +653,18 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
656
653
  });
657
654
  }, ue = () => {
658
655
  p.value.validGeneralForm().then(ee);
659
- }, te = (C = []) => {
660
- if (!Array.isArray(C))
656
+ }, te = (v = []) => {
657
+ if (!Array.isArray(v))
661
658
  return [];
662
- const v = [];
663
- return C.forEach((I) => {
659
+ const C = [];
660
+ return v.forEach((I) => {
664
661
  var k;
665
662
  if (I != null && I.isPage) {
666
- v.push(I);
663
+ C.push(I);
667
664
  return;
668
665
  }
669
- !(I != null && I.isPage) && ((k = I == null ? void 0 : I.children) != null && k.length) && v.push(...te(I.children));
670
- }), v;
666
+ !(I != null && I.isPage) && ((k = I == null ? void 0 : I.children) != null && k.length) && C.push(...te(I.children));
667
+ }), C;
671
668
  };
672
669
  return {
673
670
  state: h,
@@ -681,25 +678,25 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
681
678
  title: "提示",
682
679
  message: "您是否要删除页面?",
683
680
  exec: () => {
684
- var v;
685
- const C = ((v = a.currentPageData) == null ? void 0 : v.id) || "";
686
- e(C).then(() => {
681
+ var C;
682
+ const v = ((C = a.currentPageData) == null ? void 0 : C.id) || "";
683
+ e(v).then(() => {
687
684
  a.updateTreeData().then((I) => {
688
- var T, O;
689
- if (((T = f == null ? void 0 : f.currentPage) == null ? void 0 : T.id) !== C)
685
+ var N, O;
686
+ if (((N = _ == null ? void 0 : _.currentPage) == null ? void 0 : N.id) !== v)
690
687
  return;
691
688
  const k = ((O = (I || []).find(({
692
689
  groupId: w
693
- }) => w === P)) == null ? void 0 : O.data) || [], x = te(k), i = x.find((w) => w.isHome), d = x == null ? void 0 : x[0], b = {
690
+ }) => w === P)) == null ? void 0 : O.data) || [], E = te(k), i = E.find((w) => w.isHome), d = E == null ? void 0 : E[0], b = {
694
691
  componentName: qt.Page
695
692
  };
696
693
  t("openNewPage", i || d || b);
697
- }), q(), R({
694
+ }), q(), G({
698
695
  message: "删除页面成功!",
699
696
  type: "success"
700
697
  });
701
698
  }).catch(() => {
702
- R({
699
+ G({
703
700
  message: "删除页面失败!",
704
701
  type: "error"
705
702
  });
@@ -707,18 +704,17 @@ const jt = /* @__PURE__ */ K(Ht, [["render", Bt], ["__scopeId", "data-v-9ba45379
707
704
  }
708
705
  });
709
706
  },
710
- cancelPageSetting: G,
707
+ cancelPageSetting: R,
711
708
  closePageSettingPanel: q,
712
709
  updatePageLifeCycles: ge,
713
710
  restorePage: X,
714
711
  PAGE_SETTING_SESSION: Oe
715
712
  };
716
713
  }
717
- };
718
- const Kt = { class: "page-setting-content" }, Xt = { class: "life-cycles-container" };
719
- function Wt(n, t, s, e, _, m) {
720
- const a = c("tiny-button"), l = c("svg-button"), o = c("button-group"), g = c("page-general"), u = c("tiny-collapse-item"), P = c("page-input-output"), f = c("life-cycles"), D = c("page-history"), S = c("tiny-collapse"), p = c("plugin-setting");
721
- return e.isShow ? (N(), A(p, {
714
+ }, Kt = { class: "page-setting-content" }, Xt = { class: "life-cycles-container" };
715
+ function Wt(n, t, s, e, m, f) {
716
+ const a = c("tiny-button"), l = c("svg-button"), o = c("button-group"), g = c("page-general"), u = c("tiny-collapse-item"), P = c("page-input-output"), _ = c("life-cycles"), D = c("page-history"), S = c("tiny-collapse"), p = c("plugin-setting");
717
+ return e.isShow ? (T(), A(p, {
722
718
  key: 0,
723
719
  title: e.state.title,
724
720
  class: "page-plugin-setting"
@@ -735,14 +731,14 @@ function Wt(n, t, s, e, _, m) {
735
731
  ])),
736
732
  _: 1
737
733
  }, 8, ["onClick"]),
738
- e.pageSettingState.isNew ? H("", !0) : (N(), A(l, {
734
+ e.pageSettingState.isNew ? H("", !0) : (T(), A(l, {
739
735
  key: 0,
740
736
  name: "text-copy-page",
741
737
  placement: "bottom",
742
738
  tips: "复制页面",
743
739
  onClick: e.copyPage
744
740
  }, null, 8, ["onClick"])),
745
- e.pageSettingState.isNew ? H("", !0) : (N(), A(l, {
741
+ e.pageSettingState.isNew ? H("", !0) : (T(), A(l, {
746
742
  key: 1,
747
743
  name: "delete",
748
744
  tips: "删除页面",
@@ -758,7 +754,7 @@ function Wt(n, t, s, e, _, m) {
758
754
  })
759
755
  ]),
760
756
  content: y(() => [
761
- V("div", Kt, [
757
+ x("div", Kt, [
762
758
  r(S, {
763
759
  modelValue: e.state.activeName,
764
760
  "onUpdate:modelValue": t[0] || (t[0] = (h) => e.state.activeName = h),
@@ -777,7 +773,7 @@ function Wt(n, t, s, e, _, m) {
777
773
  ]),
778
774
  _: 1
779
775
  }, 8, ["name"]),
780
- e.pageSettingState.currentPageData.group !== "public" ? (N(), A(u, {
776
+ e.pageSettingState.currentPageData.group !== "public" ? (T(), A(u, {
781
777
  key: 0,
782
778
  class: "base-setting",
783
779
  title: "输入输出",
@@ -788,7 +784,7 @@ function Wt(n, t, s, e, _, m) {
788
784
  ]),
789
785
  _: 1
790
786
  }, 8, ["name"])) : H("", !0),
791
- e.pageSettingState.currentPageData.group !== "public" ? (N(), A(u, {
787
+ e.pageSettingState.currentPageData.group !== "public" ? (T(), A(u, {
792
788
  key: 1,
793
789
  class: "input-output",
794
790
  title: "页面生命周期配置",
@@ -797,8 +793,8 @@ function Wt(n, t, s, e, _, m) {
797
793
  default: y(() => {
798
794
  var h;
799
795
  return [
800
- V("div", Xt, [
801
- r(f, {
796
+ x("div", Xt, [
797
+ r(_, {
802
798
  bindLifeCycles: (h = e.pageSettingState.currentPageData.page_content) == null ? void 0 : h.lifeCycles,
803
799
  onUpdatePageLifeCycles: e.updatePageLifeCycles
804
800
  }, null, 8, ["bindLifeCycles", "onUpdatePageLifeCycles"])
@@ -835,8 +831,8 @@ const Fe = () => {
835
831
  n();
836
832
  }, Qt = {
837
833
  components: {
838
- TinyButton: Ve,
839
- TinyCollapse: fe,
834
+ TinyButton: xe,
835
+ TinyCollapse: _e,
840
836
  TinyCollapseItem: ye,
841
837
  PluginSetting: ke,
842
838
  PageGeneral: Ue,
@@ -853,7 +849,7 @@ const Fe = () => {
853
849
  const n = z({
854
850
  activeName: ["folderGeneralRef"],
855
851
  title: "文件夹设置"
856
- }), t = U(null), { requestCreatePage: s, requestUpdatePage: e, requestDeletePage: _ } = ie, { appInfoState: m } = le(), { pageSettingState: a, changeTreeData: l } = L(), { confirm: o } = Q(), g = () => {
852
+ }), t = U(null), { requestCreatePage: s, requestUpdatePage: e, requestDeletePage: m } = ie, { appInfoState: f } = le(), { pageSettingState: a, changeTreeData: l } = L(), { confirm: o } = Q(), g = () => {
857
853
  ce(a.currentPageData, a.currentPageDataCopy) ? M() : o({
858
854
  title: "提示",
859
855
  message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
@@ -864,16 +860,16 @@ const Fe = () => {
864
860
  }, u = () => {
865
861
  const p = {
866
862
  ...a.currentPageData,
867
- app: m.selectedId,
863
+ app: f.selectedId,
868
864
  isPage: !1
869
865
  };
870
866
  s(p).then(() => {
871
- a.updateTreeData(), a.isNew = !1, M(), R({
867
+ a.updateTreeData(), a.isNew = !1, M(), G({
872
868
  type: "success",
873
869
  message: "新建文件夹成功!"
874
870
  });
875
871
  }).catch((h) => {
876
- R({
872
+ G({
877
873
  type: "error",
878
874
  title: "新建文件夹失败",
879
875
  message: JSON.stringify((h == null ? void 0 : h.message) || h)
@@ -882,12 +878,12 @@ const Fe = () => {
882
878
  }, P = () => {
883
879
  const { id: S } = a.currentPageData;
884
880
  e(S, { ...a.currentPageData, page_content: null }).then(() => {
885
- a.updateTreeData(), a.isNew = !1, M(), R({
881
+ a.updateTreeData(), a.isNew = !1, M(), G({
886
882
  type: "success",
887
883
  message: "更新文件夹成功!"
888
884
  });
889
885
  }).catch((p) => {
890
- R({
886
+ G({
891
887
  type: "error",
892
888
  title: "更新文件夹失败",
893
889
  message: JSON.stringify((p == null ? void 0 : p.message) || p)
@@ -903,7 +899,7 @@ const Fe = () => {
903
899
  deleteFolder: ut(5e3, !0, () => {
904
900
  var S, p;
905
901
  if ((p = (S = a.treeDataMapping[a.currentPageData.id]) == null ? void 0 : S.children) != null && p.length) {
906
- R({
902
+ G({
907
903
  type: "error",
908
904
  message: "此文件夹不是空文件夹,不能删除!"
909
905
  });
@@ -913,15 +909,15 @@ const Fe = () => {
913
909
  title: "提示",
914
910
  message: "您是否要删除文件夹?",
915
911
  exec: () => {
916
- var G;
917
- const h = ((G = a.currentPageData) == null ? void 0 : G.id) || "";
918
- _(h).then(() => {
919
- a.updateTreeData(), M(), R({
912
+ var R;
913
+ const h = ((R = a.currentPageData) == null ? void 0 : R.id) || "";
914
+ m(h).then(() => {
915
+ a.updateTreeData(), M(), G({
920
916
  type: "success",
921
917
  message: "删除文件夹成功!"
922
918
  });
923
919
  }).catch((F) => {
924
- R({
920
+ G({
925
921
  type: "success",
926
922
  title: "删除文件夹失败!",
927
923
  message: JSON.stringify((F == null ? void 0 : F.message) || F)
@@ -939,9 +935,9 @@ const Fe = () => {
939
935
  };
940
936
  }
941
937
  }, Yt = { class: "page-setting-content" };
942
- function Zt(n, t, s, e, _, m) {
943
- const a = c("tiny-button"), l = c("svg-button"), o = c("button-group"), g = c("page-general"), u = c("tiny-collapse-item"), P = c("tiny-collapse"), f = c("plugin-setting");
944
- return e.isShow ? (N(), A(f, {
938
+ function Zt(n, t, s, e, m, f) {
939
+ const a = c("tiny-button"), l = c("svg-button"), o = c("button-group"), g = c("page-general"), u = c("tiny-collapse-item"), P = c("tiny-collapse"), _ = c("plugin-setting");
940
+ return e.isShow ? (T(), A(_, {
945
941
  key: 0,
946
942
  title: e.state.title,
947
943
  class: "pageFolder-plugin-setting"
@@ -958,7 +954,7 @@ function Zt(n, t, s, e, _, m) {
958
954
  ])),
959
955
  _: 1
960
956
  }, 8, ["onClick"]),
961
- e.pageSettingState.isNew ? H("", !0) : (N(), A(l, {
957
+ e.pageSettingState.isNew ? H("", !0) : (T(), A(l, {
962
958
  key: 0,
963
959
  name: "delete",
964
960
  placement: "bottom",
@@ -975,7 +971,7 @@ function Zt(n, t, s, e, _, m) {
975
971
  })
976
972
  ]),
977
973
  content: y(() => [
978
- V("div", Yt, [
974
+ x("div", Yt, [
979
975
  r(P, {
980
976
  modelValue: e.state.activeName,
981
977
  "onUpdate:modelValue": t[0] || (t[0] = (D) => e.state.activeName = D)
@@ -1005,11 +1001,11 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1005
1001
  ELEMENT_TAG: ea,
1006
1002
  PAGE_STATUS: ta,
1007
1003
  COMPONENT_NAME: aa
1008
- } = Ge, na = {
1004
+ } = Re, na = {
1009
1005
  components: {
1010
1006
  TinySearch: nt,
1011
1007
  TinyTree: ot,
1012
- TinyCollapse: fe,
1008
+ TinyCollapse: _e,
1013
1009
  TinyCollapseItem: ye,
1014
1010
  TinyIconSearch: dt()
1015
1011
  },
@@ -1028,39 +1024,39 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1028
1024
  } = le(), {
1029
1025
  confirm: e
1030
1026
  } = Q(), {
1031
- initData: _,
1032
- pageState: m,
1027
+ initData: m,
1028
+ pageState: f,
1033
1029
  isBlock: a,
1034
1030
  isSaved: l
1035
- } = me(), {
1031
+ } = fe(), {
1036
1032
  pageSettingState: o,
1037
1033
  changeTreeData: g,
1038
1034
  isCurrentDataSame: u,
1039
1035
  STATIC_PAGE_GROUP_ID: P,
1040
- COMMON_PAGE_GROUP_ID: f
1036
+ COMMON_PAGE_GROUP_ID: _
1041
1037
  } = L(), {
1042
1038
  fetchPageList: D,
1043
1039
  fetchPageDetail: S
1044
1040
  } = ie, {
1045
1041
  setBreadcrumbPage: p
1046
- } = Ke(), h = U([]), G = o.ROOT_ID, F = z({
1042
+ } = Ke(), h = U([]), R = o.ROOT_ID, F = z({
1047
1043
  pageSearchValue: "",
1048
- collapseValue: [P, f],
1044
+ collapseValue: [P, _],
1049
1045
  currentNodeData: {}
1050
1046
  }), Z = (i, d, b) => {
1051
- const T = {
1052
- [G]: {
1053
- id: G,
1047
+ const N = {
1048
+ [R]: {
1049
+ id: R,
1054
1050
  name: "站点根目录",
1055
1051
  children: []
1056
1052
  }
1057
1053
  };
1058
1054
  return i.forEach((O) => {
1059
- T[O[b]] = O, O.parentId === G && T[G].children.push(O);
1055
+ N[O[b]] = O, O.parentId === R && N[R].children.push(O);
1060
1056
  }), i.forEach((O) => {
1061
- let w = T[O[d]];
1062
- w && w.id !== G ? (w.children = w.children || [], w.children.push(O)) : w && w.id;
1063
- }), o.treeDataMapping = T, o.treeDataMapping;
1057
+ let w = N[O[d]];
1058
+ w && w.id !== R ? (w.children = w.children || [], w.children.push(O)) : w && w.id;
1059
+ }), o.treeDataMapping = N, o.treeDataMapping;
1064
1060
  }, X = (i) => {
1065
1061
  Array.isArray(h == null ? void 0 : h.value) && Le(() => {
1066
1062
  h.value.forEach((d) => {
@@ -1068,13 +1064,13 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1068
1064
  });
1069
1065
  });
1070
1066
  }, W = async (i, d) => {
1071
- const b = d || await D(i), T = {
1067
+ const b = d || await D(i), N = {
1072
1068
  groupName: "静态页面",
1073
1069
  groupId: P,
1074
1070
  data: []
1075
1071
  }, O = {
1076
1072
  groupName: "公共页面",
1077
- groupId: f,
1073
+ groupId: _,
1078
1074
  data: []
1079
1075
  };
1080
1076
  b.forEach((j) => {
@@ -1082,30 +1078,30 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1082
1078
  ...j,
1083
1079
  name: j.folderName,
1084
1080
  group: "staticPages"
1085
- }, Ce = j.meta ? {
1081
+ }, ve = j.meta ? {
1086
1082
  ...j,
1087
1083
  ...j.meta,
1088
1084
  name: j.fileName,
1089
1085
  isPage: !0,
1090
1086
  isBody: j.meta.rootElement === ea.Body
1091
1087
  } : Me, {
1092
- children: Ta,
1088
+ children: Na,
1093
1089
  ...Ie
1094
- } = Ce;
1095
- Ce.group === "staticPages" ? T.data.push(Ie) : O.data.push(Ie);
1090
+ } = ve;
1091
+ ve.group === "staticPages" ? N.data.push(Ie) : O.data.push(Ie);
1096
1092
  });
1097
- const w = Z([...T.data], "parentId", "id");
1098
- return T.data = w[G].children, o.pages = [T, O], X(F.pageSearchValue), o.pages;
1093
+ const w = Z([...N.data], "parentId", "id");
1094
+ return N.data = w[R].children, o.pages = [N, O], X(F.pageSearchValue), o.pages;
1099
1095
  };
1100
1096
  o.updateTreeData = async () => await W(s.selectedId);
1101
1097
  const ge = () => {
1102
- m.currentVm = null, m.hoverVm = null, m.properties = {}, m.pageSchema = null;
1098
+ f.currentVm = null, f.hoverVm = null, f.properties = {}, f.pageSchema = null;
1103
1099
  }, $ = (i) => {
1104
1100
  const d = new URL(window.location);
1105
1101
  d.searchParams.delete("blockid"), d.searchParams.set("pageid", i), window.history.pushState({}, "", d);
1106
1102
  }, pe = (i) => {
1107
1103
  if (i !== 0 && !i) {
1108
- $(""), _({
1104
+ $(""), m({
1109
1105
  componentName: aa.Page
1110
1106
  }, {}), oe().layoutState.pageStatus = {
1111
1107
  state: "empty",
@@ -1114,10 +1110,10 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1114
1110
  return;
1115
1111
  }
1116
1112
  S(i).then((d) => {
1117
- $(i), q(), M(), oe().closePlugin(), oe().layoutState.pageStatus = Ne(d.occupier), _(d.page_content, d);
1113
+ $(i), q(), M(), oe().closePlugin(), oe().layoutState.pageStatus = Te(d.occupier), m(d.page_content, d);
1118
1114
  });
1119
1115
  }, ee = (i) => {
1120
- m.hoverVm = null, F.currentNodeData = i;
1116
+ f.hoverVm = null, F.currentNodeData = i;
1121
1117
  let d = "";
1122
1118
  i.isPage && (d = (i == null ? void 0 : i.name) || ""), p([d]), ge(), pe(i.id);
1123
1119
  }, ue = (i, d) => {
@@ -1125,9 +1121,9 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1125
1121
  i.stopPropagation();
1126
1122
  const {
1127
1123
  id: b,
1128
- isPage: T
1124
+ isPage: N
1129
1125
  } = d.data;
1130
- !a() && b === ((O = F == null ? void 0 : F.currentNodeData) == null ? void 0 : O.id) || !T || (l() && u() ? ee(d.data) : e({
1126
+ !a() && b === ((O = F == null ? void 0 : F.currentNodeData) == null ? void 0 : O.id) || !N || (l() && u() ? ee(d.data) : e({
1131
1127
  title: "提示",
1132
1128
  message: `${a() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
1133
1129
  exec: () => {
@@ -1135,9 +1131,9 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1135
1131
  }
1136
1132
  }));
1137
1133
  }, te = (i, d, b) => {
1138
- var T;
1134
+ var N;
1139
1135
  if (i.stopPropagation(), b && d.data.isPage) {
1140
- const O = ((T = d.data.occupier) == null ? void 0 : T.username) || "";
1136
+ const O = ((N = d.data.occupier) == null ? void 0 : N.username) || "";
1141
1137
  Q().message({
1142
1138
  message: `您点击的页面被${O}锁定,暂时无法编辑,请联系解锁`,
1143
1139
  status: "info"
@@ -1151,15 +1147,15 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1151
1147
  g(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy), t("openSettingPanel", d);
1152
1148
  }
1153
1149
  });
1154
- }, ve = (i, {
1150
+ }, Ce = (i, {
1155
1151
  node: d,
1156
1152
  data: b
1157
1153
  }) => {
1158
1154
  !b.isPage && !b.children ? b.trueFolder = !0 : b.trueFolder = !1;
1159
- const T = Ne(b.occupier).state === ta.Lock, O = T ? r(c("SvgIcon"), {
1155
+ const N = Te(b.occupier).state === ta.Lock, O = N ? r(c("SvgIcon"), {
1160
1156
  class: "page-edit-icon",
1161
1157
  name: "locked-outline",
1162
- onMousedown: (w) => te(w, d, T)
1158
+ onMousedown: (w) => te(w, d, N)
1163
1159
  }, null) : null;
1164
1160
  return r("span", {
1165
1161
  class: "tiny-tree-node__label",
@@ -1185,23 +1181,23 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1185
1181
  }, null)]) : null, r(c("SvgIcon"), {
1186
1182
  name: "setting",
1187
1183
  class: "setting page-edit-icon",
1188
- onMousedown: (w) => te(w, d, T)
1184
+ onMousedown: (w) => te(w, d, N)
1189
1185
  }, null)])]);
1190
1186
  };
1191
1187
  Y(() => {
1192
1188
  s.selectedId && W(s.selectedId);
1193
1189
  });
1194
- const C = (i, d) => {
1190
+ const v = (i, d) => {
1195
1191
  var b;
1196
1192
  return i ? ((b = d.name) == null ? void 0 : b.toLowerCase().indexOf(i == null ? void 0 : i.toLowerCase())) !== -1 : !0;
1197
- }, v = (i) => {
1193
+ }, C = (i) => {
1198
1194
  i && h.value.push(i);
1199
1195
  }, I = (i) => {
1200
1196
  i.stopPropagation(), i.preventDefault(), t("add");
1201
1197
  }, k = r(c("SvgIcon"), {
1202
1198
  name: "text-page-folder-closed",
1203
1199
  class: "folder-icon"
1204
- }, null), x = r(c("SvgIcon"), {
1200
+ }, null), E = r(c("SvgIcon"), {
1205
1201
  name: "text-page-folder",
1206
1202
  class: "folder-icon"
1207
1203
  }, null);
@@ -1211,22 +1207,21 @@ const $t = /* @__PURE__ */ K(Qt, [["render", Zt], ["__scopeId", "data-v-10a6e512
1211
1207
  switchPage: ee,
1212
1208
  pageSettingState: o,
1213
1209
  searchPageData: X,
1214
- renderContent: ve,
1210
+ renderContent: Ce,
1215
1211
  refreshPageList: W,
1216
- filterPageTreeData: C,
1217
- getPageTreeRefs: v,
1218
- IconFolderOpened: _t(),
1219
- IconFolderClosed: mt(),
1220
- shrinkIcon: x,
1212
+ filterPageTreeData: v,
1213
+ getPageTreeRefs: C,
1214
+ IconFolderOpened: mt(),
1215
+ IconFolderClosed: ft(),
1216
+ shrinkIcon: E,
1221
1217
  expandIcon: k
1222
1218
  };
1223
1219
  }
1224
- };
1225
- const oa = { class: "app-manage-search" }, sa = { class: "title" }, ra = { class: "app-manage-tree" };
1226
- function la(n, t, s, e, _, m) {
1220
+ }, oa = { class: "app-manage-search" }, sa = { class: "title" }, ra = { class: "app-manage-tree" };
1221
+ function la(n, t, s, e, m, f) {
1227
1222
  const a = c("tiny-icon-search"), l = c("tiny-search"), o = c("tiny-tree"), g = c("tiny-collapse-item"), u = c("tiny-collapse");
1228
- return N(), J(de, null, [
1229
- V("div", oa, [
1223
+ return T(), J(de, null, [
1224
+ x("div", oa, [
1230
1225
  r(l, {
1231
1226
  modelValue: e.state.pageSearchValue,
1232
1227
  "onUpdate:modelValue": [
@@ -1248,16 +1243,16 @@ function la(n, t, s, e, _, m) {
1248
1243
  class: "page-manage-collapse lowcode-scrollbar"
1249
1244
  }, {
1250
1245
  default: y(() => [
1251
- (N(!0), J(de, null, Be(e.pageSettingState.pages, (P, f) => (N(), A(g, {
1252
- key: f,
1246
+ (T(!0), J(de, null, Be(e.pageSettingState.pages, (P, _) => (T(), A(g, {
1247
+ key: _,
1253
1248
  name: P.groupId
1254
1249
  }, {
1255
1250
  title: y(() => [
1256
- V("span", sa, _e(P.groupName), 1)
1251
+ x("span", sa, me(P.groupName), 1)
1257
1252
  ]),
1258
1253
  default: y(() => [
1259
- V("div", ra, [
1260
- (N(), A(o, {
1254
+ x("div", ra, [
1255
+ (T(), A(o, {
1261
1256
  ref_for: !0,
1262
1257
  ref: e.getPageTreeRefs,
1263
1258
  key: e.pageSettingState.pageTreeKey,
@@ -1308,11 +1303,11 @@ const ca = /* @__PURE__ */ K(na, [["render", la], ["__scopeId", "data-v-796a5e7e
1308
1303
  appInfoState: n
1309
1304
  } = le(), {
1310
1305
  pageState: t
1311
- } = me(), {
1306
+ } = fe(), {
1312
1307
  pageSettingState: s,
1313
1308
  DEFAULT_PAGE: e,
1314
- isTemporaryPage: _,
1315
- initCurrentPageData: m
1309
+ isTemporaryPage: m,
1310
+ initCurrentPageData: f
1316
1311
  } = L(), a = U(null), l = s.ROOT_ID, o = Xe().getDocsUrl("page"), g = z({
1317
1312
  isFolder: !1
1318
1313
  }), u = (p) => {
@@ -1334,17 +1329,17 @@ const ca = /* @__PURE__ */ K(na, [["render", la], ["__scopeId", "data-v-796a5e7e
1334
1329
  }, s.currentPageDataCopy = ne(!0, {}, s.currentPageData), g.isFolder = !0, Fe();
1335
1330
  };
1336
1331
  Y(() => {
1337
- _.saved && se();
1332
+ m.saved && se();
1338
1333
  });
1339
- const f = async (p) => {
1334
+ const _ = async (p) => {
1340
1335
  var F;
1341
1336
  g.isFolder = !p.data.isPage, s.isNew = !1;
1342
1337
  const h = p.data.id !== s.currentPageData.id;
1343
1338
  g.isFolder ? (h && q(), Fe()) : (h && M(), se());
1344
- const G = await Se((F = p.data) == null ? void 0 : F.id);
1345
- m(G);
1339
+ const R = await Se((F = p.data) == null ? void 0 : F.id);
1340
+ f(R);
1346
1341
  };
1347
- return je("openSettingPanel", f), {
1342
+ return je("openSettingPanel", _), {
1348
1343
  state: g,
1349
1344
  appInfoState: n,
1350
1345
  pageState: t,
@@ -1355,16 +1350,16 @@ const ca = /* @__PURE__ */ K(na, [["render", la], ["__scopeId", "data-v-796a5e7e
1355
1350
  pluginPanelClosed: () => {
1356
1351
  q(), M();
1357
1352
  },
1358
- openSettingPanel: f,
1353
+ openSettingPanel: _,
1359
1354
  createNewFolder: P,
1360
1355
  createNewPage: u,
1361
1356
  docsUrl: o
1362
1357
  };
1363
1358
  }
1364
1359
  };
1365
- function pa(n, t, s, e, _, m) {
1360
+ function pa(n, t, s, e, m, f) {
1366
1361
  const a = c("svg-button"), l = c("page-tree"), o = c("plugin-panel"), g = c("page-setting"), u = c("page-folder-setting");
1367
- return N(), J(de, null, [
1362
+ return T(), J(de, null, [
1368
1363
  r(o, {
1369
1364
  title: s.title,
1370
1365
  onClose: e.pluginPanelClosed,
@@ -1412,7 +1407,7 @@ const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f
1412
1407
  type: "plugins",
1413
1408
  icon: "plugin-icon-page",
1414
1409
  align: "top"
1415
- }, _a = {
1410
+ }, ma = {
1416
1411
  app: "",
1417
1412
  name: "",
1418
1413
  route: "",
@@ -1436,7 +1431,7 @@ const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f
1436
1431
  parentId: "none",
1437
1432
  isBody: !1,
1438
1433
  group: "staticPages"
1439
- }, E = z({
1434
+ }, V = z({
1440
1435
  currentPageDataCopy: {},
1441
1436
  // 记录当前页最开始的状态,当用户点击取消按钮的时候恢复到初始状态
1442
1437
  currentPageData: {},
@@ -1449,51 +1444,51 @@ const ua = /* @__PURE__ */ K(ga, [["render", pa], ["__scopeId", "data-v-2467df4f
1449
1444
  // 根节点ID
1450
1445
  updateTreeData: null,
1451
1446
  treeDataMapping: {}
1452
- }), ma = z({
1447
+ }), fa = z({
1453
1448
  saved: !1
1454
1449
  }), Pa = () => {
1455
- const n = E.currentPageData || {}, t = E.currentPageDataCopy || {};
1450
+ const n = V.currentPageData || {}, t = V.currentPageDataCopy || {};
1456
1451
  let s = !0;
1457
1452
  return Object.keys(t).some((e) => {
1458
1453
  if (["children", "label", "createdBy", "assets", "occupier"].includes(e))
1459
1454
  return !1;
1460
1455
  if (e === "page_content") {
1461
- const _ = {
1456
+ const m = {
1462
1457
  inputs: t[e].inputs,
1463
1458
  outputs: t[e].outputs,
1464
1459
  lifeCycles: t[e].lifeCycles
1465
- }, m = {
1460
+ }, f = {
1466
1461
  inputs: n[e].inputs,
1467
1462
  outputs: n[e].outputs,
1468
1463
  lifeCycles: n[e].lifeCycles
1469
1464
  };
1470
- JSON.stringify(_) !== JSON.stringify(m) && (s = !1);
1465
+ JSON.stringify(m) !== JSON.stringify(f) && (s = !1);
1471
1466
  } else
1472
1467
  t[e] !== n[e] && (s = !1);
1473
1468
  return !s;
1474
1469
  }), s;
1475
- }, fa = (n, t) => {
1470
+ }, _a = (n, t) => {
1476
1471
  var s, e;
1477
1472
  if (n && t && n !== t) {
1478
- const _ = E.treeDataMapping[n], m = E.treeDataMapping[t], a = E.currentPageData.id, l = (e = (s = m.children) == null ? void 0 : s.findIndex) == null ? void 0 : e.call(s, ({ id: o }) => o === a);
1479
- l > -1 && (m.children.splice(l, 1), _.children || (_.children = []), _.children.unshift(E.currentPageData), E.pageTreeKey++);
1473
+ const m = V.treeDataMapping[n], f = V.treeDataMapping[t], a = V.currentPageData.id, l = (e = (s = f.children) == null ? void 0 : s.findIndex) == null ? void 0 : e.call(s, ({ id: o }) => o === a);
1474
+ l > -1 && (f.children.splice(l, 1), m.children || (m.children = []), m.children.unshift(V.currentPageData), V.pageTreeKey++);
1480
1475
  }
1481
- }, ya = () => E.currentPageData.page_content || {}, Sa = (n) => {
1482
- E.currentPageData = n, E.currentPageDataCopy = ne(!0, {}, n), E.oldParentId = n.parentId;
1476
+ }, ya = () => V.currentPageData.page_content || {}, Sa = (n) => {
1477
+ V.currentPageData = n, V.currentPageDataCopy = ne(!0, {}, n), V.oldParentId = n.parentId;
1483
1478
  }, Da = () => {
1484
- E.currentPageData = {}, E.currentPageDataCopy = {}, E.oldParentId = null;
1485
- }, ha = () => !ce(E.currentPageData, E.currentPageDataCopy), va = 0, Ca = 1, Ia = () => ({
1486
- DEFAULT_PAGE: _a,
1487
- pageSettingState: E,
1488
- isTemporaryPage: ma,
1479
+ V.currentPageData = {}, V.currentPageDataCopy = {}, V.oldParentId = null;
1480
+ }, ha = () => !ce(V.currentPageData, V.currentPageDataCopy), Ca = 0, va = 1, Ia = () => ({
1481
+ DEFAULT_PAGE: ma,
1482
+ pageSettingState: V,
1483
+ isTemporaryPage: fa,
1489
1484
  isCurrentDataSame: Pa,
1490
- changeTreeData: fa,
1485
+ changeTreeData: _a,
1491
1486
  getPageContent: ya,
1492
1487
  resetPageData: Da,
1493
1488
  initCurrentPageData: Sa,
1494
1489
  isChangePageData: ha,
1495
- STATIC_PAGE_GROUP_ID: va,
1496
- COMMON_PAGE_GROUP_ID: Ca
1490
+ STATIC_PAGE_GROUP_ID: Ca,
1491
+ COMMON_PAGE_GROUP_ID: va
1497
1492
  }), ba = {
1498
1493
  id: "engine.service.page",
1499
1494
  type: "MetaService",
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-plugin-page",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "scripts": {
8
8
  "build": "vite build"
9
9
  },
10
+ "type": "module",
10
11
  "main": "dist/index.js",
11
12
  "module": "dist/index.js",
12
13
  "files": [
@@ -24,16 +25,16 @@
24
25
  "license": "MIT",
25
26
  "homepage": "https://opentiny.design/tiny-engine",
26
27
  "dependencies": {
27
- "@opentiny/tiny-engine-common": "2.0.0-alpha.2",
28
- "@opentiny/tiny-engine-http": "2.0.0-alpha.2",
29
- "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.2",
30
- "@opentiny/tiny-engine-utils": "2.0.0-alpha.2"
28
+ "@opentiny/tiny-engine-common": "2.0.0-alpha.3",
29
+ "@opentiny/tiny-engine-http": "2.0.0-alpha.3",
30
+ "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3",
31
+ "@opentiny/tiny-engine-utils": "2.0.0-alpha.3"
31
32
  },
32
33
  "devDependencies": {
33
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.2",
34
- "@vitejs/plugin-vue": "^4.2.3",
35
- "@vitejs/plugin-vue-jsx": "^3.1.0",
36
- "vite": "^4.3.7"
34
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
35
+ "@vitejs/plugin-vue": "^5.1.2",
36
+ "@vitejs/plugin-vue-jsx": "^4.0.1",
37
+ "vite": "^5.4.2"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "@opentiny/vue": "^3.14.0",
@@ -41,5 +42,5 @@
41
42
  "@opentiny/vue-renderless": "^3.14.0",
42
43
  "vue": "^3.4.15"
43
44
  },
44
- "gitHead": "695ecd00f21aa39965a9ddb02590ae274f92cd8e"
45
+ "gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
45
46
  }