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