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