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