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