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