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