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