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