@opentiny/tiny-engine-plugin-page 2.2.0 → 2.3.0
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 +812 -787
- package/dist/style.css +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { ref as K, watchEffect as Pe, resolveComponent as
|
|
3
|
-
import { getMetaApi as
|
|
4
|
-
import { BlockHistoryList as
|
|
2
|
+
import { ref as K, watchEffect as Pe, resolveComponent as P, createBlock as H, openBlock as v, computed as $, createElementBlock as U, createVNode as d, createElementVNode as V, withCtx as S, reactive as le, createCommentVNode as j, resolveDynamicComponent as Je, createTextVNode as ue, Fragment as oe, renderList as Se, normalizeClass as ve, renderSlot as ot, toDisplayString as de, onMounted as st, onUnmounted as Be, provide as rt, inject as lt } from "vue";
|
|
3
|
+
import { getMetaApi as G, META_SERVICE as B, usePage as ee, useBlock as ct, useModal as se, getMergeMeta as Ae, useNotify as M, useCanvas as re, getMergeRegistry as Ke, useLayout as he, useMessage as we, useHelp as it, useBreadcrumb as gt, getOptions as Me, HOOK_NAME as ut } from "@opentiny/tiny-engine-meta-register";
|
|
4
|
+
import { BlockHistoryList as dt, MetaCodeEditor as pt, ButtonGroup as We, SvgButton as be, PluginSetting as Xe, LifeCycles as mt, PluginPanel as ft } from "@opentiny/tiny-engine-common";
|
|
5
5
|
import { isEqual as pe, extend as me } from "@opentiny/vue-renderless/common/object";
|
|
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
|
|
13
|
-
import { IconSearch as
|
|
14
|
-
import { getCanvasStatus as
|
|
15
|
-
import {
|
|
16
|
-
const
|
|
17
|
-
fetchPageList:
|
|
18
|
-
fetchPageDetail:
|
|
19
|
-
requestDeletePage:
|
|
20
|
-
requestCreatePage:
|
|
21
|
-
requestCopyPage:
|
|
22
|
-
fetchPageHistory:
|
|
23
|
-
fetchHistoryDetail:
|
|
6
|
+
import { Checkbox as ke, CollapseItem as Te, Collapse as Fe, Button as ze, Input as Qe, Popover as Pt, Search as yt, Radio as _t, Select as ht, FormItem as Dt, Form as St } from "@opentiny/vue";
|
|
7
|
+
import { constants as Oe } from "@opentiny/tiny-engine-utils";
|
|
8
|
+
import { isVsCodeEnv as Ye } from "@opentiny/tiny-engine-common/js/environments";
|
|
9
|
+
import { handlePageUpdate as Ze } from "@opentiny/tiny-engine-common/js/http";
|
|
10
|
+
import { generatePage as vt, generateRouter as bt } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
|
|
11
|
+
import { previewPage as Ct } from "@opentiny/tiny-engine-common/js/preview";
|
|
12
|
+
import Nt from "@opentiny/vue-renderless/common/deps/throttle";
|
|
13
|
+
import { IconSearch as It, IconFolderClosed as wt, IconFolderOpened as kt } from "@opentiny/vue-icon";
|
|
14
|
+
import { getCanvasStatus as $e } from "@opentiny/tiny-engine-common/js/canvas";
|
|
15
|
+
import { REGEXP_ROUTE as He, REGEXP_FOLDER_NAME as Tt, REGEXP_PAGE_NAME as Ft } from "@opentiny/tiny-engine-common/js/verification";
|
|
16
|
+
const Ot = (a) => G(B.Http).get(`/app-center/api/pages/list/${a}`), Ee = (a) => G(B.Http).get(`/app-center/api/pages/detail/${a}`), Et = (a) => G(B.Http).get(`/app-center/api/pages/delete/${a}`), xt = (a) => G(B.Http).post("/app-center/api/pages/create", a), Vt = (a, t) => G(B.Http).post(`/app-center/api/pages/update/${a}`, t), Rt = (a) => G(B.Http).post("/app-center/api/pages/copy", a), et = (a) => G(B.Http).get(`/app-center/api/pages/histories?page=${a}`), Gt = (a) => G(B.Http).post("/app-center/api/pageHistory/restore", a), Bt = (a) => G(B.Http).get(`/app-center/api/pages/histories/${a}`), At = (a, t) => G(B.Http).post(`/app-center/api/pages/update/${a}`, t), ce = {
|
|
17
|
+
fetchPageList: Ot,
|
|
18
|
+
fetchPageDetail: Ee,
|
|
19
|
+
requestDeletePage: Et,
|
|
20
|
+
requestCreatePage: xt,
|
|
21
|
+
requestCopyPage: Rt,
|
|
22
|
+
fetchPageHistory: et,
|
|
23
|
+
fetchHistoryDetail: Bt,
|
|
24
24
|
handleRouteHomeUpdate: Vt,
|
|
25
25
|
requestRestorePageHistory: Gt,
|
|
26
|
-
requestUpdatePage:
|
|
27
|
-
}, te = (
|
|
28
|
-
const n =
|
|
29
|
-
for (const [e,
|
|
30
|
-
n[e] =
|
|
26
|
+
requestUpdatePage: At
|
|
27
|
+
}, te = (a, t) => {
|
|
28
|
+
const n = a.__vccOpts || a;
|
|
29
|
+
for (const [e, s] of t)
|
|
30
|
+
n[e] = s;
|
|
31
31
|
return n;
|
|
32
|
-
},
|
|
32
|
+
}, Mt = {
|
|
33
33
|
components: {
|
|
34
|
-
BlockHistoryList:
|
|
34
|
+
BlockHistoryList: dt
|
|
35
35
|
},
|
|
36
36
|
props: {
|
|
37
37
|
curPageData: {
|
|
@@ -40,69 +40,77 @@ const Et = (t) => q(j.Http).get(`/app-center/api/pages/list/${t}`), Oe = (t) =>
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
emits: ["restorePage"],
|
|
43
|
-
setup(
|
|
44
|
-
const { pageSettingState: n } = ee(), { getDateFromNow:
|
|
45
|
-
const { id:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
}) :
|
|
43
|
+
setup(a, { emit: t }) {
|
|
44
|
+
const { pageSettingState: n, getFamily: e } = ee(), { getDateFromNow: s } = ct(), { confirm: o } = se(), r = K([]), c = (y) => {
|
|
45
|
+
const { id: f, version: k } = G(B.GlobalService).getBaseInfo(), m = k ? `&app=${f}&version=${k}` : "";
|
|
46
|
+
y ? et(y + m).then((h) => {
|
|
47
|
+
h && (h.forEach((i) => {
|
|
48
|
+
i.backupTitle = i.message, i.backupTime = s(new Date(i.time));
|
|
49
|
+
}), r.value = h.reverse());
|
|
50
|
+
}) : r.value = [];
|
|
51
51
|
};
|
|
52
52
|
return Pe(() => {
|
|
53
|
-
var
|
|
54
|
-
const
|
|
55
|
-
|
|
53
|
+
var f;
|
|
54
|
+
const y = ((f = n.currentPageData) == null ? void 0 : f.id) || "";
|
|
55
|
+
c(y);
|
|
56
56
|
}), {
|
|
57
|
-
list:
|
|
58
|
-
previewHistory: (
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
list: r,
|
|
58
|
+
previewHistory: async (y) => {
|
|
59
|
+
var f, k, m, h;
|
|
60
|
+
if (y) {
|
|
61
|
+
const i = (k = (f = G(B.ThemeSwitch)) == null ? void 0 : f.getThemeState()) == null ? void 0 : k.theme, p = {
|
|
62
|
+
id: Number(y.page),
|
|
63
|
+
history: y.id,
|
|
64
|
+
framework: (m = Ae("engine.config")) == null ? void 0 : m.dslMode,
|
|
65
|
+
platform: (h = Ae("engine.config")) == null ? void 0 : h.platformId,
|
|
66
|
+
pageInfo: {
|
|
67
|
+
name: y.name,
|
|
68
|
+
schema: y.page_content
|
|
69
|
+
},
|
|
70
|
+
theme: i
|
|
71
|
+
};
|
|
72
|
+
p.ancestors = await e(p), Ct(p);
|
|
73
|
+
}
|
|
66
74
|
},
|
|
67
|
-
restoreHistory: (
|
|
75
|
+
restoreHistory: (y) => {
|
|
68
76
|
o({
|
|
69
77
|
title: "提示",
|
|
70
78
|
message: "您即将还原历史页面,是否继续还原?",
|
|
71
79
|
exec: () => {
|
|
72
|
-
|
|
80
|
+
t("restorePage", y);
|
|
73
81
|
}
|
|
74
82
|
});
|
|
75
83
|
}
|
|
76
84
|
};
|
|
77
85
|
}
|
|
78
86
|
};
|
|
79
|
-
function
|
|
80
|
-
const r =
|
|
81
|
-
return v(),
|
|
87
|
+
function Ht(a, t, n, e, s, o) {
|
|
88
|
+
const r = P("block-history-list");
|
|
89
|
+
return v(), H(r, {
|
|
82
90
|
history: e.list,
|
|
83
91
|
onPreview: e.previewHistory,
|
|
84
92
|
onRestore: e.restoreHistory
|
|
85
93
|
}, null, 8, ["history", "onPreview", "onRestore"]);
|
|
86
94
|
}
|
|
87
|
-
const
|
|
95
|
+
const Ut = /* @__PURE__ */ te(Mt, [["render", Ht]]), Lt = {
|
|
88
96
|
components: {
|
|
89
|
-
MetaCodeEditor:
|
|
90
|
-
TinyCheckbox:
|
|
97
|
+
MetaCodeEditor: pt,
|
|
98
|
+
TinyCheckbox: ke
|
|
91
99
|
},
|
|
92
100
|
setup() {
|
|
93
|
-
const
|
|
101
|
+
const a = K(""), t = K(""), { pageSettingState: n } = ee(), e = $(() => n.currentPageData);
|
|
94
102
|
return Pe(() => {
|
|
95
103
|
var c, l;
|
|
96
|
-
|
|
104
|
+
a.value = ((c = n.currentPageData.page_content) == null ? void 0 : c.inputs) || "", t.value = ((l = n.currentPageData.page_content) == null ? void 0 : l.outputs) || "";
|
|
97
105
|
}), {
|
|
98
|
-
inputValue:
|
|
99
|
-
outputValue:
|
|
106
|
+
inputValue: a,
|
|
107
|
+
outputValue: t,
|
|
100
108
|
saveInputValue: (c) => {
|
|
101
109
|
try {
|
|
102
110
|
const l = JSON.parse(c.content);
|
|
103
|
-
|
|
111
|
+
a.value = c.content, e.value.page_content.inputs = l;
|
|
104
112
|
} catch (l) {
|
|
105
|
-
|
|
113
|
+
M({
|
|
106
114
|
title: "输入配置保存失败(必须符合JSON格式)",
|
|
107
115
|
message: `${(l == null ? void 0 : l.message) || l}`,
|
|
108
116
|
type: "error"
|
|
@@ -112,9 +120,9 @@ const Lt = /* @__PURE__ */ te(Ht, [["render", Ut]]), qt = {
|
|
|
112
120
|
saveOutputValue: (c) => {
|
|
113
121
|
try {
|
|
114
122
|
const l = JSON.parse(c.content);
|
|
115
|
-
|
|
123
|
+
t.value = c.content, e.value.page_content.outputs = l;
|
|
116
124
|
} catch (l) {
|
|
117
|
-
|
|
125
|
+
M({
|
|
118
126
|
title: "输出配置保存失败(必须符合JSON格式)",
|
|
119
127
|
message: `${(l == null ? void 0 : l.message) || l}`,
|
|
120
128
|
type: "error"
|
|
@@ -125,11 +133,11 @@ const Lt = /* @__PURE__ */ te(Ht, [["render", Ut]]), qt = {
|
|
|
125
133
|
hasContent: (c) => Array.isArray(c) && c.length > 0 || typeof c == "object" && Object.keys(c).length > 0
|
|
126
134
|
};
|
|
127
135
|
}
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
const r =
|
|
131
|
-
return v(),
|
|
132
|
-
|
|
136
|
+
}, qt = { class: "input-or-output" };
|
|
137
|
+
function jt(a, t, n, e, s, o) {
|
|
138
|
+
const r = P("svg-icon"), c = P("meta-code-editor"), l = P("tiny-checkbox");
|
|
139
|
+
return v(), U("div", qt, [
|
|
140
|
+
d(c, {
|
|
133
141
|
modelValue: e.inputValue,
|
|
134
142
|
title: "输入配置",
|
|
135
143
|
"button-text": "输入配置",
|
|
@@ -139,15 +147,15 @@ function Jt(t, a, n, e, o, s) {
|
|
|
139
147
|
onSave: e.saveInputValue
|
|
140
148
|
}, {
|
|
141
149
|
icon: S(() => [
|
|
142
|
-
|
|
150
|
+
d(r, {
|
|
143
151
|
class: "edit-btn-icon",
|
|
144
152
|
name: "to-edit"
|
|
145
153
|
})
|
|
146
154
|
]),
|
|
147
155
|
_: 1
|
|
148
156
|
}, 8, ["modelValue", "buttonShowContent", "onSave"]),
|
|
149
|
-
|
|
150
|
-
|
|
157
|
+
t[2] || (t[2] = V("div", { class: "input-output-tips" }, "传递给页面的参数(类似组件的输入属性)", -1)),
|
|
158
|
+
d(c, {
|
|
151
159
|
modelValue: e.outputValue,
|
|
152
160
|
title: "输出配置",
|
|
153
161
|
"button-text": "输出配置",
|
|
@@ -157,59 +165,59 @@ function Jt(t, a, n, e, o, s) {
|
|
|
157
165
|
onSave: e.saveOutputValue
|
|
158
166
|
}, {
|
|
159
167
|
icon: S(() => [
|
|
160
|
-
|
|
168
|
+
d(r, {
|
|
161
169
|
class: "edit-btn-icon",
|
|
162
170
|
name: "to-edit"
|
|
163
171
|
})
|
|
164
172
|
]),
|
|
165
173
|
_: 1
|
|
166
174
|
}, 8, ["modelValue", "buttonShowContent", "onSave"]),
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
t[3] || (t[3] = V("div", { class: "input-output-div" }, "页面传递出的事件(类似组件触发的输出事件)", -1)),
|
|
176
|
+
d(l, {
|
|
169
177
|
class: "selectHome",
|
|
170
178
|
modelValue: e.pageSettingState.currentPageData.isBody,
|
|
171
|
-
"onUpdate:modelValue":
|
|
179
|
+
"onUpdate:modelValue": t[0] || (t[0] = (_) => e.pageSettingState.currentPageData.isBody = _)
|
|
172
180
|
}, {
|
|
173
|
-
default: S(() =>
|
|
174
|
-
|
|
181
|
+
default: S(() => t[1] || (t[1] = [
|
|
182
|
+
V("span", null, "设为根元素为Body", -1)
|
|
175
183
|
])),
|
|
176
184
|
_: 1
|
|
177
185
|
}, 8, ["modelValue"]),
|
|
178
|
-
|
|
186
|
+
t[4] || (t[4] = V("div", { class: "input-output-div" }, "默认为div", -1))
|
|
179
187
|
]);
|
|
180
188
|
}
|
|
181
|
-
const
|
|
189
|
+
const Jt = /* @__PURE__ */ te(Lt, [["render", jt], ["__scopeId", "data-v-093962cb"]]), fe = {
|
|
182
190
|
id: "engine.plugins.appmanage",
|
|
183
191
|
title: "页面",
|
|
184
192
|
type: "plugins",
|
|
185
193
|
icon: "plugin-icon-page",
|
|
186
194
|
align: "top"
|
|
187
195
|
}, {
|
|
188
|
-
COMPONENT_NAME:
|
|
189
|
-
} =
|
|
190
|
-
|
|
196
|
+
COMPONENT_NAME: Kt
|
|
197
|
+
} = Oe, xe = K(!1), De = () => {
|
|
198
|
+
xe.value = !0;
|
|
191
199
|
}, Z = () => {
|
|
192
|
-
|
|
200
|
+
xe.value = !1;
|
|
193
201
|
const {
|
|
194
|
-
resetPageData:
|
|
202
|
+
resetPageData: a
|
|
195
203
|
} = ee();
|
|
196
|
-
|
|
204
|
+
a();
|
|
197
205
|
}, Ue = {
|
|
198
206
|
general: "general",
|
|
199
207
|
inputOutput: "inputOutput",
|
|
200
208
|
lifeCycles: "lifeCycles",
|
|
201
209
|
history: "history"
|
|
202
|
-
},
|
|
210
|
+
}, Wt = {
|
|
203
211
|
components: {
|
|
204
|
-
TinyButton:
|
|
205
|
-
TinyCollapse:
|
|
212
|
+
TinyButton: ze,
|
|
213
|
+
TinyCollapse: Fe,
|
|
206
214
|
TinyCollapseItem: Te,
|
|
207
|
-
PageInputOutput:
|
|
208
|
-
LifeCycles:
|
|
209
|
-
PageHistory:
|
|
215
|
+
PageInputOutput: Jt,
|
|
216
|
+
LifeCycles: mt,
|
|
217
|
+
PageHistory: Ut,
|
|
210
218
|
PluginSetting: Xe,
|
|
211
|
-
SvgButton:
|
|
212
|
-
ButtonGroup:
|
|
219
|
+
SvgButton: be,
|
|
220
|
+
ButtonGroup: We
|
|
213
221
|
},
|
|
214
222
|
props: {
|
|
215
223
|
isFolder: {
|
|
@@ -218,156 +226,156 @@ const Kt = /* @__PURE__ */ te(qt, [["render", Jt], ["__scopeId", "data-v-b78f330
|
|
|
218
226
|
}
|
|
219
227
|
},
|
|
220
228
|
emits: ["openNewPage"],
|
|
221
|
-
setup(
|
|
222
|
-
emit:
|
|
229
|
+
setup(a, {
|
|
230
|
+
emit: t
|
|
223
231
|
}) {
|
|
224
232
|
var Ie;
|
|
225
233
|
const {
|
|
226
234
|
requestCreatePage: n,
|
|
227
235
|
requestDeletePage: e
|
|
228
236
|
} = ce, {
|
|
229
|
-
getDefaultPage:
|
|
230
|
-
pageSettingState:
|
|
237
|
+
getDefaultPage: s,
|
|
238
|
+
pageSettingState: o,
|
|
231
239
|
changeTreeData: r,
|
|
232
240
|
isCurrentDataSame: c,
|
|
233
241
|
initCurrentPageData: l,
|
|
234
|
-
isTemporaryPage:
|
|
235
|
-
STATIC_PAGE_GROUP_ID:
|
|
242
|
+
isTemporaryPage: _,
|
|
243
|
+
STATIC_PAGE_GROUP_ID: y
|
|
236
244
|
} = ee(), {
|
|
237
|
-
pageState:
|
|
238
|
-
initData:
|
|
245
|
+
pageState: f,
|
|
246
|
+
initData: k
|
|
239
247
|
} = re(), {
|
|
240
248
|
confirm: m
|
|
241
|
-
} = se(), h =
|
|
249
|
+
} = se(), h = Ke(fe.type, fe.id), i = h.components.PageGeneral, p = (Ie = h == null ? void 0 : h.options) == null ? void 0 : Ie.beforeCreatePage, b = K(null), q = le({
|
|
242
250
|
activeName: Object.values(Ue),
|
|
243
251
|
title: "页面设置",
|
|
244
252
|
historyMessage: ""
|
|
245
|
-
}),
|
|
246
|
-
pe(
|
|
253
|
+
}), A = () => {
|
|
254
|
+
pe(o.currentPageData, o.currentPageDataCopy) ? Z() : m({
|
|
247
255
|
title: "提示",
|
|
248
256
|
message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
|
|
249
257
|
exec: () => {
|
|
250
|
-
|
|
258
|
+
o.isNew || (r(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy)), Z();
|
|
251
259
|
}
|
|
252
260
|
});
|
|
253
261
|
}, X = async () => {
|
|
254
262
|
const {
|
|
255
|
-
page_content:
|
|
256
|
-
...
|
|
257
|
-
} =
|
|
258
|
-
page_content:
|
|
259
|
-
...
|
|
260
|
-
} =
|
|
261
|
-
...
|
|
262
|
-
...
|
|
263
|
+
page_content: N,
|
|
264
|
+
...F
|
|
265
|
+
} = s(), {
|
|
266
|
+
page_content: E,
|
|
267
|
+
...x
|
|
268
|
+
} = o.currentPageData, L = {
|
|
269
|
+
...F,
|
|
270
|
+
...x,
|
|
263
271
|
page_content: {
|
|
264
|
-
...
|
|
265
|
-
...
|
|
266
|
-
fileName:
|
|
272
|
+
...N,
|
|
273
|
+
...E,
|
|
274
|
+
fileName: o.currentPageData.name
|
|
267
275
|
},
|
|
268
|
-
app:
|
|
276
|
+
app: G(B.GlobalService).getBaseInfo().id,
|
|
269
277
|
isPage: !0
|
|
270
278
|
};
|
|
271
|
-
|
|
272
|
-
|
|
279
|
+
L.id && (delete L.id, delete L._id), p && await p(L), n(L).then((Q) => {
|
|
280
|
+
o.updateTreeData(), o.isNew = !1, _.saved = !1, t("openNewPage", Q), Z(), he().closePlugin(), M({
|
|
273
281
|
type: "success",
|
|
274
282
|
message: "新建页面成功!"
|
|
275
|
-
}),
|
|
283
|
+
}), Ye && vt(Q);
|
|
276
284
|
}).catch((Q) => {
|
|
277
|
-
|
|
285
|
+
M({
|
|
278
286
|
type: "error",
|
|
279
287
|
title: "新建页面失败",
|
|
280
288
|
message: JSON.stringify((Q == null ? void 0 : Q.message) || Q)
|
|
281
289
|
});
|
|
282
290
|
});
|
|
283
|
-
},
|
|
284
|
-
var
|
|
285
|
-
const
|
|
286
|
-
return
|
|
287
|
-
}, D = (
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
...
|
|
291
|
-
...
|
|
291
|
+
}, g = (N, F) => {
|
|
292
|
+
var L;
|
|
293
|
+
const E = o.currentPageDataCopy.route !== o.currentPageData.route, x = ((L = f == null ? void 0 : f.currentPage) == null ? void 0 : L.id) === N;
|
|
294
|
+
return Ze(N, F, E, x);
|
|
295
|
+
}, D = (N) => {
|
|
296
|
+
N.id = N.page, ["page", "backupTime", "backupTitle", "time"].forEach((x) => delete N[x]);
|
|
297
|
+
const E = {
|
|
298
|
+
...o.currentPageData,
|
|
299
|
+
...N,
|
|
292
300
|
message: "还原页面"
|
|
293
301
|
};
|
|
294
|
-
|
|
295
|
-
var
|
|
296
|
-
((
|
|
302
|
+
g(N.id, E).then((x) => {
|
|
303
|
+
var L;
|
|
304
|
+
((L = f == null ? void 0 : f.currentPage) == null ? void 0 : L.id) === (x == null ? void 0 : x.id) && k(x.page_content, x);
|
|
297
305
|
});
|
|
298
|
-
},
|
|
306
|
+
}, T = async () => {
|
|
299
307
|
const {
|
|
300
|
-
id:
|
|
301
|
-
name:
|
|
302
|
-
page_content:
|
|
303
|
-
} =
|
|
304
|
-
...
|
|
308
|
+
id: N,
|
|
309
|
+
name: F,
|
|
310
|
+
page_content: E
|
|
311
|
+
} = o.currentPageData, x = {
|
|
312
|
+
...o.currentPageData,
|
|
305
313
|
page_content: {
|
|
306
|
-
...
|
|
307
|
-
fileName:
|
|
314
|
+
...E,
|
|
315
|
+
fileName: F
|
|
308
316
|
}
|
|
309
|
-
},
|
|
310
|
-
l(
|
|
311
|
-
},
|
|
312
|
-
if (!
|
|
317
|
+
}, L = await g(N, x);
|
|
318
|
+
l(L);
|
|
319
|
+
}, I = (N) => {
|
|
320
|
+
if (!N)
|
|
313
321
|
return;
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
...
|
|
317
|
-
...
|
|
322
|
+
const F = o.currentPageData.page_content;
|
|
323
|
+
F.lifeCycles = {
|
|
324
|
+
...F.lifeCycles || {},
|
|
325
|
+
...N
|
|
318
326
|
};
|
|
319
327
|
}, z = () => {
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
},
|
|
328
|
+
const N = o.currentPageData, F = me(!0, {}, N);
|
|
329
|
+
o.isNew = !0, F.name = `${F.name}Copy`, F.route = `${F.route}Copy`, o.currentPageData = F, o.currentPageDataCopy = me(!0, {}, F);
|
|
330
|
+
}, R = () => {
|
|
323
331
|
c() ? z() : m({
|
|
324
332
|
title: "提示",
|
|
325
333
|
message: "您即将复制的页面有更改未保存,是否确定跳过更改直接复制?",
|
|
326
334
|
exec: () => {
|
|
327
|
-
r(
|
|
335
|
+
r(o.oldParentId, o.currentPageData.parentId), Object.assign(o.currentPageData, o.currentPageDataCopy), z();
|
|
328
336
|
}
|
|
329
337
|
});
|
|
330
338
|
}, ie = () => {
|
|
331
|
-
m({
|
|
339
|
+
o.isNew ? (o.currentPageData.message = "Page auto save", X()) : m({
|
|
332
340
|
title: "创建历史备份信息",
|
|
333
341
|
message: {
|
|
334
|
-
render: () =>
|
|
342
|
+
render: () => d(Qe, {
|
|
335
343
|
placeholder: "历史备份信息",
|
|
336
|
-
modelValue:
|
|
337
|
-
"onUpdate:modelValue": (
|
|
344
|
+
modelValue: q.historyMessage,
|
|
345
|
+
"onUpdate:modelValue": (x) => q.historyMessage = x
|
|
338
346
|
}, null)
|
|
339
347
|
},
|
|
340
348
|
exec: () => {
|
|
341
|
-
|
|
349
|
+
o.currentPageData.message = q.historyMessage.trim() || "Page auto save", T(), q.historyMessage = "";
|
|
342
350
|
}
|
|
343
351
|
});
|
|
344
352
|
}, ne = () => {
|
|
345
353
|
b.value.validGeneralForm().then(ie);
|
|
346
|
-
}, ae = (
|
|
347
|
-
if (!Array.isArray(
|
|
354
|
+
}, ae = (N = []) => {
|
|
355
|
+
if (!Array.isArray(N))
|
|
348
356
|
return [];
|
|
349
|
-
const
|
|
350
|
-
return
|
|
351
|
-
var
|
|
352
|
-
if (
|
|
353
|
-
|
|
357
|
+
const F = [];
|
|
358
|
+
return N.forEach((E) => {
|
|
359
|
+
var x;
|
|
360
|
+
if (E != null && E.isPage) {
|
|
361
|
+
F.push(E);
|
|
354
362
|
return;
|
|
355
363
|
}
|
|
356
|
-
!(
|
|
357
|
-
}),
|
|
364
|
+
!(E != null && E.isPage) && ((x = E == null ? void 0 : E.children) != null && x.length) && F.push(...ae(E.children));
|
|
365
|
+
}), F;
|
|
358
366
|
};
|
|
359
367
|
return {
|
|
360
|
-
state:
|
|
361
|
-
isShow:
|
|
368
|
+
state: q,
|
|
369
|
+
isShow: xe,
|
|
362
370
|
savePageSetting: ne,
|
|
363
|
-
copyPage:
|
|
364
|
-
pageSettingState:
|
|
365
|
-
pageGeneral:
|
|
371
|
+
copyPage: R,
|
|
372
|
+
pageSettingState: o,
|
|
373
|
+
pageGeneral: i,
|
|
366
374
|
pageGeneralRef: b,
|
|
367
375
|
deletePage: () => {
|
|
368
|
-
var
|
|
369
|
-
if ((
|
|
370
|
-
|
|
376
|
+
var N, F;
|
|
377
|
+
if ((F = (N = o.treeDataMapping[o.currentPageData.id]) == null ? void 0 : N.children) != null && F.length) {
|
|
378
|
+
M({
|
|
371
379
|
type: "error",
|
|
372
380
|
message: "此页面存在子页面或子文件夹,不能删除!"
|
|
373
381
|
});
|
|
@@ -377,25 +385,25 @@ const Kt = /* @__PURE__ */ te(qt, [["render", Jt], ["__scopeId", "data-v-b78f330
|
|
|
377
385
|
title: "提示",
|
|
378
386
|
message: "您是否要删除页面?",
|
|
379
387
|
exec: () => {
|
|
380
|
-
var
|
|
381
|
-
const
|
|
382
|
-
e(
|
|
383
|
-
|
|
388
|
+
var x;
|
|
389
|
+
const E = ((x = o.currentPageData) == null ? void 0 : x.id) || "";
|
|
390
|
+
e(E).then(() => {
|
|
391
|
+
o.updateTreeData().then((L) => {
|
|
384
392
|
var W, ye;
|
|
385
|
-
if (((W =
|
|
393
|
+
if (((W = f == null ? void 0 : f.currentPage) == null ? void 0 : W.id) !== E)
|
|
386
394
|
return;
|
|
387
|
-
const Q = ((ye = (
|
|
395
|
+
const Q = ((ye = (L || []).find(({
|
|
388
396
|
groupId: ge
|
|
389
|
-
}) => ge ===
|
|
390
|
-
componentName:
|
|
397
|
+
}) => ge === y)) == null ? void 0 : ye.data) || [], u = ae(Q), O = u.find((ge) => ge.isHome), w = u == null ? void 0 : u[0], J = {
|
|
398
|
+
componentName: Kt.Page
|
|
391
399
|
};
|
|
392
|
-
|
|
393
|
-
}), Z(),
|
|
400
|
+
t("openNewPage", O || w || J);
|
|
401
|
+
}), Z(), M({
|
|
394
402
|
message: "删除页面成功!",
|
|
395
403
|
type: "success"
|
|
396
404
|
});
|
|
397
405
|
}).catch(() => {
|
|
398
|
-
|
|
406
|
+
M({
|
|
399
407
|
message: "删除页面失败!",
|
|
400
408
|
type: "error"
|
|
401
409
|
});
|
|
@@ -403,47 +411,47 @@ const Kt = /* @__PURE__ */ te(qt, [["render", Jt], ["__scopeId", "data-v-b78f330
|
|
|
403
411
|
}
|
|
404
412
|
});
|
|
405
413
|
},
|
|
406
|
-
cancelPageSetting:
|
|
414
|
+
cancelPageSetting: A,
|
|
407
415
|
closePageSettingPanel: Z,
|
|
408
|
-
updatePageLifeCycles:
|
|
416
|
+
updatePageLifeCycles: I,
|
|
409
417
|
restorePage: D,
|
|
410
418
|
PAGE_SETTING_SESSION: Ue
|
|
411
419
|
};
|
|
412
420
|
}
|
|
413
|
-
},
|
|
414
|
-
function
|
|
415
|
-
const r =
|
|
416
|
-
return e.isShow ? (v(),
|
|
421
|
+
}, Xt = { class: "page-setting-content" }, zt = { class: "life-cycles-container" };
|
|
422
|
+
function Qt(a, t, n, e, s, o) {
|
|
423
|
+
const r = P("tiny-button"), c = P("svg-button"), l = P("button-group"), _ = P("tiny-collapse-item"), y = P("page-input-output"), f = P("life-cycles"), k = P("page-history"), m = P("tiny-collapse"), h = P("plugin-setting");
|
|
424
|
+
return e.isShow ? (v(), H(h, {
|
|
417
425
|
key: 0,
|
|
418
426
|
title: e.state.title,
|
|
419
427
|
class: "page-plugin-setting"
|
|
420
428
|
}, {
|
|
421
429
|
header: S(() => [
|
|
422
|
-
|
|
430
|
+
d(l, null, {
|
|
423
431
|
default: S(() => [
|
|
424
|
-
|
|
432
|
+
d(r, {
|
|
425
433
|
type: "primary",
|
|
426
434
|
onClick: e.savePageSetting
|
|
427
435
|
}, {
|
|
428
|
-
default: S(() =>
|
|
429
|
-
|
|
436
|
+
default: S(() => t[1] || (t[1] = [
|
|
437
|
+
ue("保存")
|
|
430
438
|
])),
|
|
431
439
|
_: 1
|
|
432
440
|
}, 8, ["onClick"]),
|
|
433
|
-
e.pageSettingState.isNew ?
|
|
441
|
+
e.pageSettingState.isNew ? j("", !0) : (v(), H(c, {
|
|
434
442
|
key: 0,
|
|
435
443
|
name: "text-copy-page",
|
|
436
444
|
placement: "bottom",
|
|
437
445
|
tips: "复制页面",
|
|
438
446
|
onClick: e.copyPage
|
|
439
447
|
}, null, 8, ["onClick"])),
|
|
440
|
-
e.pageSettingState.isNew ?
|
|
448
|
+
e.pageSettingState.isNew ? j("", !0) : (v(), H(c, {
|
|
441
449
|
key: 1,
|
|
442
450
|
name: "delete",
|
|
443
451
|
tips: "删除页面",
|
|
444
452
|
onClick: e.deletePage
|
|
445
453
|
}, null, 8, ["onClick"])),
|
|
446
|
-
|
|
454
|
+
d(c, {
|
|
447
455
|
name: "close",
|
|
448
456
|
onClick: e.cancelPageSetting
|
|
449
457
|
}, null, 8, ["onClick"])
|
|
@@ -452,62 +460,62 @@ function Yt(t, a, n, e, o, s) {
|
|
|
452
460
|
})
|
|
453
461
|
]),
|
|
454
462
|
content: S(() => [
|
|
455
|
-
|
|
456
|
-
|
|
463
|
+
V("div", Xt, [
|
|
464
|
+
d(m, {
|
|
457
465
|
modelValue: e.state.activeName,
|
|
458
|
-
"onUpdate:modelValue":
|
|
466
|
+
"onUpdate:modelValue": t[0] || (t[0] = (i) => e.state.activeName = i),
|
|
459
467
|
class: "page-setting-collapse"
|
|
460
468
|
}, {
|
|
461
469
|
default: S(() => [
|
|
462
|
-
|
|
470
|
+
d(_, {
|
|
463
471
|
title: "基本设置",
|
|
464
472
|
name: e.PAGE_SETTING_SESSION.general
|
|
465
473
|
}, {
|
|
466
474
|
default: S(() => [
|
|
467
|
-
(v(),
|
|
475
|
+
(v(), H(Je(e.pageGeneral), {
|
|
468
476
|
ref: "pageGeneralRef",
|
|
469
477
|
isFolder: n.isFolder
|
|
470
478
|
}, null, 8, ["isFolder"]))
|
|
471
479
|
]),
|
|
472
480
|
_: 1
|
|
473
481
|
}, 8, ["name"]),
|
|
474
|
-
e.pageSettingState.currentPageData.group !== "public" ? (v(),
|
|
482
|
+
e.pageSettingState.currentPageData.group !== "public" ? (v(), H(_, {
|
|
475
483
|
key: 0,
|
|
476
484
|
class: "base-setting",
|
|
477
485
|
title: "输入输出",
|
|
478
486
|
name: e.PAGE_SETTING_SESSION.inputOutput
|
|
479
487
|
}, {
|
|
480
488
|
default: S(() => [
|
|
481
|
-
|
|
489
|
+
d(y)
|
|
482
490
|
]),
|
|
483
491
|
_: 1
|
|
484
|
-
}, 8, ["name"])) :
|
|
485
|
-
e.pageSettingState.currentPageData.group !== "public" ? (v(),
|
|
492
|
+
}, 8, ["name"])) : j("", !0),
|
|
493
|
+
e.pageSettingState.currentPageData.group !== "public" ? (v(), H(_, {
|
|
486
494
|
key: 1,
|
|
487
495
|
class: "input-output",
|
|
488
496
|
title: "页面生命周期配置",
|
|
489
497
|
name: e.PAGE_SETTING_SESSION.lifeCycles
|
|
490
498
|
}, {
|
|
491
499
|
default: S(() => {
|
|
492
|
-
var
|
|
500
|
+
var i;
|
|
493
501
|
return [
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
bindLifeCycles: (
|
|
502
|
+
V("div", zt, [
|
|
503
|
+
d(f, {
|
|
504
|
+
bindLifeCycles: (i = e.pageSettingState.currentPageData.page_content) == null ? void 0 : i.lifeCycles,
|
|
497
505
|
onUpdatePageLifeCycles: e.updatePageLifeCycles
|
|
498
506
|
}, null, 8, ["bindLifeCycles", "onUpdatePageLifeCycles"])
|
|
499
507
|
])
|
|
500
508
|
];
|
|
501
509
|
}),
|
|
502
510
|
_: 1
|
|
503
|
-
}, 8, ["name"])) :
|
|
504
|
-
|
|
511
|
+
}, 8, ["name"])) : j("", !0),
|
|
512
|
+
d(_, {
|
|
505
513
|
class: "history-source",
|
|
506
514
|
title: "历史备份",
|
|
507
515
|
name: e.PAGE_SETTING_SESSION.history
|
|
508
516
|
}, {
|
|
509
517
|
default: S(() => [
|
|
510
|
-
|
|
518
|
+
d(k, { onRestorePage: e.restorePage }, null, 8, ["onRestorePage"])
|
|
511
519
|
]),
|
|
512
520
|
_: 1
|
|
513
521
|
}, 8, ["name"])
|
|
@@ -517,24 +525,24 @@ function Yt(t, a, n, e, o, s) {
|
|
|
517
525
|
])
|
|
518
526
|
]),
|
|
519
527
|
_: 1
|
|
520
|
-
}, 8, ["title"])) :
|
|
528
|
+
}, 8, ["title"])) : j("", !0);
|
|
521
529
|
}
|
|
522
|
-
const
|
|
523
|
-
let
|
|
530
|
+
const Yt = /* @__PURE__ */ te(Wt, [["render", Qt], ["__scopeId", "data-v-85fa9e26"]]);
|
|
531
|
+
let Ve = K(!1);
|
|
524
532
|
const Le = () => {
|
|
525
|
-
|
|
533
|
+
Ve.value = !0;
|
|
526
534
|
}, Y = () => {
|
|
527
|
-
|
|
528
|
-
const { resetPageData:
|
|
529
|
-
|
|
530
|
-
},
|
|
535
|
+
Ve.value = !1;
|
|
536
|
+
const { resetPageData: a } = ee();
|
|
537
|
+
a();
|
|
538
|
+
}, Zt = {
|
|
531
539
|
components: {
|
|
532
|
-
TinyButton:
|
|
533
|
-
TinyCollapse:
|
|
540
|
+
TinyButton: ze,
|
|
541
|
+
TinyCollapse: Fe,
|
|
534
542
|
TinyCollapseItem: Te,
|
|
535
543
|
PluginSetting: Xe,
|
|
536
|
-
SvgButton:
|
|
537
|
-
ButtonGroup:
|
|
544
|
+
SvgButton: be,
|
|
545
|
+
ButtonGroup: We
|
|
538
546
|
},
|
|
539
547
|
props: {
|
|
540
548
|
isFolder: {
|
|
@@ -543,60 +551,60 @@ const Le = () => {
|
|
|
543
551
|
}
|
|
544
552
|
},
|
|
545
553
|
setup() {
|
|
546
|
-
const
|
|
554
|
+
const a = le({
|
|
547
555
|
activeName: ["folderGeneralRef"],
|
|
548
556
|
title: "文件夹设置"
|
|
549
|
-
}), { requestCreatePage:
|
|
550
|
-
pe(
|
|
557
|
+
}), { requestCreatePage: t, requestUpdatePage: n, requestDeletePage: e } = ce, { pageSettingState: s, changeTreeData: o } = ee(), { confirm: r } = se(), l = Ke(fe.type, fe.id).components.PageGeneral, _ = K(null), y = () => {
|
|
558
|
+
pe(s.currentPageData, s.currentPageDataCopy) ? Y() : r({
|
|
551
559
|
title: "提示",
|
|
552
560
|
message: "您即将使用未保存的更改关闭此页。是否要在关闭之前放弃这些更改?",
|
|
553
561
|
exec: () => {
|
|
554
|
-
|
|
562
|
+
s.isNew || (o(s.oldParentId, s.currentPageData.parentId), Object.assign(s.currentPageData, s.currentPageDataCopy)), Y();
|
|
555
563
|
}
|
|
556
564
|
});
|
|
557
|
-
},
|
|
558
|
-
const
|
|
559
|
-
...
|
|
560
|
-
app:
|
|
565
|
+
}, f = () => {
|
|
566
|
+
const p = {
|
|
567
|
+
...s.currentPageData,
|
|
568
|
+
app: G(B.GlobalService).getBaseInfo().id,
|
|
561
569
|
isPage: !1
|
|
562
570
|
};
|
|
563
|
-
|
|
564
|
-
|
|
571
|
+
t(p).then(() => {
|
|
572
|
+
s.updateTreeData(), s.isNew = !1, Y(), M({
|
|
565
573
|
type: "success",
|
|
566
574
|
message: "新建文件夹成功!"
|
|
567
575
|
});
|
|
568
576
|
}).catch((b) => {
|
|
569
|
-
|
|
577
|
+
M({
|
|
570
578
|
type: "error",
|
|
571
579
|
title: "新建文件夹失败",
|
|
572
580
|
message: JSON.stringify((b == null ? void 0 : b.message) || b)
|
|
573
581
|
});
|
|
574
582
|
});
|
|
575
|
-
},
|
|
576
|
-
const { id:
|
|
577
|
-
n(
|
|
578
|
-
|
|
583
|
+
}, k = () => {
|
|
584
|
+
const { id: i } = s.currentPageData;
|
|
585
|
+
n(i, { ...s.currentPageData, page_content: null }).then(() => {
|
|
586
|
+
s.updateTreeData(), s.isNew = !1, Y(), M({
|
|
579
587
|
type: "success",
|
|
580
588
|
message: "更新文件夹成功!"
|
|
581
589
|
});
|
|
582
|
-
}).catch((
|
|
583
|
-
|
|
590
|
+
}).catch((p) => {
|
|
591
|
+
M({
|
|
584
592
|
type: "error",
|
|
585
593
|
title: "更新文件夹失败",
|
|
586
|
-
message: JSON.stringify((
|
|
594
|
+
message: JSON.stringify((p == null ? void 0 : p.message) || p)
|
|
587
595
|
});
|
|
588
596
|
});
|
|
589
597
|
};
|
|
590
598
|
return {
|
|
591
599
|
saveFolderSetting: () => {
|
|
592
|
-
|
|
593
|
-
|
|
600
|
+
_.value.validGeneralForm().then(() => {
|
|
601
|
+
s.isNew ? f() : k();
|
|
594
602
|
});
|
|
595
603
|
},
|
|
596
|
-
deleteFolder:
|
|
597
|
-
var
|
|
598
|
-
if ((
|
|
599
|
-
|
|
604
|
+
deleteFolder: Nt(5e3, !0, () => {
|
|
605
|
+
var i, p;
|
|
606
|
+
if ((p = (i = s.treeDataMapping[s.currentPageData.id]) == null ? void 0 : i.children) != null && p.length) {
|
|
607
|
+
M({
|
|
600
608
|
type: "error",
|
|
601
609
|
message: "此文件夹不是空文件夹,不能删除!"
|
|
602
610
|
});
|
|
@@ -606,60 +614,60 @@ const Le = () => {
|
|
|
606
614
|
title: "提示",
|
|
607
615
|
message: "您是否要删除文件夹?",
|
|
608
616
|
exec: () => {
|
|
609
|
-
var
|
|
610
|
-
const b = ((
|
|
617
|
+
var q;
|
|
618
|
+
const b = ((q = s.currentPageData) == null ? void 0 : q.id) || "";
|
|
611
619
|
e(b).then(() => {
|
|
612
|
-
|
|
620
|
+
s.updateTreeData(), Y(), M({
|
|
613
621
|
type: "success",
|
|
614
622
|
message: "删除文件夹成功!"
|
|
615
623
|
});
|
|
616
|
-
}).catch((
|
|
617
|
-
|
|
624
|
+
}).catch((A) => {
|
|
625
|
+
M({
|
|
618
626
|
type: "success",
|
|
619
627
|
title: "删除文件夹失败!",
|
|
620
|
-
message: JSON.stringify((
|
|
628
|
+
message: JSON.stringify((A == null ? void 0 : A.message) || A)
|
|
621
629
|
});
|
|
622
630
|
});
|
|
623
631
|
}
|
|
624
632
|
});
|
|
625
633
|
}),
|
|
626
634
|
pageGeneral: l,
|
|
627
|
-
folderGeneralRef:
|
|
635
|
+
folderGeneralRef: _,
|
|
628
636
|
closeFolderSettingPanel: Y,
|
|
629
|
-
isShow:
|
|
630
|
-
state:
|
|
631
|
-
pageSettingState:
|
|
632
|
-
closeFolderSetting:
|
|
637
|
+
isShow: Ve,
|
|
638
|
+
state: a,
|
|
639
|
+
pageSettingState: s,
|
|
640
|
+
closeFolderSetting: y
|
|
633
641
|
};
|
|
634
642
|
}
|
|
635
|
-
},
|
|
636
|
-
function
|
|
637
|
-
const r =
|
|
638
|
-
return e.isShow ? (v(),
|
|
643
|
+
}, $t = { class: "page-setting-content" };
|
|
644
|
+
function ea(a, t, n, e, s, o) {
|
|
645
|
+
const r = P("tiny-button"), c = P("svg-button"), l = P("button-group"), _ = P("tiny-collapse-item"), y = P("tiny-collapse"), f = P("plugin-setting");
|
|
646
|
+
return e.isShow ? (v(), H(f, {
|
|
639
647
|
key: 0,
|
|
640
648
|
title: e.state.title,
|
|
641
649
|
class: "pageFolder-plugin-setting"
|
|
642
650
|
}, {
|
|
643
651
|
header: S(() => [
|
|
644
|
-
|
|
652
|
+
d(l, null, {
|
|
645
653
|
default: S(() => [
|
|
646
|
-
|
|
654
|
+
d(r, {
|
|
647
655
|
type: "primary",
|
|
648
656
|
onClick: e.saveFolderSetting
|
|
649
657
|
}, {
|
|
650
|
-
default: S(() =>
|
|
651
|
-
|
|
658
|
+
default: S(() => t[1] || (t[1] = [
|
|
659
|
+
ue("保存")
|
|
652
660
|
])),
|
|
653
661
|
_: 1
|
|
654
662
|
}, 8, ["onClick"]),
|
|
655
|
-
e.pageSettingState.isNew ?
|
|
663
|
+
e.pageSettingState.isNew ? j("", !0) : (v(), H(c, {
|
|
656
664
|
key: 0,
|
|
657
665
|
name: "delete",
|
|
658
666
|
placement: "bottom",
|
|
659
667
|
tips: "删除",
|
|
660
668
|
onClick: e.deleteFolder
|
|
661
669
|
}, null, 8, ["onClick"])),
|
|
662
|
-
|
|
670
|
+
d(c, {
|
|
663
671
|
class: "close-plugin-setting-icon",
|
|
664
672
|
name: "close",
|
|
665
673
|
onClick: e.closeFolderSetting
|
|
@@ -669,18 +677,18 @@ function ta(t, a, n, e, o, s) {
|
|
|
669
677
|
})
|
|
670
678
|
]),
|
|
671
679
|
content: S(() => [
|
|
672
|
-
|
|
673
|
-
|
|
680
|
+
V("div", $t, [
|
|
681
|
+
d(y, {
|
|
674
682
|
modelValue: e.state.activeName,
|
|
675
|
-
"onUpdate:modelValue":
|
|
683
|
+
"onUpdate:modelValue": t[0] || (t[0] = (k) => e.state.activeName = k)
|
|
676
684
|
}, {
|
|
677
685
|
default: S(() => [
|
|
678
|
-
|
|
686
|
+
d(_, {
|
|
679
687
|
title: "基本设置",
|
|
680
688
|
name: "folderGeneralRef"
|
|
681
689
|
}, {
|
|
682
690
|
default: S(() => [
|
|
683
|
-
(v(),
|
|
691
|
+
(v(), H(Je(e.pageGeneral), {
|
|
684
692
|
ref: "folderGeneralRef",
|
|
685
693
|
isFolder: n.isFolder
|
|
686
694
|
}, null, 8, ["isFolder"]))
|
|
@@ -693,15 +701,15 @@ function ta(t, a, n, e, o, s) {
|
|
|
693
701
|
])
|
|
694
702
|
]),
|
|
695
703
|
_: 1
|
|
696
|
-
}, 8, ["title"])) :
|
|
704
|
+
}, 8, ["title"])) : j("", !0);
|
|
697
705
|
}
|
|
698
|
-
const
|
|
706
|
+
const ta = /* @__PURE__ */ te(Zt, [["render", ea], ["__scopeId", "data-v-b0cf4b3e"]]), aa = {
|
|
699
707
|
key: 0,
|
|
700
708
|
width: "24",
|
|
701
709
|
height: "24",
|
|
702
710
|
viewBox: "0 0 24 24",
|
|
703
711
|
xmlns: "http://www.w3.org/2000/svg"
|
|
704
|
-
},
|
|
712
|
+
}, na = {
|
|
705
713
|
key: 0,
|
|
706
714
|
x1: "8",
|
|
707
715
|
y1: "12",
|
|
@@ -709,7 +717,7 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
709
717
|
y2: "12",
|
|
710
718
|
stroke: "#EBEBEB",
|
|
711
719
|
"stroke-width": "1"
|
|
712
|
-
},
|
|
720
|
+
}, oa = {
|
|
713
721
|
key: 1,
|
|
714
722
|
x1: "8",
|
|
715
723
|
y1: "12",
|
|
@@ -717,7 +725,7 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
717
725
|
y2: "24",
|
|
718
726
|
stroke: "#EBEBEB",
|
|
719
727
|
"stroke-width": "1"
|
|
720
|
-
},
|
|
728
|
+
}, sa = {
|
|
721
729
|
__name: "LayerLines",
|
|
722
730
|
props: {
|
|
723
731
|
level: {
|
|
@@ -729,13 +737,13 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
729
737
|
required: !0
|
|
730
738
|
}
|
|
731
739
|
},
|
|
732
|
-
setup(
|
|
733
|
-
return (
|
|
740
|
+
setup(a) {
|
|
741
|
+
return (t, n) => (v(!0), U(oe, null, Se(a.level - 1, (e) => (v(), U("span", {
|
|
734
742
|
key: e,
|
|
735
743
|
class: "gap"
|
|
736
744
|
}, [
|
|
737
|
-
|
|
738
|
-
n[0] || (n[0] =
|
|
745
|
+
a.lineData[e] ? (v(), U("svg", aa, [
|
|
746
|
+
n[0] || (n[0] = V("line", {
|
|
739
747
|
x1: "8",
|
|
740
748
|
y1: "0",
|
|
741
749
|
x2: "8",
|
|
@@ -743,12 +751,12 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
743
751
|
stroke: "#EBEBEB",
|
|
744
752
|
"stroke-width": "1"
|
|
745
753
|
}, null, -1)),
|
|
746
|
-
(
|
|
747
|
-
(
|
|
748
|
-
])) :
|
|
754
|
+
(a.lineData[e] & 1) === 1 ? (v(), U("line", na)) : j("", !0),
|
|
755
|
+
(a.lineData[e] >> 1 & 1) === 1 ? (v(), U("line", oa)) : j("", !0)
|
|
756
|
+
])) : j("", !0)
|
|
749
757
|
]))), 128));
|
|
750
758
|
}
|
|
751
|
-
},
|
|
759
|
+
}, ra = /* @__PURE__ */ te(sa, [["__scopeId", "data-v-c0e056d7"]]), la = ["draggable", "onDragstart", "onDragover", "onDragenter", "onDrop"], ca = ["onClick"], ia = { class: "prefix-icon" }, ga = {
|
|
752
760
|
__name: "Tree",
|
|
753
761
|
props: {
|
|
754
762
|
data: {
|
|
@@ -784,131 +792,128 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
784
792
|
}
|
|
785
793
|
},
|
|
786
794
|
emits: ["clickRow", "moveNode"],
|
|
787
|
-
setup(
|
|
788
|
-
const n =
|
|
789
|
-
const { idKey:
|
|
790
|
-
id:
|
|
791
|
-
label:
|
|
795
|
+
setup(a, { emit: t }) {
|
|
796
|
+
const n = a, e = t, s = (g, D, T = 0) => {
|
|
797
|
+
const { idKey: I, labelKey: z, childrenKey: R } = n, ie = {
|
|
798
|
+
id: g[I],
|
|
799
|
+
label: g[z],
|
|
792
800
|
parentId: D,
|
|
793
|
-
level:
|
|
794
|
-
rawData:
|
|
795
|
-
}, ne = [ie], ae =
|
|
801
|
+
level: T,
|
|
802
|
+
rawData: g
|
|
803
|
+
}, ne = [ie], ae = g[R];
|
|
796
804
|
if (Array.isArray(ae))
|
|
797
805
|
for (const Ne of ae)
|
|
798
|
-
ne.push(...
|
|
806
|
+
ne.push(...s(Ne, ie.id, T + 1));
|
|
799
807
|
return ne;
|
|
800
|
-
},
|
|
801
|
-
const D = r.value[
|
|
808
|
+
}, o = $(() => s({ [n.idKey]: n.rootId, [n.childrenKey]: n.data }).slice(1)), r = $(() => o.value.reduce((g, D) => (g[D.id] = D, g), {})), c = $(() => o.value.filter((g) => g.label.toLowerCase().includes(n.filterValue))), l = (g) => {
|
|
809
|
+
const D = r.value[g];
|
|
802
810
|
if (!D || !D.parentId)
|
|
803
811
|
return [];
|
|
804
|
-
const
|
|
805
|
-
return
|
|
806
|
-
},
|
|
807
|
-
const
|
|
812
|
+
const T = l(D.parentId);
|
|
813
|
+
return T.push(D.parentId), T;
|
|
814
|
+
}, _ = $(() => {
|
|
815
|
+
const g = /* @__PURE__ */ new Set();
|
|
808
816
|
for (const D of c.value) {
|
|
809
|
-
|
|
810
|
-
for (const
|
|
811
|
-
|
|
817
|
+
g.add(D.id);
|
|
818
|
+
for (const T of l(D.id))
|
|
819
|
+
g.add(T);
|
|
812
820
|
}
|
|
813
|
-
return
|
|
814
|
-
}),
|
|
821
|
+
return o.value.filter((D) => g.has(D.id));
|
|
822
|
+
}), y = {
|
|
815
823
|
node: 1,
|
|
816
824
|
// └
|
|
817
|
-
layer: 2
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
const z = D.findIndex((V) => V.id === N.parentId);
|
|
826
|
-
for (let V = z + 1; V < k; V++)
|
|
827
|
-
i[V][N.level - 1] = (i[V][N.level - 1] || 0) | P.layer;
|
|
825
|
+
layer: 2
|
|
826
|
+
}, f = $(() => {
|
|
827
|
+
const g = {}, D = _.value;
|
|
828
|
+
for (const [T, I] of D.entries())
|
|
829
|
+
if (g[T] = g[T] || {}, g[T][I.level - 1] = y.node, I.parentId !== n.rootId) {
|
|
830
|
+
const z = D.findIndex((R) => R.id === I.parentId);
|
|
831
|
+
for (let R = z + 1; R < T; R++)
|
|
832
|
+
g[R][I.level - 1] = (g[R][I.level - 1] || 0) | y.layer;
|
|
828
833
|
}
|
|
829
|
-
return
|
|
830
|
-
}),
|
|
831
|
-
e("clickRow",
|
|
832
|
-
}, m = K(null), h = K(null),
|
|
834
|
+
return g;
|
|
835
|
+
}), k = (g) => {
|
|
836
|
+
e("clickRow", g);
|
|
837
|
+
}, m = K(null), h = K(null), i = (g, D) => {
|
|
833
838
|
n.draggable && (m.value = D);
|
|
834
|
-
},
|
|
839
|
+
}, p = (g, D) => {
|
|
835
840
|
if (!n.draggable)
|
|
836
841
|
return;
|
|
837
|
-
l(D.id).includes(m.value.id) ? h.value = null : (
|
|
838
|
-
}, b = (
|
|
839
|
-
|
|
840
|
-
const
|
|
841
|
-
if (m.value = null, !
|
|
842
|
+
l(D.id).includes(m.value.id) ? h.value = null : (g.preventDefault(), h.value = D.id);
|
|
843
|
+
}, b = (g, D) => {
|
|
844
|
+
g.preventDefault();
|
|
845
|
+
const T = m.value;
|
|
846
|
+
if (m.value = null, !T)
|
|
842
847
|
return;
|
|
843
|
-
!l(D.id).includes(
|
|
844
|
-
},
|
|
848
|
+
!l(D.id).includes(T.id) && T.id !== D.id && T.parentId !== D.id && e("moveNode", T, D);
|
|
849
|
+
}, q = () => {
|
|
845
850
|
h.value = null;
|
|
846
|
-
},
|
|
847
|
-
n.draggable &&
|
|
848
|
-
}, X = (
|
|
849
|
-
n.draggable &&
|
|
851
|
+
}, A = (g) => {
|
|
852
|
+
n.draggable && g.target === g.currentTarget && (g.preventDefault(), h.value = n.rootId);
|
|
853
|
+
}, X = (g) => {
|
|
854
|
+
n.draggable && g.target === g.currentTarget && (h.value = null);
|
|
850
855
|
};
|
|
851
|
-
return (
|
|
852
|
-
const
|
|
853
|
-
return v(),
|
|
854
|
-
class:
|
|
855
|
-
onDragover:
|
|
856
|
-
onDragenter:
|
|
856
|
+
return (g, D) => {
|
|
857
|
+
const T = P("svg-icon");
|
|
858
|
+
return v(), U("div", {
|
|
859
|
+
class: ve(["draggable-tree", "border-transparent", { "hover-border-color": h.value === a.rootId }]),
|
|
860
|
+
onDragover: A,
|
|
861
|
+
onDragenter: A,
|
|
857
862
|
onDragleave: X,
|
|
858
|
-
onDrop: D[0] || (D[0] = (
|
|
863
|
+
onDrop: D[0] || (D[0] = (I) => b(I, { id: a.rootId }))
|
|
859
864
|
}, [
|
|
860
|
-
(v(!0),
|
|
861
|
-
class:
|
|
865
|
+
(v(!0), U(oe, null, Se(_.value, (I, z) => (v(), U("div", {
|
|
866
|
+
class: ve([
|
|
862
867
|
"row",
|
|
863
868
|
"border-transparent",
|
|
864
869
|
{
|
|
865
|
-
active: String(
|
|
866
|
-
"hover-border-color": h.value ===
|
|
870
|
+
active: String(a.active) === String(I.id),
|
|
871
|
+
"hover-border-color": h.value === I.id
|
|
867
872
|
}
|
|
868
873
|
]),
|
|
869
|
-
key:
|
|
870
|
-
draggable:
|
|
871
|
-
onDragstart: (
|
|
872
|
-
onDragover: (
|
|
873
|
-
onDragenter: (
|
|
874
|
-
onDrop: (
|
|
875
|
-
onDragend:
|
|
874
|
+
key: I.id,
|
|
875
|
+
draggable: a.draggable ? "true" : void 0,
|
|
876
|
+
onDragstart: (R) => i(R, I),
|
|
877
|
+
onDragover: (R) => p(R, I),
|
|
878
|
+
onDragenter: (R) => p(R, I),
|
|
879
|
+
onDrop: (R) => b(R, I),
|
|
880
|
+
onDragend: q
|
|
876
881
|
}, [
|
|
877
|
-
|
|
882
|
+
V("div", {
|
|
878
883
|
class: "content",
|
|
879
|
-
onClick: (
|
|
884
|
+
onClick: (R) => k(I)
|
|
880
885
|
}, [
|
|
881
|
-
|
|
882
|
-
"line-data":
|
|
883
|
-
level:
|
|
886
|
+
d(ra, {
|
|
887
|
+
"line-data": f.value[z],
|
|
888
|
+
level: I.level
|
|
884
889
|
}, null, 8, ["line-data", "level"]),
|
|
885
|
-
|
|
886
|
-
|
|
890
|
+
V("div", ia, [
|
|
891
|
+
I.rawData.isPage ? (v(), H(T, {
|
|
887
892
|
key: 0,
|
|
888
893
|
name: "text-page-common"
|
|
889
|
-
})) : (v(),
|
|
894
|
+
})) : (v(), H(T, {
|
|
890
895
|
key: 1,
|
|
891
896
|
name: "text-page-folder-closed"
|
|
892
897
|
}))
|
|
893
898
|
]),
|
|
894
|
-
|
|
895
|
-
], 8,
|
|
896
|
-
|
|
897
|
-
], 42,
|
|
899
|
+
V("label", null, de(I.label), 1)
|
|
900
|
+
], 8, ca),
|
|
901
|
+
ot(g.$slots, "row-suffix", { node: I }, void 0, !0)
|
|
902
|
+
], 42, la))), 128))
|
|
898
903
|
], 34);
|
|
899
904
|
};
|
|
900
905
|
}
|
|
901
|
-
}, ua = /* @__PURE__ */ te(
|
|
902
|
-
PAGE_STATUS:
|
|
903
|
-
} =
|
|
906
|
+
}, ua = /* @__PURE__ */ te(ga, [["__scopeId", "data-v-f6908d8b"]]), {
|
|
907
|
+
PAGE_STATUS: da
|
|
908
|
+
} = Oe, pa = {
|
|
904
909
|
components: {
|
|
905
910
|
TinySearch: yt,
|
|
906
|
-
TinyCollapse:
|
|
911
|
+
TinyCollapse: Fe,
|
|
907
912
|
TinyCollapseItem: Te,
|
|
908
|
-
TinyIconSearch:
|
|
909
|
-
TinyPopover:
|
|
913
|
+
TinyIconSearch: It(),
|
|
914
|
+
TinyPopover: Pt,
|
|
910
915
|
DraggableTree: ua,
|
|
911
|
-
SvgButton:
|
|
916
|
+
SvgButton: be
|
|
912
917
|
},
|
|
913
918
|
props: {
|
|
914
919
|
isFolder: {
|
|
@@ -917,93 +922,93 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
917
922
|
}
|
|
918
923
|
},
|
|
919
924
|
emits: ["openSettingPanel", "add", "createPage", "createFolder"],
|
|
920
|
-
setup(
|
|
921
|
-
emit:
|
|
925
|
+
setup(a, {
|
|
926
|
+
emit: t
|
|
922
927
|
}) {
|
|
923
928
|
const {
|
|
924
929
|
confirm: n
|
|
925
930
|
} = se(), {
|
|
926
931
|
pageState: e,
|
|
927
|
-
isBlock:
|
|
928
|
-
isSaved:
|
|
932
|
+
isBlock: s,
|
|
933
|
+
isSaved: o
|
|
929
934
|
} = re(), {
|
|
930
935
|
pageSettingState: r,
|
|
931
936
|
changeTreeData: c,
|
|
932
937
|
isCurrentDataSame: l,
|
|
933
|
-
getPageList:
|
|
934
|
-
resetPageData:
|
|
935
|
-
STATIC_PAGE_GROUP_ID:
|
|
936
|
-
COMMON_PAGE_GROUP_ID:
|
|
938
|
+
getPageList: _,
|
|
939
|
+
resetPageData: y,
|
|
940
|
+
STATIC_PAGE_GROUP_ID: f,
|
|
941
|
+
COMMON_PAGE_GROUP_ID: k,
|
|
937
942
|
switchPage: m
|
|
938
943
|
} = ee(), {
|
|
939
944
|
fetchPageDetail: h,
|
|
940
|
-
requestUpdatePage:
|
|
941
|
-
} = ce,
|
|
945
|
+
requestUpdatePage: i
|
|
946
|
+
} = ce, p = () => G(B.GlobalService).getBaseInfo().id, b = le({
|
|
942
947
|
pageSearchValue: "",
|
|
943
|
-
collapseValue: [
|
|
948
|
+
collapseValue: [f, k],
|
|
944
949
|
currentNodeData: {
|
|
945
|
-
id:
|
|
950
|
+
id: G(B.GlobalService).getBaseInfo().pageId
|
|
946
951
|
}
|
|
947
952
|
}), {
|
|
948
|
-
subscribe:
|
|
949
|
-
unsubscribe:
|
|
950
|
-
} =
|
|
953
|
+
subscribe: q,
|
|
954
|
+
unsubscribe: A
|
|
955
|
+
} = we();
|
|
951
956
|
let X = null;
|
|
952
|
-
|
|
953
|
-
X =
|
|
957
|
+
st(() => {
|
|
958
|
+
X = q({
|
|
954
959
|
topic: "locationHistoryChanged",
|
|
955
|
-
callback: (
|
|
956
|
-
|
|
957
|
-
id:
|
|
958
|
-
} :
|
|
960
|
+
callback: (u) => {
|
|
961
|
+
u.pageId ? b.currentNodeData = {
|
|
962
|
+
id: u.pageId
|
|
963
|
+
} : s() && (b.currentNodeData = {});
|
|
959
964
|
},
|
|
960
965
|
subscriber: "pageTree"
|
|
961
966
|
});
|
|
962
|
-
}),
|
|
963
|
-
X &&
|
|
967
|
+
}), Be(() => {
|
|
968
|
+
X && A(X);
|
|
964
969
|
});
|
|
965
|
-
const
|
|
966
|
-
r.updateTreeData = async () => await
|
|
967
|
-
const D = (
|
|
968
|
-
b.currentNodeData =
|
|
970
|
+
const g = async (u) => await _(u);
|
|
971
|
+
r.updateTreeData = async () => await g(p());
|
|
972
|
+
const D = (u) => {
|
|
973
|
+
b.currentNodeData = u, m(u.id).then(() => {
|
|
969
974
|
Z(), Y();
|
|
970
975
|
});
|
|
971
|
-
},
|
|
976
|
+
}, T = (u, O) => {
|
|
972
977
|
var W;
|
|
973
978
|
const {
|
|
974
|
-
id:
|
|
979
|
+
id: w,
|
|
975
980
|
isPage: J
|
|
976
|
-
} =
|
|
977
|
-
!
|
|
981
|
+
} = O;
|
|
982
|
+
!s() && w === ((W = b == null ? void 0 : b.currentNodeData) == null ? void 0 : W.id) || !J || (o() && l() ? D(O) : n({
|
|
978
983
|
title: "提示",
|
|
979
|
-
message: `${
|
|
984
|
+
message: `${s() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
|
|
980
985
|
exec: () => {
|
|
981
|
-
c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), D(
|
|
986
|
+
c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), D(O);
|
|
982
987
|
}
|
|
983
988
|
}));
|
|
984
|
-
},
|
|
989
|
+
}, I = (u, O, w) => {
|
|
985
990
|
var J;
|
|
986
|
-
if (
|
|
987
|
-
const W = ((J =
|
|
991
|
+
if (w && O.isPage) {
|
|
992
|
+
const W = ((J = O.occupier) == null ? void 0 : J.username) || "";
|
|
988
993
|
se().message({
|
|
989
994
|
message: `您点击的页面被${W}锁定,暂时无法编辑,请联系解锁`
|
|
990
995
|
});
|
|
991
996
|
return;
|
|
992
997
|
}
|
|
993
|
-
pe(r.currentPageData, r.currentPageDataCopy) ?
|
|
998
|
+
pe(r.currentPageData, r.currentPageDataCopy) ? t("openSettingPanel", O) : n({
|
|
994
999
|
title: "提示",
|
|
995
1000
|
message: `当前页面或文件夹${r.currentPageData.name}尚未保存,是否要继续切换?`,
|
|
996
1001
|
exec: () => {
|
|
997
|
-
c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy),
|
|
1002
|
+
c(r.oldParentId, r.currentPageData.parentId), Object.assign(r.currentPageData, r.currentPageDataCopy), t("openSettingPanel", O);
|
|
998
1003
|
}
|
|
999
1004
|
});
|
|
1000
|
-
}, z = {},
|
|
1001
|
-
z[
|
|
1002
|
-
}, ie = (
|
|
1003
|
-
|
|
1004
|
-
}, ne = (
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1005
|
+
}, z = {}, R = (u, O) => {
|
|
1006
|
+
z[O] = u;
|
|
1007
|
+
}, ie = (u) => {
|
|
1008
|
+
T(null, u.rawData);
|
|
1009
|
+
}, ne = (u) => $e(u.occupier).state === da.Lock, ae = (u) => {
|
|
1010
|
+
I(null, u.rawData, ne(u.rawData));
|
|
1011
|
+
}, N = [
|
|
1007
1012
|
{
|
|
1008
1013
|
type: "settings",
|
|
1009
1014
|
label: "设置",
|
|
@@ -1015,70 +1020,70 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
1015
1020
|
{
|
|
1016
1021
|
type: "createPage",
|
|
1017
1022
|
label: "新建子页面",
|
|
1018
|
-
action: (
|
|
1019
|
-
|
|
1023
|
+
action: (u) => {
|
|
1024
|
+
t("createPage", "staticPages", u.id);
|
|
1020
1025
|
}
|
|
1021
1026
|
},
|
|
1022
1027
|
{
|
|
1023
1028
|
type: "createFolder",
|
|
1024
1029
|
label: "新建子文件夹",
|
|
1025
|
-
action: (
|
|
1026
|
-
|
|
1030
|
+
action: (u) => {
|
|
1031
|
+
t("createFolder", u.id);
|
|
1027
1032
|
}
|
|
1028
1033
|
}
|
|
1029
1034
|
// TODO 复制和删除的逻辑耦合在其他组件内,暂时屏蔽
|
|
1030
1035
|
// { type: 'divider' },
|
|
1031
1036
|
// { type: 'copy', label: '复制页面', action: copyPage },
|
|
1032
1037
|
// { type: 'delete', label: '删除', class: ['danger'], action: deleteNode }
|
|
1033
|
-
].map((
|
|
1034
|
-
...
|
|
1035
|
-
action: (
|
|
1036
|
-
var
|
|
1037
|
-
(
|
|
1038
|
+
].map((u) => ({
|
|
1039
|
+
...u,
|
|
1040
|
+
action: (O) => {
|
|
1041
|
+
var w, J, W;
|
|
1042
|
+
(w = u.action) == null || w.call(u, O), (W = (J = z[O.id]) == null ? void 0 : J.doClose) == null || W.call(J);
|
|
1038
1043
|
}
|
|
1039
|
-
})),
|
|
1044
|
+
})), F = (u, O) => u === k ? N.slice(0, 1) : O.rawData.isPage ? N : N.filter((w) => w.type !== "copy"), E = (u) => {
|
|
1040
1045
|
var ge;
|
|
1041
1046
|
const {
|
|
1042
|
-
id:
|
|
1043
|
-
name:
|
|
1047
|
+
id: O,
|
|
1048
|
+
name: w,
|
|
1044
1049
|
page_content: J
|
|
1045
|
-
} =
|
|
1046
|
-
...
|
|
1050
|
+
} = u, W = {
|
|
1051
|
+
...u,
|
|
1047
1052
|
page_content: {
|
|
1048
1053
|
...J,
|
|
1049
|
-
fileName:
|
|
1054
|
+
fileName: w
|
|
1050
1055
|
}
|
|
1051
|
-
}, ye = ((ge = e == null ? void 0 : e.currentPage) == null ? void 0 : ge.id) ===
|
|
1052
|
-
return
|
|
1053
|
-
},
|
|
1056
|
+
}, ye = ((ge = e == null ? void 0 : e.currentPage) == null ? void 0 : ge.id) === O;
|
|
1057
|
+
return Ze(O, W, !1, ye);
|
|
1058
|
+
}, x = (u) => {
|
|
1054
1059
|
const {
|
|
1055
|
-
id:
|
|
1056
|
-
} =
|
|
1057
|
-
return
|
|
1058
|
-
...
|
|
1060
|
+
id: O
|
|
1061
|
+
} = u;
|
|
1062
|
+
return i(O, {
|
|
1063
|
+
...u,
|
|
1059
1064
|
page_content: null
|
|
1060
1065
|
}).then(() => {
|
|
1061
|
-
|
|
1066
|
+
M({
|
|
1062
1067
|
type: "success",
|
|
1063
1068
|
message: "更新文件夹成功!"
|
|
1064
1069
|
});
|
|
1065
|
-
}).catch((
|
|
1066
|
-
|
|
1070
|
+
}).catch((w) => {
|
|
1071
|
+
M({
|
|
1067
1072
|
type: "error",
|
|
1068
1073
|
title: "更新文件夹失败",
|
|
1069
|
-
message: JSON.stringify((
|
|
1074
|
+
message: JSON.stringify((w == null ? void 0 : w.message) || w)
|
|
1070
1075
|
});
|
|
1071
1076
|
}).finally(() => {
|
|
1072
1077
|
r.updateTreeData(), r.isNew = !1;
|
|
1073
1078
|
});
|
|
1074
|
-
},
|
|
1075
|
-
pe(r.currentPageData, r.currentPageDataCopy) ? (Z(), Y(), r.currentPageData.id =
|
|
1076
|
-
|
|
1077
|
-
}).catch((
|
|
1078
|
-
|
|
1079
|
+
}, L = (u, O) => {
|
|
1080
|
+
pe(r.currentPageData, r.currentPageDataCopy) ? (Z(), Y(), r.currentPageData.id = u.id, c(O.id, u.parentId), y(), h(u.id).then((w) => {
|
|
1081
|
+
w.parentId = O.id, w.isPage ? E(w) : x(w);
|
|
1082
|
+
}).catch((w) => {
|
|
1083
|
+
M({
|
|
1079
1084
|
type: "error",
|
|
1080
1085
|
title: "移动页面文件/文件夹失败",
|
|
1081
|
-
message: JSON.stringify((
|
|
1086
|
+
message: JSON.stringify((w == null ? void 0 : w.message) || w)
|
|
1082
1087
|
});
|
|
1083
1088
|
})) : n({
|
|
1084
1089
|
title: "提示",
|
|
@@ -1088,18 +1093,18 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
1088
1093
|
}
|
|
1089
1094
|
});
|
|
1090
1095
|
};
|
|
1091
|
-
|
|
1096
|
+
we().subscribe({
|
|
1092
1097
|
topic: "app_id_changed",
|
|
1093
1098
|
subscriber: "page_tree_app_id_changed",
|
|
1094
|
-
callback: (
|
|
1095
|
-
|
|
1099
|
+
callback: (u) => {
|
|
1100
|
+
g(u);
|
|
1096
1101
|
}
|
|
1097
1102
|
});
|
|
1098
|
-
const Q = (
|
|
1099
|
-
|
|
1103
|
+
const Q = (u) => {
|
|
1104
|
+
u.stopPropagation(), u.preventDefault(), t("add");
|
|
1100
1105
|
};
|
|
1101
|
-
return
|
|
1102
|
-
|
|
1106
|
+
return Be(() => {
|
|
1107
|
+
we().unsubscribe({
|
|
1103
1108
|
topic: "app_id_changed",
|
|
1104
1109
|
subscriber: "page_tree_app_id_changed"
|
|
1105
1110
|
});
|
|
@@ -1108,52 +1113,52 @@ const aa = /* @__PURE__ */ te($t, [["render", ta], ["__scopeId", "data-v-b0cf4b3
|
|
|
1108
1113
|
state: b,
|
|
1109
1114
|
switchPage: D,
|
|
1110
1115
|
pageSettingState: r,
|
|
1111
|
-
setPopoverRef:
|
|
1116
|
+
setPopoverRef: R,
|
|
1112
1117
|
IconFolderOpened: kt(),
|
|
1113
|
-
IconFolderClosed:
|
|
1114
|
-
getRowOperations:
|
|
1118
|
+
IconFolderClosed: wt(),
|
|
1119
|
+
getRowOperations: F,
|
|
1115
1120
|
handleClickRow: ie,
|
|
1116
|
-
handleMoveNode:
|
|
1121
|
+
handleMoveNode: L,
|
|
1117
1122
|
isPageLocked: ne,
|
|
1118
1123
|
handleClickPageSettings: ae,
|
|
1119
|
-
STATIC_PAGE_GROUP_ID:
|
|
1124
|
+
STATIC_PAGE_GROUP_ID: f
|
|
1120
1125
|
};
|
|
1121
1126
|
}
|
|
1122
|
-
},
|
|
1123
|
-
class: /* @__PURE__ */
|
|
1124
|
-
},
|
|
1125
|
-
function
|
|
1126
|
-
const r =
|
|
1127
|
-
return v(),
|
|
1128
|
-
|
|
1129
|
-
|
|
1127
|
+
}, ma = { class: "app-manage-search" }, fa = { class: "title" }, Pa = { class: "app-manage-tree" }, ya = {
|
|
1128
|
+
class: /* @__PURE__ */ ve(["actions"])
|
|
1129
|
+
}, _a = { class: "operation-list" }, ha = ["onClick"];
|
|
1130
|
+
function Da(a, t, n, e, s, o) {
|
|
1131
|
+
const r = P("tiny-icon-search"), c = P("tiny-search"), l = P("svg-button"), _ = P("tiny-popover"), y = P("draggable-tree"), f = P("tiny-collapse-item"), k = P("tiny-collapse");
|
|
1132
|
+
return v(), U(oe, null, [
|
|
1133
|
+
V("div", ma, [
|
|
1134
|
+
d(c, {
|
|
1130
1135
|
modelValue: e.state.pageSearchValue,
|
|
1131
|
-
"onUpdate:modelValue":
|
|
1136
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => e.state.pageSearchValue = m),
|
|
1132
1137
|
clearable: "",
|
|
1133
1138
|
placeholder: "搜索"
|
|
1134
1139
|
}, {
|
|
1135
1140
|
prefix: S(() => [
|
|
1136
|
-
|
|
1141
|
+
d(r)
|
|
1137
1142
|
]),
|
|
1138
1143
|
_: 1
|
|
1139
1144
|
}, 8, ["modelValue"])
|
|
1140
1145
|
]),
|
|
1141
|
-
|
|
1146
|
+
d(k, {
|
|
1142
1147
|
modelValue: e.state.collapseValue,
|
|
1143
|
-
"onUpdate:modelValue":
|
|
1148
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => e.state.collapseValue = m),
|
|
1144
1149
|
class: "page-manage-collapse lowcode-scrollbar"
|
|
1145
1150
|
}, {
|
|
1146
1151
|
default: S(() => [
|
|
1147
|
-
(v(!0),
|
|
1152
|
+
(v(!0), U(oe, null, Se(e.pageSettingState.pages, (m, h) => (v(), H(f, {
|
|
1148
1153
|
key: h,
|
|
1149
1154
|
name: m.groupId
|
|
1150
1155
|
}, {
|
|
1151
1156
|
title: S(() => [
|
|
1152
|
-
|
|
1157
|
+
V("span", fa, de(m.groupName), 1)
|
|
1153
1158
|
]),
|
|
1154
1159
|
default: S(() => [
|
|
1155
|
-
|
|
1156
|
-
|
|
1160
|
+
V("div", Pa, [
|
|
1161
|
+
d(y, {
|
|
1157
1162
|
data: m.data,
|
|
1158
1163
|
"label-key": "name",
|
|
1159
1164
|
active: e.state.currentNodeData.id,
|
|
@@ -1163,42 +1168,42 @@ function Sa(t, a, n, e, o, s) {
|
|
|
1163
1168
|
onClickRow: e.handleClickRow,
|
|
1164
1169
|
onMoveNode: e.handleMoveNode
|
|
1165
1170
|
}, {
|
|
1166
|
-
"row-suffix": S(({ node:
|
|
1167
|
-
|
|
1168
|
-
e.isPageLocked(
|
|
1171
|
+
"row-suffix": S(({ node: i }) => [
|
|
1172
|
+
V("div", ya, [
|
|
1173
|
+
e.isPageLocked(i.rawData) ? (v(), H(l, {
|
|
1169
1174
|
key: 0,
|
|
1170
1175
|
name: "locked",
|
|
1171
1176
|
hoverBgColor: !1
|
|
1172
|
-
})) :
|
|
1173
|
-
|
|
1177
|
+
})) : j("", !0),
|
|
1178
|
+
i.rawData.isHome ? (v(), H(l, {
|
|
1174
1179
|
key: 1,
|
|
1175
1180
|
name: "home",
|
|
1176
1181
|
hoverBgColor: !1
|
|
1177
|
-
})) :
|
|
1178
|
-
|
|
1182
|
+
})) : j("", !0),
|
|
1183
|
+
d(_, {
|
|
1179
1184
|
ref_for: !0,
|
|
1180
|
-
ref: (
|
|
1185
|
+
ref: (p) => e.setPopoverRef(p, i.id),
|
|
1181
1186
|
placement: "bottom-start",
|
|
1182
1187
|
"visible-arrow": !1,
|
|
1183
1188
|
"popper-class": "page-tree-row-operation-list"
|
|
1184
1189
|
}, {
|
|
1185
1190
|
reference: S(() => [
|
|
1186
|
-
|
|
1191
|
+
d(l, {
|
|
1187
1192
|
name: "ellipsis",
|
|
1188
1193
|
class: "auto-hidden",
|
|
1189
1194
|
hoverBgColor: !1
|
|
1190
1195
|
})
|
|
1191
1196
|
]),
|
|
1192
1197
|
default: S(() => [
|
|
1193
|
-
|
|
1194
|
-
(v(!0),
|
|
1198
|
+
V("div", _a, [
|
|
1199
|
+
(v(!0), U(oe, null, Se(e.getRowOperations(m.groupId, i), (p, b) => (v(), U("div", {
|
|
1195
1200
|
key: b,
|
|
1196
|
-
class:
|
|
1197
|
-
onClick: (
|
|
1198
|
-
var
|
|
1199
|
-
return (
|
|
1201
|
+
class: ve([p.type === "divider" ? "divider" : "item"].concat(p.class || [])),
|
|
1202
|
+
onClick: (q) => {
|
|
1203
|
+
var A;
|
|
1204
|
+
return (A = p.action) == null ? void 0 : A.call(p, i);
|
|
1200
1205
|
}
|
|
1201
|
-
},
|
|
1206
|
+
}, de(p.label), 11, ha))), 128))
|
|
1202
1207
|
])
|
|
1203
1208
|
]),
|
|
1204
1209
|
_: 2
|
|
@@ -1216,19 +1221,19 @@ function Sa(t, a, n, e, o, s) {
|
|
|
1216
1221
|
}, 8, ["modelValue"])
|
|
1217
1222
|
], 64);
|
|
1218
1223
|
}
|
|
1219
|
-
const
|
|
1220
|
-
getPageById: async (
|
|
1221
|
-
if (
|
|
1222
|
-
return
|
|
1224
|
+
const Sa = /* @__PURE__ */ te(pa, [["render", Da], ["__scopeId", "data-v-566ba8c5"]]), va = {
|
|
1225
|
+
getPageById: async (a) => {
|
|
1226
|
+
if (a)
|
|
1227
|
+
return Ee(a);
|
|
1223
1228
|
},
|
|
1224
|
-
openPageSettingPanel:
|
|
1225
|
-
},
|
|
1229
|
+
openPageSettingPanel: De
|
|
1230
|
+
}, ba = {
|
|
1226
1231
|
components: {
|
|
1227
|
-
PageSetting:
|
|
1228
|
-
PluginPanel:
|
|
1229
|
-
SvgButton:
|
|
1230
|
-
PageFolderSetting:
|
|
1231
|
-
PageTree:
|
|
1232
|
+
PageSetting: Yt,
|
|
1233
|
+
PluginPanel: ft,
|
|
1234
|
+
SvgButton: be,
|
|
1235
|
+
PageFolderSetting: ta,
|
|
1236
|
+
PageTree: Sa
|
|
1232
1237
|
},
|
|
1233
1238
|
props: {
|
|
1234
1239
|
title: {
|
|
@@ -1238,24 +1243,24 @@ const va = /* @__PURE__ */ te(ma, [["render", Sa], ["__scopeId", "data-v-9e02c61
|
|
|
1238
1243
|
},
|
|
1239
1244
|
setup() {
|
|
1240
1245
|
const {
|
|
1241
|
-
pageState:
|
|
1246
|
+
pageState: a
|
|
1242
1247
|
} = re(), {
|
|
1243
|
-
pageSettingState:
|
|
1248
|
+
pageSettingState: t,
|
|
1244
1249
|
getDefaultPage: n,
|
|
1245
1250
|
isTemporaryPage: e,
|
|
1246
|
-
initCurrentPageData:
|
|
1247
|
-
} = ee(),
|
|
1251
|
+
initCurrentPageData: s
|
|
1252
|
+
} = ee(), o = K(null), r = t.ROOT_ID, c = it().getDocsUrl("page"), l = le({
|
|
1248
1253
|
isFolder: !1
|
|
1249
|
-
}),
|
|
1250
|
-
Y(),
|
|
1254
|
+
}), _ = (h, i = r) => {
|
|
1255
|
+
Y(), t.isNew = !0;
|
|
1251
1256
|
try {
|
|
1252
|
-
const
|
|
1253
|
-
if (!
|
|
1257
|
+
const p = n();
|
|
1258
|
+
if (!p)
|
|
1254
1259
|
throw new Error("Failed to get default page configuration");
|
|
1255
|
-
|
|
1260
|
+
t.currentPageData = {
|
|
1256
1261
|
...n(),
|
|
1257
|
-
...
|
|
1258
|
-
parentId:
|
|
1262
|
+
...p,
|
|
1263
|
+
parentId: i,
|
|
1259
1264
|
route: "",
|
|
1260
1265
|
name: "Untitled",
|
|
1261
1266
|
page_content: {
|
|
@@ -1265,71 +1270,72 @@ const va = /* @__PURE__ */ te(ma, [["render", Sa], ["__scopeId", "data-v-9e02c61
|
|
|
1265
1270
|
};
|
|
1266
1271
|
} catch {
|
|
1267
1272
|
}
|
|
1268
|
-
|
|
1269
|
-
},
|
|
1270
|
-
Z(),
|
|
1273
|
+
t.currentPageDataCopy = me(!0, {}, t.currentPageData), l.isFolder = !1, De();
|
|
1274
|
+
}, y = (h = r) => {
|
|
1275
|
+
Z(), t.isNew = !0, t.currentPageData = {
|
|
1271
1276
|
parentId: h,
|
|
1272
1277
|
route: "",
|
|
1273
1278
|
name: "untitled"
|
|
1274
|
-
},
|
|
1279
|
+
}, t.currentPageDataCopy = me(!0, {}, t.currentPageData), l.isFolder = !0, Le();
|
|
1275
1280
|
};
|
|
1276
1281
|
Pe(() => {
|
|
1277
|
-
e.saved &&
|
|
1282
|
+
e.saved && De();
|
|
1278
1283
|
});
|
|
1279
|
-
const
|
|
1280
|
-
l.isFolder = !h.isPage,
|
|
1281
|
-
const
|
|
1282
|
-
l.isFolder ? (
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1284
|
+
const f = async (h) => {
|
|
1285
|
+
l.isFolder = !h.isPage, t.isNew = !1;
|
|
1286
|
+
const i = h.id !== t.currentPageData.id;
|
|
1287
|
+
l.isFolder ? (i && Z(), Le()) : (i && Y(), De());
|
|
1288
|
+
const p = await Ee(h == null ? void 0 : h.id);
|
|
1289
|
+
s(p);
|
|
1285
1290
|
};
|
|
1286
|
-
return
|
|
1291
|
+
return rt("openSettingPanel", f), {
|
|
1287
1292
|
state: l,
|
|
1288
|
-
pageState:
|
|
1293
|
+
pageState: a,
|
|
1289
1294
|
openNewPage: (h) => {
|
|
1290
|
-
|
|
1295
|
+
o.value.switchPage(h);
|
|
1291
1296
|
},
|
|
1292
|
-
pageTreeRef:
|
|
1297
|
+
pageTreeRef: o,
|
|
1293
1298
|
pluginPanelClosed: () => {
|
|
1294
1299
|
Z(), Y();
|
|
1295
1300
|
},
|
|
1296
|
-
openSettingPanel:
|
|
1297
|
-
createNewFolder:
|
|
1298
|
-
createNewPage:
|
|
1301
|
+
openSettingPanel: f,
|
|
1302
|
+
createNewFolder: y,
|
|
1303
|
+
createNewPage: _,
|
|
1299
1304
|
docsUrl: c
|
|
1300
1305
|
};
|
|
1301
1306
|
}
|
|
1302
1307
|
};
|
|
1303
|
-
function
|
|
1304
|
-
const r =
|
|
1305
|
-
return v(),
|
|
1306
|
-
|
|
1308
|
+
function Ca(a, t, n, e, s, o) {
|
|
1309
|
+
const r = P("svg-button"), c = P("page-tree"), l = P("plugin-panel"), _ = P("page-setting"), y = P("page-folder-setting");
|
|
1310
|
+
return v(), U(oe, null, [
|
|
1311
|
+
d(l, {
|
|
1307
1312
|
title: n.title,
|
|
1308
1313
|
onClose: e.pluginPanelClosed,
|
|
1309
1314
|
docsUrl: e.docsUrl,
|
|
1310
|
-
isShowDocsIcon: !0
|
|
1315
|
+
isShowDocsIcon: !0,
|
|
1316
|
+
class: "page-manage"
|
|
1311
1317
|
}, {
|
|
1312
1318
|
header: S(() => [
|
|
1313
|
-
|
|
1319
|
+
d(r, {
|
|
1314
1320
|
class: "add-folder-icon",
|
|
1315
1321
|
name: "add-folder",
|
|
1316
1322
|
placement: "bottom",
|
|
1317
1323
|
tips: "新建文件夹",
|
|
1318
|
-
onClick:
|
|
1324
|
+
onClick: t[0] || (t[0] = (f) => e.createNewFolder())
|
|
1319
1325
|
}),
|
|
1320
|
-
|
|
1326
|
+
d(r, {
|
|
1321
1327
|
class: "new-page-icon",
|
|
1322
1328
|
name: "new-page",
|
|
1323
1329
|
placement: "bottom",
|
|
1324
1330
|
tips: "新建页面",
|
|
1325
|
-
onClick:
|
|
1331
|
+
onClick: t[1] || (t[1] = (f) => e.createNewPage("staticPages"))
|
|
1326
1332
|
})
|
|
1327
1333
|
]),
|
|
1328
1334
|
content: S(() => [
|
|
1329
|
-
|
|
1335
|
+
d(c, {
|
|
1330
1336
|
ref: "pageTreeRef",
|
|
1331
1337
|
isFolder: e.state.isFolder,
|
|
1332
|
-
onAdd:
|
|
1338
|
+
onAdd: t[2] || (t[2] = (f) => e.createNewPage("publicPages")),
|
|
1333
1339
|
onOpenSettingPanel: e.openSettingPanel,
|
|
1334
1340
|
onCreatePage: e.createNewPage,
|
|
1335
1341
|
onCreateFolder: e.createNewFolder
|
|
@@ -1337,16 +1343,16 @@ function Na(t, a, n, e, o, s) {
|
|
|
1337
1343
|
]),
|
|
1338
1344
|
_: 1
|
|
1339
1345
|
}, 8, ["title", "onClose", "docsUrl"]),
|
|
1340
|
-
|
|
1346
|
+
d(_, {
|
|
1341
1347
|
isFolder: e.state.isFolder,
|
|
1342
1348
|
onOpenNewPage: e.openNewPage
|
|
1343
1349
|
}, null, 8, ["isFolder", "onOpenNewPage"]),
|
|
1344
|
-
|
|
1350
|
+
d(y, {
|
|
1345
1351
|
isFolder: e.state.isFolder
|
|
1346
1352
|
}, null, 8, ["isFolder"])
|
|
1347
1353
|
], 64);
|
|
1348
1354
|
}
|
|
1349
|
-
const
|
|
1355
|
+
const Na = /* @__PURE__ */ te(ba, [["render", Ca], ["__scopeId", "data-v-6fa41cfe"]]), { ELEMENT_TAG: Ia, COMPONENT_NAME: wa } = Oe, _e = {
|
|
1350
1356
|
app: "",
|
|
1351
1357
|
name: "",
|
|
1352
1358
|
route: "",
|
|
@@ -1370,7 +1376,7 @@ const Ia = /* @__PURE__ */ te(Ca, [["render", Na], ["__scopeId", "data-v-1605dd0
|
|
|
1370
1376
|
parentId: "none",
|
|
1371
1377
|
isBody: !1,
|
|
1372
1378
|
group: "staticPages"
|
|
1373
|
-
},
|
|
1379
|
+
}, ka = K(null), C = le({
|
|
1374
1380
|
currentPageDataCopy: {},
|
|
1375
1381
|
// 记录当前页最开始的状态,当用户点击取消按钮的时候恢复到初始状态
|
|
1376
1382
|
currentPageData: {},
|
|
@@ -1382,140 +1388,149 @@ const Ia = /* @__PURE__ */ te(Ca, [["render", Na], ["__scopeId", "data-v-1605dd0
|
|
|
1382
1388
|
// 根节点ID
|
|
1383
1389
|
updateTreeData: null,
|
|
1384
1390
|
treeDataMapping: {}
|
|
1385
|
-
}),
|
|
1391
|
+
}), Ta = le({
|
|
1386
1392
|
saved: !1
|
|
1387
|
-
}), Re = 0,
|
|
1388
|
-
var
|
|
1389
|
-
if (!((
|
|
1393
|
+
}), Re = 0, tt = 1, Fa = (a, t) => {
|
|
1394
|
+
var s, o;
|
|
1395
|
+
if (!((s = a == null ? void 0 : a.pageBaseStyle) != null && s.className) || !((o = a == null ? void 0 : a.pageBaseStyle) != null && o.style))
|
|
1390
1396
|
return "";
|
|
1391
1397
|
const n = (r, c) => `.${r} {
|
|
1392
1398
|
${c.trim()}
|
|
1393
1399
|
}
|
|
1394
|
-
`, e = `.${
|
|
1395
|
-
${
|
|
1400
|
+
`, e = `.${a.pageBaseStyle.className}{\r
|
|
1401
|
+
${a.pageBaseStyle.style}\r
|
|
1396
1402
|
}\r
|
|
1397
1403
|
`;
|
|
1398
|
-
return
|
|
1399
|
-
n(
|
|
1400
|
-
n(
|
|
1401
|
-
n(
|
|
1404
|
+
return t.useBaseStyle ? [
|
|
1405
|
+
n(a.pageBaseStyle.className, a.pageBaseStyle.style),
|
|
1406
|
+
n(t.blockBaseStyle.className, t.blockBaseStyle.style),
|
|
1407
|
+
n(t.componentBaseStyle.className, t.componentBaseStyle.style)
|
|
1402
1408
|
].join(`
|
|
1403
1409
|
`) : e;
|
|
1404
|
-
},
|
|
1405
|
-
const
|
|
1406
|
-
return !
|
|
1410
|
+
}, Oa = () => {
|
|
1411
|
+
const a = Me("engine.plugins.materials"), t = Me("engine.plugins.appmanage");
|
|
1412
|
+
return !a || !t || !t.pageBaseStyle ? { ..._e } : {
|
|
1407
1413
|
..._e,
|
|
1408
1414
|
page_content: {
|
|
1409
1415
|
..._e.page_content,
|
|
1410
1416
|
props: {
|
|
1411
1417
|
..._e.page_content.props,
|
|
1412
|
-
className:
|
|
1418
|
+
className: t.pageBaseStyle.className
|
|
1413
1419
|
},
|
|
1414
|
-
css:
|
|
1420
|
+
css: Fa(t, a)
|
|
1415
1421
|
}
|
|
1416
1422
|
};
|
|
1417
|
-
},
|
|
1418
|
-
const
|
|
1423
|
+
}, Ea = () => {
|
|
1424
|
+
const a = C.currentPageData || {}, t = C.currentPageDataCopy || {};
|
|
1419
1425
|
let n = !0;
|
|
1420
|
-
return Object.keys(
|
|
1426
|
+
return Object.keys(t).some((e) => {
|
|
1421
1427
|
if (["children", "label", "createdBy", "assets", "occupier"].includes(e))
|
|
1422
1428
|
return !1;
|
|
1423
1429
|
if (e === "page_content") {
|
|
1424
|
-
const
|
|
1425
|
-
inputs: a[e].inputs,
|
|
1426
|
-
outputs: a[e].outputs,
|
|
1427
|
-
lifeCycles: a[e].lifeCycles
|
|
1428
|
-
}, s = {
|
|
1430
|
+
const s = {
|
|
1429
1431
|
inputs: t[e].inputs,
|
|
1430
1432
|
outputs: t[e].outputs,
|
|
1431
1433
|
lifeCycles: t[e].lifeCycles
|
|
1434
|
+
}, o = {
|
|
1435
|
+
inputs: a[e].inputs,
|
|
1436
|
+
outputs: a[e].outputs,
|
|
1437
|
+
lifeCycles: a[e].lifeCycles
|
|
1432
1438
|
};
|
|
1433
|
-
JSON.stringify(
|
|
1439
|
+
JSON.stringify(s) !== JSON.stringify(o) && (n = !1);
|
|
1434
1440
|
} else
|
|
1435
|
-
|
|
1441
|
+
t[e] !== a[e] && (n = !1);
|
|
1436
1442
|
return !n;
|
|
1437
1443
|
}), n;
|
|
1438
|
-
}, qe = (
|
|
1444
|
+
}, qe = (a) => a === C.ROOT_ID ? { id: C.ROOT_ID, children: C.pages[Re].data } : C.treeDataMapping[a], xa = (a, t) => {
|
|
1439
1445
|
var n, e;
|
|
1440
|
-
if (
|
|
1441
|
-
const
|
|
1442
|
-
if (!
|
|
1446
|
+
if (a && t && String(a) !== String(t)) {
|
|
1447
|
+
const s = qe(a), o = qe(t);
|
|
1448
|
+
if (!s || !o)
|
|
1443
1449
|
return;
|
|
1444
|
-
const r =
|
|
1450
|
+
const r = C.currentPageData.id, c = (e = (n = o.children) == null ? void 0 : n.findIndex) == null ? void 0 : e.call(n, ({ id: l }) => l === r);
|
|
1445
1451
|
if (c > -1) {
|
|
1446
|
-
const l =
|
|
1447
|
-
|
|
1452
|
+
const l = o.children.splice(c, 1)[0];
|
|
1453
|
+
s.children || (s.children = []), s.children.unshift(l);
|
|
1448
1454
|
}
|
|
1449
1455
|
}
|
|
1450
|
-
},
|
|
1451
|
-
|
|
1452
|
-
},
|
|
1453
|
-
|
|
1454
|
-
},
|
|
1455
|
-
const { ROOT_ID:
|
|
1456
|
-
return
|
|
1456
|
+
}, Va = () => C.currentPageData.page_content || {}, Ra = (a) => {
|
|
1457
|
+
C.currentPageData = a, C.currentPageDataCopy = me(!0, {}, a), C.oldParentId = a.parentId;
|
|
1458
|
+
}, Ga = () => {
|
|
1459
|
+
C.currentPageData = {}, C.currentPageDataCopy = {}, C.oldParentId = null;
|
|
1460
|
+
}, Ba = () => !pe(C.currentPageData, C.currentPageDataCopy), je = (a) => {
|
|
1461
|
+
const { ROOT_ID: t } = C, n = { [t]: { id: t } };
|
|
1462
|
+
return a.forEach((e) => {
|
|
1457
1463
|
n[e.id] = e;
|
|
1458
|
-
}),
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1464
|
+
}), a.forEach((e) => {
|
|
1465
|
+
const s = n[e.parentId];
|
|
1466
|
+
s && (s.children = s.children || [], s.children.push(e));
|
|
1461
1467
|
}), n;
|
|
1462
|
-
},
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1468
|
+
}, Ce = async (a) => {
|
|
1469
|
+
const t = await ce.fetchPageList(a || G(B.GlobalService).getBaseInfo().id), n = { groupName: "静态页面", groupId: Re, data: [] }, e = { groupName: "公共页面", groupId: tt, data: [] };
|
|
1470
|
+
t.forEach((r) => {
|
|
1465
1471
|
const c = r.name ? r : { ...r, name: r.folderName, group: "staticPages" }, l = r.meta ? {
|
|
1466
1472
|
...r,
|
|
1467
1473
|
...r.meta,
|
|
1468
1474
|
name: r.fileName,
|
|
1469
1475
|
isPage: !0,
|
|
1470
|
-
isBody: r.meta.rootElement ===
|
|
1471
|
-
} : c, { children:
|
|
1472
|
-
l.group === "staticPages" ? n.data.push(
|
|
1476
|
+
isBody: r.meta.rootElement === Ia.Body
|
|
1477
|
+
} : c, { children: _, ...y } = l;
|
|
1478
|
+
l.group === "staticPages" ? n.data.push(y) : e.data.push(y);
|
|
1473
1479
|
});
|
|
1474
|
-
const
|
|
1475
|
-
return
|
|
1476
|
-
},
|
|
1477
|
-
if (
|
|
1480
|
+
const s = je(n.data), o = je(e.data);
|
|
1481
|
+
return C.treeDataMapping = { ...s, ...o }, n.data = s[C.ROOT_ID].children, C.pages = [n, e], C.pages;
|
|
1482
|
+
}, Ge = (a) => {
|
|
1483
|
+
if (a === C.ROOT_ID)
|
|
1478
1484
|
return [];
|
|
1479
|
-
const
|
|
1480
|
-
return [
|
|
1481
|
-
},
|
|
1482
|
-
if (
|
|
1485
|
+
const t = C.treeDataMapping[a];
|
|
1486
|
+
return [t].concat(Ge(t.parentId));
|
|
1487
|
+
}, Aa = async (a, t) => {
|
|
1488
|
+
if (C.pages.length === 0 && await Ce(), !C.treeDataMapping[a])
|
|
1483
1489
|
return null;
|
|
1484
|
-
const e =
|
|
1485
|
-
return e.filter(
|
|
1486
|
-
},
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1490
|
+
const e = Ge(a).slice(1).reverse(), s = t ? () => !0 : (o) => o.isPage;
|
|
1491
|
+
return e.filter(s).map((o) => o.id);
|
|
1492
|
+
}, at = (a) => {
|
|
1493
|
+
if (a.every((n) => n.isPage))
|
|
1494
|
+
return a;
|
|
1495
|
+
const t = a.map((n) => n.isPage ? n : (n.children || []).map((e) => ({
|
|
1496
|
+
...e,
|
|
1497
|
+
routePath: `${n.routePath || n.route}/${e.route}`
|
|
1498
|
+
}))).flat();
|
|
1499
|
+
return at(t);
|
|
1500
|
+
}, Ma = async (a) => {
|
|
1501
|
+
C.pages.length === 0 && await Ce();
|
|
1502
|
+
const t = C.treeDataMapping[a];
|
|
1503
|
+
return Array.isArray(t == null ? void 0 : t.children) ? at(t.children) : [];
|
|
1504
|
+
}, Ha = () => {
|
|
1505
|
+
const { pageState: a } = re();
|
|
1506
|
+
a.currentVm = null, a.hoverVm = null, a.properties = {}, a.pageSchema = null;
|
|
1507
|
+
}, nt = (a, t = !1) => {
|
|
1508
|
+
if (Ha(), a !== 0 && !a) {
|
|
1509
|
+
t ? G(B.GlobalService).updateParams({ pageId: "", previewId: "" }) : G(B.GlobalService).updatePageId(""), re().initData({ componentName: wa.Page }, {}), he().layoutState.pageStatus = {
|
|
1495
1510
|
state: "empty",
|
|
1496
1511
|
data: {}
|
|
1497
1512
|
};
|
|
1498
1513
|
return;
|
|
1499
1514
|
}
|
|
1500
|
-
return ce.fetchPageDetail(
|
|
1501
|
-
|
|
1515
|
+
return ce.fetchPageDetail(a).then((n) => {
|
|
1516
|
+
n.isPage && gt().setBreadcrumbPage([n.name]), t ? G(B.GlobalService).updateParams({ pageId: a, previewId: "" }) : G(B.GlobalService).updatePageId(a), he().closePlugin(), he().layoutState.pageStatus = $e(n.occupier), re().initData(n.page_content, n);
|
|
1502
1517
|
}).catch(() => {
|
|
1503
|
-
|
|
1518
|
+
M({
|
|
1504
1519
|
type: "error",
|
|
1505
1520
|
message: "切换页面失败,目标页面不存在"
|
|
1506
1521
|
});
|
|
1507
1522
|
});
|
|
1508
|
-
},
|
|
1523
|
+
}, Ua = (a, t = !1) => {
|
|
1509
1524
|
(() => {
|
|
1510
|
-
const { isSaved:
|
|
1525
|
+
const { isSaved: e, isBlock: s } = re();
|
|
1511
1526
|
return new Promise((o) => {
|
|
1512
|
-
if (
|
|
1527
|
+
if (e()) {
|
|
1513
1528
|
o(!0);
|
|
1514
1529
|
return;
|
|
1515
1530
|
}
|
|
1516
1531
|
se().confirm({
|
|
1517
1532
|
title: "提示",
|
|
1518
|
-
message: `${
|
|
1533
|
+
message: `${s() ? "区块" : "页面"}尚未保存,是否要继续切换?`,
|
|
1519
1534
|
exec: () => {
|
|
1520
1535
|
o(!0);
|
|
1521
1536
|
},
|
|
@@ -1524,130 +1539,140 @@ const Ia = /* @__PURE__ */ te(Ca, [["render", Na], ["__scopeId", "data-v-1605dd0
|
|
|
1524
1539
|
}
|
|
1525
1540
|
});
|
|
1526
1541
|
});
|
|
1527
|
-
})().then((
|
|
1528
|
-
|
|
1542
|
+
})().then((e) => {
|
|
1543
|
+
e && nt(a, t);
|
|
1529
1544
|
});
|
|
1530
|
-
},
|
|
1531
|
-
var n;
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1545
|
+
}, La = (a, t) => {
|
|
1546
|
+
var n, e;
|
|
1547
|
+
t.id && ((n = t.pageInfo) != null && n.schema) && a.id === t.id && (a.page_content = (e = t.pageInfo) == null ? void 0 : e.schema);
|
|
1548
|
+
}, qa = async (a) => {
|
|
1549
|
+
if (!a.page_content)
|
|
1550
|
+
try {
|
|
1551
|
+
const t = await ce.fetchPageDetail(a.id);
|
|
1552
|
+
a.page_content = t.page_content;
|
|
1553
|
+
} catch {
|
|
1554
|
+
a.page_content = {};
|
|
1540
1555
|
}
|
|
1541
|
-
}, ja =
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1556
|
+
}, ja = (a, t, n, e) => {
|
|
1557
|
+
var s;
|
|
1558
|
+
a.parentId !== e && !t.find((o) => o.id === a.parentId) && (a.parentId = (s = t[n - 1]) != null && s.id ? t[n - 1].id : e);
|
|
1559
|
+
}, Ja = async (a, t) => {
|
|
1560
|
+
const { ROOT_ID: n } = C;
|
|
1561
|
+
a.length > 0 && await Promise.all(
|
|
1562
|
+
a.map(async (e, s) => {
|
|
1563
|
+
La(e, t), await qa(e), ja(e, a, s, n);
|
|
1564
|
+
})
|
|
1565
|
+
);
|
|
1566
|
+
}, Ka = async (a) => {
|
|
1567
|
+
C.pages.length === 0 && await Ce();
|
|
1568
|
+
const t = Ge(a.id).filter((n) => n.isPage).reverse();
|
|
1569
|
+
return await Ja(t, a), t;
|
|
1570
|
+
}, Wa = () => ({
|
|
1571
|
+
getDefaultPage: Oa,
|
|
1572
|
+
selectedTemplateCard: ka,
|
|
1573
|
+
pageSettingState: C,
|
|
1574
|
+
isTemporaryPage: Ta,
|
|
1575
|
+
isCurrentDataSame: Ea,
|
|
1576
|
+
changeTreeData: xa,
|
|
1577
|
+
getPageContent: Va,
|
|
1578
|
+
resetPageData: Ga,
|
|
1579
|
+
initCurrentPageData: Ra,
|
|
1580
|
+
isChangePageData: Ba,
|
|
1581
|
+
getPageList: Ce,
|
|
1582
|
+
getAncestors: Aa,
|
|
1583
|
+
switchPage: nt,
|
|
1584
|
+
switchPageWithConfirm: Ua,
|
|
1585
|
+
getFamily: Ka,
|
|
1586
|
+
getPageChildren: Ma,
|
|
1562
1587
|
STATIC_PAGE_GROUP_ID: Re,
|
|
1563
|
-
COMMON_PAGE_GROUP_ID:
|
|
1564
|
-
}),
|
|
1588
|
+
COMMON_PAGE_GROUP_ID: tt
|
|
1589
|
+
}), Xa = {
|
|
1565
1590
|
id: "engine.service.page",
|
|
1566
1591
|
type: "MetaService",
|
|
1567
|
-
apis:
|
|
1592
|
+
apis: Wa(),
|
|
1568
1593
|
composable: {
|
|
1569
1594
|
name: ut.usePage
|
|
1570
1595
|
}
|
|
1571
|
-
},
|
|
1596
|
+
}, za = {
|
|
1572
1597
|
components: {
|
|
1573
|
-
TinyCheckbox:
|
|
1598
|
+
TinyCheckbox: ke
|
|
1574
1599
|
},
|
|
1575
1600
|
setup() {
|
|
1576
|
-
const { pageSettingState:
|
|
1601
|
+
const { pageSettingState: a, STATIC_PAGE_GROUP_ID: t } = ee(), { handleRouteHomeUpdate: n } = ce, { confirm: e } = se(), s = le({
|
|
1577
1602
|
checked: !1,
|
|
1578
1603
|
selectDisable: !1
|
|
1579
1604
|
});
|
|
1580
1605
|
Pe(() => {
|
|
1581
|
-
var
|
|
1582
|
-
const l = !!((
|
|
1583
|
-
|
|
1606
|
+
var _;
|
|
1607
|
+
const l = !!((_ = a.currentPageData) != null && _.isHome);
|
|
1608
|
+
s.checked = l, s.selectDisable = l;
|
|
1584
1609
|
});
|
|
1585
|
-
const
|
|
1610
|
+
const o = $(() => {
|
|
1586
1611
|
let l = "暂无主页";
|
|
1587
|
-
if (
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1612
|
+
if (a.pages[t]) {
|
|
1613
|
+
const y = a.pages[t].data.filter((f) => f.isHome);
|
|
1614
|
+
y[0] && (l = y[0].name);
|
|
1590
1615
|
}
|
|
1591
1616
|
return l;
|
|
1592
|
-
}), r =
|
|
1617
|
+
}), r = lt("openSettingPanel");
|
|
1593
1618
|
return {
|
|
1594
|
-
pageSettingState:
|
|
1619
|
+
pageSettingState: a,
|
|
1595
1620
|
settingHome: () => {
|
|
1596
1621
|
e({
|
|
1597
1622
|
title: "提示",
|
|
1598
1623
|
type: "warning ",
|
|
1599
1624
|
message: "是否确定要将此页面设置为主页?您所做的任何未保存的更改都将被丢弃。",
|
|
1600
1625
|
exec: () => {
|
|
1601
|
-
const { id: l } =
|
|
1602
|
-
|
|
1603
|
-
|
|
1626
|
+
const { id: l } = a.currentPageData, _ = { ...a.currentPageData };
|
|
1627
|
+
_.isHome = !0, n(l, _).then(() => {
|
|
1628
|
+
a.updateTreeData(), r(a.currentPageData), a.isNew = !1, Ye && bt({
|
|
1604
1629
|
pageId: l,
|
|
1605
|
-
componentsTree:
|
|
1606
|
-
}),
|
|
1630
|
+
componentsTree: _
|
|
1631
|
+
}), M({ message: "主页设置成功!", type: "success" });
|
|
1607
1632
|
}).catch(() => {
|
|
1608
|
-
|
|
1633
|
+
M({ message: "主页设置失败!", type: "error" });
|
|
1609
1634
|
});
|
|
1610
1635
|
},
|
|
1611
1636
|
cancel: () => {
|
|
1612
|
-
|
|
1637
|
+
s.checked = !1;
|
|
1613
1638
|
}
|
|
1614
1639
|
});
|
|
1615
1640
|
},
|
|
1616
|
-
homePage:
|
|
1617
|
-
state:
|
|
1641
|
+
homePage: o,
|
|
1642
|
+
state: s
|
|
1618
1643
|
};
|
|
1619
1644
|
}
|
|
1620
|
-
},
|
|
1621
|
-
function
|
|
1622
|
-
const r =
|
|
1623
|
-
return v(),
|
|
1624
|
-
|
|
1645
|
+
}, Qa = { class: "home" }, Ya = { class: "tip" }, Za = { class: "home-page" };
|
|
1646
|
+
function $a(a, t, n, e, s, o) {
|
|
1647
|
+
const r = P("tiny-checkbox");
|
|
1648
|
+
return v(), U("div", Qa, [
|
|
1649
|
+
d(r, {
|
|
1625
1650
|
class: "selectHome",
|
|
1626
1651
|
modelValue: e.state.checked,
|
|
1627
|
-
"onUpdate:modelValue":
|
|
1652
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => e.state.checked = c),
|
|
1628
1653
|
disabled: e.state.selectDisable,
|
|
1629
1654
|
onChange: e.settingHome
|
|
1630
1655
|
}, {
|
|
1631
|
-
default: S(() =>
|
|
1632
|
-
|
|
1656
|
+
default: S(() => t[1] || (t[1] = [
|
|
1657
|
+
ue("设为主页")
|
|
1633
1658
|
])),
|
|
1634
1659
|
_: 1
|
|
1635
1660
|
}, 8, ["modelValue", "disabled", "onChange"]),
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1661
|
+
V("div", Ya, [
|
|
1662
|
+
t[2] || (t[2] = V("span", null, "当前主页是", -1)),
|
|
1663
|
+
V("span", Za, "【" + de(e.homePage) + "】", 1)
|
|
1639
1664
|
])
|
|
1640
1665
|
]);
|
|
1641
1666
|
}
|
|
1642
|
-
const
|
|
1667
|
+
const en = /* @__PURE__ */ te(za, [["render", $a], ["__scopeId", "data-v-b77a4074"]]), tn = {
|
|
1643
1668
|
components: {
|
|
1644
|
-
TinyForm:
|
|
1645
|
-
TinyFormItem:
|
|
1646
|
-
TinyInput:
|
|
1647
|
-
TinySelect:
|
|
1648
|
-
PageHome:
|
|
1649
|
-
TinyRadio:
|
|
1650
|
-
TinyCheckbox:
|
|
1669
|
+
TinyForm: St,
|
|
1670
|
+
TinyFormItem: Dt,
|
|
1671
|
+
TinyInput: Qe,
|
|
1672
|
+
TinySelect: ht,
|
|
1673
|
+
PageHome: en,
|
|
1674
|
+
TinyRadio: _t,
|
|
1675
|
+
TinyCheckbox: ke
|
|
1651
1676
|
},
|
|
1652
1677
|
props: {
|
|
1653
1678
|
modelValue: {
|
|
@@ -1661,29 +1686,29 @@ const Za = /* @__PURE__ */ te(Wa, [["render", Ya], ["__scopeId", "data-v-dc24410
|
|
|
1661
1686
|
},
|
|
1662
1687
|
setup() {
|
|
1663
1688
|
const {
|
|
1664
|
-
pageSettingState:
|
|
1665
|
-
changeTreeData:
|
|
1689
|
+
pageSettingState: a,
|
|
1690
|
+
changeTreeData: t,
|
|
1666
1691
|
STATIC_PAGE_GROUP_ID: n
|
|
1667
|
-
} = ee(), e =
|
|
1692
|
+
} = ee(), e = a.ROOT_ID, s = $({
|
|
1668
1693
|
get() {
|
|
1669
|
-
return String(
|
|
1694
|
+
return String(a.currentPageData.parentId);
|
|
1670
1695
|
},
|
|
1671
|
-
set(
|
|
1672
|
-
|
|
1696
|
+
set(i) {
|
|
1697
|
+
a.currentPageData.parentId = i;
|
|
1673
1698
|
}
|
|
1674
|
-
}),
|
|
1699
|
+
}), o = K(s.value);
|
|
1675
1700
|
Pe(() => {
|
|
1676
|
-
|
|
1701
|
+
o.value = a.oldParentId;
|
|
1677
1702
|
});
|
|
1678
1703
|
const r = $(() => {
|
|
1679
|
-
let
|
|
1680
|
-
for (;
|
|
1681
|
-
const b =
|
|
1704
|
+
let i = a.currentPageData.route || "", p = s;
|
|
1705
|
+
for (; p !== e; ) {
|
|
1706
|
+
const b = a.treeDataMapping[p];
|
|
1682
1707
|
if (!b)
|
|
1683
1708
|
break;
|
|
1684
|
-
|
|
1709
|
+
i = `${b.route}/${i}`, p = b.parentId;
|
|
1685
1710
|
}
|
|
1686
|
-
return
|
|
1711
|
+
return i.startsWith("/") && (i = i.slice(1)), i;
|
|
1687
1712
|
}), c = {
|
|
1688
1713
|
name: [{
|
|
1689
1714
|
required: !0,
|
|
@@ -1708,7 +1733,7 @@ const Za = /* @__PURE__ */ te(Wa, [["render", Ya], ["__scopeId", "data-v-dc24410
|
|
|
1708
1733
|
required: !0,
|
|
1709
1734
|
message: "请输入页面文件夹 ID"
|
|
1710
1735
|
}, {
|
|
1711
|
-
pattern:
|
|
1736
|
+
pattern: Tt,
|
|
1712
1737
|
message: "只允许包含英文字母、数字、下横线_、中横线-, 且以英文字母开头"
|
|
1713
1738
|
}, {
|
|
1714
1739
|
min: 3,
|
|
@@ -1726,69 +1751,69 @@ const Za = /* @__PURE__ */ te(Wa, [["render", Ya], ["__scopeId", "data-v-dc24410
|
|
|
1726
1751
|
required: !0,
|
|
1727
1752
|
message: "必须选择页面类型"
|
|
1728
1753
|
}]
|
|
1729
|
-
},
|
|
1754
|
+
}, _ = (i) => {
|
|
1730
1755
|
const {
|
|
1731
|
-
id:
|
|
1756
|
+
id: p,
|
|
1732
1757
|
name: b,
|
|
1733
|
-
isPage:
|
|
1734
|
-
children:
|
|
1735
|
-
} =
|
|
1736
|
-
id: String(
|
|
1758
|
+
isPage: q,
|
|
1759
|
+
children: A
|
|
1760
|
+
} = i, X = {
|
|
1761
|
+
id: String(p),
|
|
1737
1762
|
name: b,
|
|
1738
|
-
isPage:
|
|
1763
|
+
isPage: q
|
|
1739
1764
|
};
|
|
1740
|
-
return Array.isArray(
|
|
1741
|
-
},
|
|
1765
|
+
return Array.isArray(A) && (X.children = A.filter((g) => g.id !== a.currentPageData.id).map((g) => _(g))), X;
|
|
1766
|
+
}, y = (i) => i.id === e ? null : i.isPage ? d(P("SvgIcon"), {
|
|
1742
1767
|
name: "text-page-common"
|
|
1743
|
-
}, null) :
|
|
1768
|
+
}, null) : d(P("SvgIcon"), {
|
|
1744
1769
|
name: "text-page-folder"
|
|
1745
|
-
}, null),
|
|
1746
|
-
var
|
|
1747
|
-
const
|
|
1770
|
+
}, null), f = $(() => {
|
|
1771
|
+
var A;
|
|
1772
|
+
const i = ((A = a.pages[n]) == null ? void 0 : A.data) || [];
|
|
1748
1773
|
return {
|
|
1749
|
-
data:
|
|
1774
|
+
data: _({
|
|
1750
1775
|
children: [{
|
|
1751
1776
|
name: "无",
|
|
1752
1777
|
id: e
|
|
1753
|
-
}].concat(
|
|
1778
|
+
}].concat(i)
|
|
1754
1779
|
}).children,
|
|
1755
1780
|
shrinkIcon: null,
|
|
1756
1781
|
expandIcon: null,
|
|
1757
1782
|
renderContent: (X, {
|
|
1758
|
-
node:
|
|
1783
|
+
node: g,
|
|
1759
1784
|
data: D
|
|
1760
|
-
}) =>
|
|
1785
|
+
}) => d(oe, null, [y(D), d("div", null, [g.label])])
|
|
1761
1786
|
};
|
|
1762
|
-
}),
|
|
1787
|
+
}), k = K(null);
|
|
1763
1788
|
return {
|
|
1764
1789
|
pageRules: c,
|
|
1765
1790
|
folderRules: l,
|
|
1766
|
-
pageSettingState:
|
|
1767
|
-
pageParentId:
|
|
1768
|
-
generalForm:
|
|
1769
|
-
validGeneralForm: () => new Promise((
|
|
1770
|
-
|
|
1771
|
-
b ?
|
|
1791
|
+
pageSettingState: a,
|
|
1792
|
+
pageParentId: s,
|
|
1793
|
+
generalForm: k,
|
|
1794
|
+
validGeneralForm: () => new Promise((i, p) => {
|
|
1795
|
+
k.value.validate((b) => {
|
|
1796
|
+
b ? i(b) : p(b);
|
|
1772
1797
|
});
|
|
1773
1798
|
}),
|
|
1774
|
-
treeFolderOp:
|
|
1799
|
+
treeFolderOp: f,
|
|
1775
1800
|
currentRoute: r,
|
|
1776
|
-
changeParentForderId: (
|
|
1777
|
-
|
|
1801
|
+
changeParentForderId: (i) => {
|
|
1802
|
+
t(i.id, o.value), o.value = i.id;
|
|
1778
1803
|
}
|
|
1779
1804
|
};
|
|
1780
1805
|
}
|
|
1781
|
-
},
|
|
1806
|
+
}, an = { class: "general-config" }, nn = { class: "tip" }, on = {
|
|
1782
1807
|
key: 0,
|
|
1783
1808
|
class: "text"
|
|
1784
|
-
},
|
|
1809
|
+
}, sn = {
|
|
1785
1810
|
key: 1,
|
|
1786
1811
|
class: "route-text"
|
|
1787
|
-
},
|
|
1788
|
-
function
|
|
1789
|
-
const r =
|
|
1790
|
-
return v(),
|
|
1791
|
-
|
|
1812
|
+
}, rn = { class: "text-dim" };
|
|
1813
|
+
function ln(a, t, n, e, s, o) {
|
|
1814
|
+
const r = P("tiny-radio"), c = P("tiny-form-item"), l = P("tiny-input"), _ = P("tiny-select"), y = P("tiny-checkbox"), f = P("tiny-form"), k = P("page-home");
|
|
1815
|
+
return v(), U("div", an, [
|
|
1816
|
+
d(f, {
|
|
1792
1817
|
ref: "generalForm",
|
|
1793
1818
|
model: e.pageSettingState.currentPageData,
|
|
1794
1819
|
rules: n.isFolder ? e.folderRules : e.pageRules,
|
|
@@ -1800,60 +1825,60 @@ function sn(t, a, n, e, o, s) {
|
|
|
1800
1825
|
class: "general-config-form"
|
|
1801
1826
|
}, {
|
|
1802
1827
|
default: S(() => [
|
|
1803
|
-
n.isFolder ?
|
|
1828
|
+
n.isFolder ? j("", !0) : (v(), H(c, {
|
|
1804
1829
|
key: 0,
|
|
1805
1830
|
prop: "group",
|
|
1806
1831
|
label: "页面类型",
|
|
1807
1832
|
class: "form-item-page-type"
|
|
1808
1833
|
}, {
|
|
1809
1834
|
default: S(() => [
|
|
1810
|
-
|
|
1835
|
+
d(r, {
|
|
1811
1836
|
modelValue: e.pageSettingState.currentPageData.group,
|
|
1812
|
-
"onUpdate:modelValue":
|
|
1837
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => e.pageSettingState.currentPageData.group = m),
|
|
1813
1838
|
class: "page-type-radio",
|
|
1814
1839
|
label: "staticPages"
|
|
1815
1840
|
}, {
|
|
1816
|
-
default: S(() =>
|
|
1817
|
-
|
|
1841
|
+
default: S(() => t[6] || (t[6] = [
|
|
1842
|
+
ue(" 静态页面 ")
|
|
1818
1843
|
])),
|
|
1819
1844
|
_: 1
|
|
1820
1845
|
}, 8, ["modelValue"]),
|
|
1821
|
-
|
|
1846
|
+
d(r, {
|
|
1822
1847
|
modelValue: e.pageSettingState.currentPageData.group,
|
|
1823
|
-
"onUpdate:modelValue":
|
|
1848
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => e.pageSettingState.currentPageData.group = m),
|
|
1824
1849
|
class: "page-type-radio",
|
|
1825
1850
|
label: "publicPages"
|
|
1826
1851
|
}, {
|
|
1827
|
-
default: S(() =>
|
|
1828
|
-
|
|
1852
|
+
default: S(() => t[7] || (t[7] = [
|
|
1853
|
+
ue(" 公共页面 ")
|
|
1829
1854
|
])),
|
|
1830
1855
|
_: 1
|
|
1831
1856
|
}, 8, ["modelValue"])
|
|
1832
1857
|
]),
|
|
1833
1858
|
_: 1
|
|
1834
1859
|
})),
|
|
1835
|
-
|
|
1860
|
+
d(c, {
|
|
1836
1861
|
prop: "name",
|
|
1837
1862
|
label: `${n.isFolder ? "文件夹" : "页面"}名称`
|
|
1838
1863
|
}, {
|
|
1839
1864
|
default: S(() => [
|
|
1840
|
-
|
|
1865
|
+
d(l, {
|
|
1841
1866
|
modelValue: e.pageSettingState.currentPageData.name,
|
|
1842
|
-
"onUpdate:modelValue":
|
|
1867
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => e.pageSettingState.currentPageData.name = m),
|
|
1843
1868
|
placeholder: `请设置${n.isFolder ? "文件夹" : "页面"}名称`
|
|
1844
1869
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1845
1870
|
]),
|
|
1846
1871
|
_: 1
|
|
1847
1872
|
}, 8, ["label"]),
|
|
1848
|
-
e.pageSettingState.currentPageData.group !== "publicPages" ? (v(),
|
|
1873
|
+
e.pageSettingState.currentPageData.group !== "publicPages" ? (v(), H(c, {
|
|
1849
1874
|
key: 1,
|
|
1850
1875
|
label: "父文件夹/父页面",
|
|
1851
1876
|
prop: "parentId"
|
|
1852
1877
|
}, {
|
|
1853
1878
|
default: S(() => [
|
|
1854
|
-
|
|
1879
|
+
d(_, {
|
|
1855
1880
|
modelValue: e.pageParentId,
|
|
1856
|
-
"onUpdate:modelValue":
|
|
1881
|
+
"onUpdate:modelValue": t[3] || (t[3] = (m) => e.pageParentId = m),
|
|
1857
1882
|
"value-field": "id",
|
|
1858
1883
|
"render-type": "tree",
|
|
1859
1884
|
"tree-op": e.treeFolderOp,
|
|
@@ -1864,53 +1889,53 @@ function sn(t, a, n, e, o, s) {
|
|
|
1864
1889
|
}, null, 8, ["modelValue", "tree-op", "onChange"])
|
|
1865
1890
|
]),
|
|
1866
1891
|
_: 1
|
|
1867
|
-
})) :
|
|
1868
|
-
|
|
1892
|
+
})) : j("", !0),
|
|
1893
|
+
d(c, {
|
|
1869
1894
|
label: "页面路由",
|
|
1870
1895
|
prop: "route"
|
|
1871
1896
|
}, {
|
|
1872
1897
|
default: S(() => [
|
|
1873
|
-
|
|
1898
|
+
d(l, {
|
|
1874
1899
|
modelValue: e.pageSettingState.currentPageData.route,
|
|
1875
|
-
"onUpdate:modelValue":
|
|
1900
|
+
"onUpdate:modelValue": t[4] || (t[4] = (m) => e.pageSettingState.currentPageData.route = m),
|
|
1876
1901
|
placeholder: "请设置路由"
|
|
1877
1902
|
}, null, 8, ["modelValue"]),
|
|
1878
|
-
|
|
1879
|
-
e.pageSettingState.currentPageData.route ? (v(),
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
])) : (v(),
|
|
1903
|
+
V("div", nn, [
|
|
1904
|
+
e.pageSettingState.currentPageData.route ? (v(), U("span", sn, [
|
|
1905
|
+
t[8] || (t[8] = V("span", { class: "text" }, "website.com/", -1)),
|
|
1906
|
+
V("span", rn, de(e.currentRoute), 1)
|
|
1907
|
+
])) : (v(), U("span", on, "路由将以website.com开头"))
|
|
1883
1908
|
])
|
|
1884
1909
|
]),
|
|
1885
1910
|
_: 1
|
|
1886
1911
|
}),
|
|
1887
|
-
e.pageSettingState.currentPageData.group !== "publicPages" ? (v(),
|
|
1912
|
+
e.pageSettingState.currentPageData.group !== "publicPages" ? (v(), H(c, {
|
|
1888
1913
|
key: 2,
|
|
1889
1914
|
prop: "isDefault"
|
|
1890
1915
|
}, {
|
|
1891
1916
|
default: S(() => [
|
|
1892
|
-
|
|
1917
|
+
d(y, {
|
|
1893
1918
|
modelValue: e.pageSettingState.currentPageData.isDefault,
|
|
1894
|
-
"onUpdate:modelValue":
|
|
1919
|
+
"onUpdate:modelValue": t[5] || (t[5] = (m) => e.pageSettingState.currentPageData.isDefault = m)
|
|
1895
1920
|
}, {
|
|
1896
|
-
default: S(() =>
|
|
1897
|
-
|
|
1921
|
+
default: S(() => t[9] || (t[9] = [
|
|
1922
|
+
ue("设为默认页")
|
|
1898
1923
|
])),
|
|
1899
1924
|
_: 1
|
|
1900
1925
|
}, 8, ["modelValue"])
|
|
1901
1926
|
]),
|
|
1902
1927
|
_: 1
|
|
1903
|
-
})) :
|
|
1928
|
+
})) : j("", !0)
|
|
1904
1929
|
]),
|
|
1905
1930
|
_: 1
|
|
1906
1931
|
}, 8, ["model", "rules"]),
|
|
1907
|
-
!n.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (v(),
|
|
1932
|
+
!n.isFolder && !e.pageSettingState.isNew && e.pageSettingState.currentPageData.group !== "public" ? (v(), H(k, { key: 0 })) : j("", !0)
|
|
1908
1933
|
]);
|
|
1909
1934
|
}
|
|
1910
|
-
const
|
|
1935
|
+
const cn = /* @__PURE__ */ te(tn, [["render", ln], ["__scopeId", "data-v-830716e8"]]), Nn = {
|
|
1911
1936
|
...fe,
|
|
1912
|
-
apis:
|
|
1913
|
-
entry:
|
|
1937
|
+
apis: va,
|
|
1938
|
+
entry: Na,
|
|
1914
1939
|
options: {
|
|
1915
1940
|
pageBaseStyle: {
|
|
1916
1941
|
className: "page-base-style",
|
|
@@ -1918,11 +1943,11 @@ const rn = /* @__PURE__ */ te($a, [["render", sn], ["__scopeId", "data-v-3b52d6d
|
|
|
1918
1943
|
}
|
|
1919
1944
|
},
|
|
1920
1945
|
components: {
|
|
1921
|
-
PageGeneral:
|
|
1946
|
+
PageGeneral: cn
|
|
1922
1947
|
},
|
|
1923
|
-
metas: [
|
|
1948
|
+
metas: [Xa]
|
|
1924
1949
|
};
|
|
1925
1950
|
export {
|
|
1926
|
-
|
|
1927
|
-
|
|
1951
|
+
Xa as PageService,
|
|
1952
|
+
Nn as default
|
|
1928
1953
|
};
|