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