@webx-ui/module-services 0.1.6 → 0.1.8
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 +262 -248
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { reorderItems as
|
|
2
|
-
import { provide as
|
|
3
|
-
import { useRoute as We, useRouter as Ce, onBeforeRouteLeave as
|
|
4
|
-
import { provideBlocksPreview as
|
|
5
|
-
import { useLocales as
|
|
1
|
+
import { reorderItems as De, useAdmin as ae, useDates as Oe, useTranslate as le, useErrorText as me, provideRecordAddress as Pe, WxScreenHead as Ae, WxScreen as Me, WxSaveState as Le, WxDate as Re, useItemOrder as Ue, WxListScreen as He, WxRowMenu as Fe, categoryRoutes as Ke } from "@webx-ui/module-admin";
|
|
2
|
+
import { provide as Ge, inject as Je, defineComponent as ne, computed as f, ref as b, watch as se, onMounted as Te, onBeforeUnmount as Se, openBlock as d, createElementBlock as N, Fragment as X, createVNode as p, unref as e, withCtx as o, createTextVNode as _, toDisplayString as w, createBlock as k, createCommentVNode as R, createElementVNode as E, renderList as $e, normalizeClass as ye, useTemplateRef as je, nextTick as Qe, isRef as Xe, withKeys as Ye, resolveDynamicComponent as Ze, mergeProps as et } from "vue";
|
|
3
|
+
import { useRoute as We, useRouter as Ce, onBeforeRouteLeave as tt } from "vue-router";
|
|
4
|
+
import { provideBlocksPreview as st } from "@webx-ui/module-blocks";
|
|
5
|
+
import { useLocales as at, localizedValue as rt, confirm as Z, WxSkeleton as ie, WxCard as it, WxBadge as j, WxBreadcrumb as lt, WxBreadcrumbItem as _e, WxAlert as Ve, WxButton as Q, WxActionBar as nt, toast as S, WxEmpty as qe, WxText as ot, useModal as ct, WxDialog as ut, WxFormItem as dt, WxInput as Ie, WxSpace as vt, createModal as pt, WxIcon as xe, WxSelect as ht, WxSortableList as ft, WxTooltip as yt } from "@webx-ui/core";
|
|
6
6
|
const ge = "services";
|
|
7
7
|
function oe(c) {
|
|
8
8
|
const n = `${c.apiPath}/${ge}`, y = (r) => r.data;
|
|
9
9
|
return {
|
|
10
10
|
list: (r = {}) => {
|
|
11
|
-
const
|
|
12
|
-
return r.q &&
|
|
11
|
+
const l = new URLSearchParams();
|
|
12
|
+
return r.q && l.set("q", r.q), r.category != null && l.set("category", String(r.category)), r.status && l.set("status", r.status), r.trashed && l.set("trashed", "1"), c.http.get(l.size > 0 ? `${n}?${l}` : n);
|
|
13
13
|
},
|
|
14
14
|
get: (r) => c.http.get(`${n}/${r}`).then(y),
|
|
15
15
|
create: (r) => c.http.post(n, r).then(y),
|
|
16
|
-
save: (r,
|
|
16
|
+
save: (r, l) => c.http.put(`${n}/${r}`, l).then(y),
|
|
17
17
|
discard: (r) => c.http.post(`${n}/${r}/discard`, {}).then(y),
|
|
18
18
|
publish: (r) => c.http.post(`${n}/${r}/publish`, {}).then(y),
|
|
19
19
|
unpublish: (r) => c.http.post(`${n}/${r}/unpublish`, {}).then(y),
|
|
@@ -21,18 +21,18 @@ function oe(c) {
|
|
|
21
21
|
}),
|
|
22
22
|
restore: (r) => c.http.post(`${n}/${r}/restore`, {}).then(y),
|
|
23
23
|
versions: (r) => c.http.get(`${n}/${r}/versions`).then(y),
|
|
24
|
-
restoreVersion: (r,
|
|
25
|
-
reorder: (r,
|
|
24
|
+
restoreVersion: (r, l) => c.http.post(`${n}/${r}/versions/${l}/restore`, {}).then(y),
|
|
25
|
+
reorder: (r, l = null) => De(c, ge, r, l)
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
const ze = /* @__PURE__ */ Symbol("wx-service-editor");
|
|
29
|
-
function
|
|
30
|
-
|
|
29
|
+
function gt(c) {
|
|
30
|
+
Ge(ze, c);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function mt() {
|
|
33
|
+
return Je(ze, null);
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const bt = {
|
|
36
36
|
module: {
|
|
37
37
|
group: "Services",
|
|
38
38
|
services: "Services",
|
|
@@ -143,70 +143,84 @@ const gt = {
|
|
|
143
143
|
function ce() {
|
|
144
144
|
try {
|
|
145
145
|
const { i18n: c } = ae();
|
|
146
|
-
ke.has(c) || (c.defaults("webx-services",
|
|
146
|
+
ke.has(c) || (c.defaults("webx-services", bt), ke.add(c));
|
|
147
147
|
} catch {
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const wt = { class: "wx-service-editor__screen" }, _t = 1200, xt = /* @__PURE__ */ ne({
|
|
151
151
|
__name: "ServiceEditorPage",
|
|
152
152
|
props: {
|
|
153
153
|
base: { default: "/services" }
|
|
154
154
|
},
|
|
155
155
|
setup(c) {
|
|
156
|
-
const n = c, y = ae(), r = oe(y),
|
|
156
|
+
const n = c, y = ae(), r = oe(y), l = We(), B = Ce(), a = at(), T = Oe();
|
|
157
157
|
ce();
|
|
158
|
-
const s = le("webx-services"), $ = me(), W = f(() => Number(
|
|
159
|
-
const
|
|
160
|
-
return
|
|
158
|
+
const s = le("webx-services"), $ = me(), W = f(() => Number(l.params.id)), O = f(() => n.base), u = b(null), g = b({}), m = b(""), h = b(null), C = b(null), P = b(!0), M = b(!1), U = b(!1), H = b({}), V = b(null), Y = b(""), F = b(0), D = f(() => y.can("services.manage")), ue = f(() => !D.value || U.value), L = f(() => JSON.stringify(g.value)), z = f(() => Y.value !== "" && L.value !== Y.value), de = f(() => M.value ? "saving" : z.value ? "unsaved" : "saved"), ee = f(() => {
|
|
159
|
+
const i = g.value.title;
|
|
160
|
+
return rt(i, a.active.value, u.value?.title ?? "");
|
|
161
161
|
}), ve = f(() => {
|
|
162
|
-
const
|
|
163
|
-
return !
|
|
162
|
+
const i = u.value;
|
|
163
|
+
return !i || i.status !== "published" && i.status !== "modified" ? "" : s("service.live-since", { date: T.short(i.published_at) });
|
|
164
164
|
});
|
|
165
|
-
|
|
165
|
+
st({ url: f(() => C.value), reload: F }), Pe({
|
|
166
166
|
values: g,
|
|
167
167
|
prefix: h,
|
|
168
168
|
path: f(() => u.value?.path),
|
|
169
169
|
moving: () => s("service.address-moving")
|
|
170
|
-
}),
|
|
171
|
-
function re(
|
|
172
|
-
u.value =
|
|
170
|
+
}), gt({ service: u, canManage: D.value, reload: () => A(!0) });
|
|
171
|
+
function re(i) {
|
|
172
|
+
u.value = i.service, g.value = i.values, m.value = i.revision, h.value = i.prefix, C.value = i.preview_url, Y.value = JSON.stringify(i.values), V.value = null;
|
|
173
173
|
}
|
|
174
|
-
async function A(
|
|
175
|
-
|
|
174
|
+
async function A(i = !1) {
|
|
175
|
+
i || (P.value = !0);
|
|
176
176
|
try {
|
|
177
177
|
re(await r.get(W.value));
|
|
178
|
-
} catch (
|
|
179
|
-
S.danger($(
|
|
178
|
+
} catch (q) {
|
|
179
|
+
S.danger($(q)), B.push(O.value);
|
|
180
180
|
} finally {
|
|
181
|
-
|
|
181
|
+
P.value = !1;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
let
|
|
184
|
+
let K;
|
|
185
185
|
function pe() {
|
|
186
|
-
!
|
|
187
|
-
|
|
188
|
-
},
|
|
186
|
+
!D.value || V.value || !z.value || (clearTimeout(K), K = setTimeout(() => {
|
|
187
|
+
t();
|
|
188
|
+
}, _t));
|
|
189
189
|
}
|
|
190
190
|
function he() {
|
|
191
|
-
!
|
|
191
|
+
!D.value || V.value || !z.value || M.value || (clearTimeout(K), t());
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
let G;
|
|
194
|
+
async function t() {
|
|
195
|
+
for (; G; ) {
|
|
196
|
+
const { carried: I, done: J } = G;
|
|
197
|
+
if (await J, !z.value || V.value || L.value === I) return;
|
|
198
|
+
}
|
|
199
|
+
const i = L.value, q = x();
|
|
200
|
+
G = { carried: i, done: q };
|
|
198
201
|
try {
|
|
199
|
-
|
|
200
|
-
u.value = B.service, m.value = B.revision, h.value = B.prefix, C.value = B.preview_url, V.value = null, K.value === l && (X.value = l), F.value += 1;
|
|
201
|
-
} catch (B) {
|
|
202
|
-
const te = B;
|
|
203
|
-
te.status === 409 && te.body?.data ? V.value = te.body : te.body?.errors ? (H.value = te.body.errors, S.danger(s("service.save-failed"))) : S.danger($(B));
|
|
202
|
+
await q;
|
|
204
203
|
} finally {
|
|
205
|
-
|
|
204
|
+
G?.done === q && (G = void 0);
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
|
-
async function
|
|
209
|
-
|
|
207
|
+
async function x() {
|
|
208
|
+
if (!u.value || !D.value) return;
|
|
209
|
+
clearTimeout(K);
|
|
210
|
+
const i = L.value, q = g.value;
|
|
211
|
+
M.value = !0, H.value = {};
|
|
212
|
+
try {
|
|
213
|
+
const I = await r.save(u.value.id, { values: q, revision: m.value });
|
|
214
|
+
u.value = I.service, m.value = I.revision, h.value = I.prefix, C.value = I.preview_url, V.value = null, L.value === i && (Y.value = i), F.value += 1;
|
|
215
|
+
} catch (I) {
|
|
216
|
+
const J = I;
|
|
217
|
+
J.status === 409 && J.body?.data ? V.value = J.body : J.body?.errors ? (H.value = J.body.errors, S.danger(s("service.save-failed"))) : S.danger($(I));
|
|
218
|
+
} finally {
|
|
219
|
+
M.value = !1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async function v() {
|
|
223
|
+
await Z({
|
|
210
224
|
title: s("service.conflict-theirs-title"),
|
|
211
225
|
message: s("service.conflict-theirs-text"),
|
|
212
226
|
confirmText: s("service.conflict-theirs"),
|
|
@@ -214,118 +228,118 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
214
228
|
tone: "danger"
|
|
215
229
|
}) && await A(!0);
|
|
216
230
|
}
|
|
217
|
-
async function
|
|
218
|
-
const
|
|
219
|
-
|
|
231
|
+
async function te() {
|
|
232
|
+
const i = V.value;
|
|
233
|
+
i && (m.value = i.data.revision, V.value = null, await t());
|
|
220
234
|
}
|
|
221
|
-
async function
|
|
222
|
-
if (!(!u.value || !await
|
|
235
|
+
async function fe() {
|
|
236
|
+
if (!(!u.value || !await Z({
|
|
223
237
|
title: s("service.discard-title"),
|
|
224
238
|
message: s("service.discard-text"),
|
|
225
239
|
confirmText: s("service.discard"),
|
|
226
240
|
cancelText: s("panel.cancel"),
|
|
227
241
|
tone: "danger"
|
|
228
242
|
}))) {
|
|
229
|
-
|
|
243
|
+
U.value = !0;
|
|
230
244
|
try {
|
|
231
245
|
re(await r.discard(u.value.id)), S.success(s("service.discarded"));
|
|
232
|
-
} catch (
|
|
233
|
-
S.danger($(
|
|
246
|
+
} catch (q) {
|
|
247
|
+
S.danger($(q));
|
|
234
248
|
} finally {
|
|
235
|
-
|
|
249
|
+
U.value = !1;
|
|
236
250
|
}
|
|
237
251
|
}
|
|
238
252
|
}
|
|
239
|
-
async function
|
|
240
|
-
const
|
|
241
|
-
if (!(!
|
|
242
|
-
title: s("service.publish-title", { title:
|
|
243
|
-
message:
|
|
253
|
+
async function Ee() {
|
|
254
|
+
const i = u.value;
|
|
255
|
+
if (!(!i || !await Z({
|
|
256
|
+
title: s("service.publish-title", { title: ee.value || i.title }),
|
|
257
|
+
message: i.path === null ? s("service.publish-nowhere") : s("service.publish-text", { address: `/${i.path}` }),
|
|
244
258
|
confirmText: s("panel.publish"),
|
|
245
259
|
cancelText: s("panel.cancel")
|
|
246
|
-
})) && (
|
|
247
|
-
|
|
260
|
+
})) && (z.value && await t(), !V.value)) {
|
|
261
|
+
U.value = !0;
|
|
248
262
|
try {
|
|
249
|
-
await r.publish(
|
|
250
|
-
} catch (
|
|
251
|
-
S.danger($(
|
|
263
|
+
await r.publish(i.id), await A(!0), S.success(s("panel.published"));
|
|
264
|
+
} catch (I) {
|
|
265
|
+
S.danger($(I));
|
|
252
266
|
} finally {
|
|
253
|
-
|
|
267
|
+
U.value = !1;
|
|
254
268
|
}
|
|
255
269
|
}
|
|
256
270
|
}
|
|
257
|
-
function
|
|
258
|
-
const
|
|
259
|
-
return
|
|
271
|
+
function Ne() {
|
|
272
|
+
const i = u.value?.status;
|
|
273
|
+
return i === "published" || i === "modified" ? "success" : "default";
|
|
260
274
|
}
|
|
261
|
-
function we(
|
|
262
|
-
|
|
275
|
+
function we(i) {
|
|
276
|
+
z.value && i.preventDefault();
|
|
263
277
|
}
|
|
264
|
-
se(
|
|
278
|
+
se(L, pe), se(W, () => {
|
|
265
279
|
A();
|
|
266
280
|
}), Te(() => {
|
|
267
281
|
A(), window.addEventListener("beforeunload", we);
|
|
268
282
|
}), Se(() => {
|
|
269
|
-
clearTimeout(
|
|
270
|
-
}),
|
|
283
|
+
clearTimeout(K), window.removeEventListener("beforeunload", we);
|
|
284
|
+
}), tt(async () => !z.value || !D.value || (await t(), !z.value) ? !0 : await Z({
|
|
271
285
|
title: s("service.leave-title"),
|
|
272
286
|
message: s("service.leave-text"),
|
|
273
287
|
confirmText: s("service.leave"),
|
|
274
288
|
cancelText: s("panel.cancel"),
|
|
275
289
|
tone: "danger"
|
|
276
290
|
}));
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
return C.value &&
|
|
291
|
+
const Be = f(() => {
|
|
292
|
+
const i = [];
|
|
293
|
+
return C.value && i.push({ key: "preview", label: s("service.preview"), icon: "eye", href: C.value }), u.value?.url && u.value.status !== "draft" && i.push({
|
|
280
294
|
key: "site",
|
|
281
295
|
label: s("panel.open-on-site"),
|
|
282
296
|
icon: "link",
|
|
283
297
|
href: u.value.url
|
|
284
|
-
}), u.value?.status === "modified" &&
|
|
298
|
+
}), u.value?.status === "modified" && i.push({
|
|
285
299
|
key: "discard",
|
|
286
300
|
label: s("service.discard"),
|
|
287
301
|
icon: "refresh",
|
|
288
302
|
danger: !0,
|
|
289
303
|
menu: !0,
|
|
290
304
|
run: () => {
|
|
291
|
-
|
|
305
|
+
fe();
|
|
292
306
|
}
|
|
293
|
-
}),
|
|
307
|
+
}), i;
|
|
294
308
|
});
|
|
295
|
-
return (
|
|
309
|
+
return (i, q) => (d(), N("div", {
|
|
296
310
|
class: "wx-service-editor",
|
|
297
311
|
onFocusout: he
|
|
298
312
|
}, [
|
|
299
|
-
|
|
313
|
+
P.value || !u.value ? (d(), N(X, { key: 0 }, [
|
|
300
314
|
p(e(ie), {
|
|
301
315
|
class: "wx-service-editor__ghost",
|
|
302
316
|
title: "",
|
|
303
317
|
rows: 1
|
|
304
318
|
}),
|
|
305
|
-
p(e(
|
|
319
|
+
p(e(it), null, {
|
|
306
320
|
default: o(() => [
|
|
307
321
|
p(e(ie), { rows: 8 })
|
|
308
322
|
]),
|
|
309
323
|
_: 1
|
|
310
324
|
})
|
|
311
|
-
], 64)) : (d(),
|
|
312
|
-
p(e(
|
|
325
|
+
], 64)) : (d(), N(X, { key: 1 }, [
|
|
326
|
+
p(e(Ae), {
|
|
313
327
|
divider: "",
|
|
314
|
-
back:
|
|
328
|
+
back: O.value,
|
|
315
329
|
"back-label": e(s)("module.services"),
|
|
316
|
-
title:
|
|
330
|
+
title: ee.value || e(s)("service.untitled"),
|
|
317
331
|
subtitle: ve.value,
|
|
318
|
-
actions:
|
|
332
|
+
actions: Be.value
|
|
319
333
|
}, {
|
|
320
334
|
trail: o(() => [
|
|
321
|
-
p(e(
|
|
335
|
+
p(e(lt), {
|
|
322
336
|
size: "sm",
|
|
323
337
|
label: e(s)("service.trail")
|
|
324
338
|
}, {
|
|
325
339
|
default: o(() => [
|
|
326
340
|
p(e(_e), {
|
|
327
341
|
as: "router-link",
|
|
328
|
-
to:
|
|
342
|
+
to: O.value
|
|
329
343
|
}, {
|
|
330
344
|
default: o(() => [
|
|
331
345
|
_(w(e(s)("module.services")), 1)
|
|
@@ -334,7 +348,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
334
348
|
}, 8, ["to"]),
|
|
335
349
|
p(e(_e), { current: "" }, {
|
|
336
350
|
default: o(() => [
|
|
337
|
-
_(w(
|
|
351
|
+
_(w(ee.value || e(s)("service.untitled")), 1)
|
|
338
352
|
]),
|
|
339
353
|
_: 1
|
|
340
354
|
})
|
|
@@ -343,8 +357,8 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
343
357
|
}, 8, ["label"])
|
|
344
358
|
]),
|
|
345
359
|
"title-after": o(() => [
|
|
346
|
-
p(e(
|
|
347
|
-
type:
|
|
360
|
+
p(e(j), {
|
|
361
|
+
type: Ne(),
|
|
348
362
|
dot: ""
|
|
349
363
|
}, {
|
|
350
364
|
default: o(() => [
|
|
@@ -352,7 +366,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
352
366
|
]),
|
|
353
367
|
_: 1
|
|
354
368
|
}, 8, ["type"]),
|
|
355
|
-
u.value.status === "modified" ? (d(), k(e(
|
|
369
|
+
u.value.status === "modified" ? (d(), k(e(j), {
|
|
356
370
|
key: 0,
|
|
357
371
|
type: "primary",
|
|
358
372
|
round: ""
|
|
@@ -361,7 +375,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
361
375
|
_(w(e(s)("panel.edits")), 1)
|
|
362
376
|
]),
|
|
363
377
|
_: 1
|
|
364
|
-
})) :
|
|
378
|
+
})) : R("", !0)
|
|
365
379
|
]),
|
|
366
380
|
_: 1
|
|
367
381
|
}, 8, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
@@ -372,20 +386,20 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
372
386
|
description: V.value.message
|
|
373
387
|
}, {
|
|
374
388
|
actions: o(() => [
|
|
375
|
-
p(e(
|
|
389
|
+
p(e(Q), {
|
|
376
390
|
size: "sm",
|
|
377
391
|
variant: "outline",
|
|
378
|
-
onClick:
|
|
392
|
+
onClick: v
|
|
379
393
|
}, {
|
|
380
394
|
default: o(() => [
|
|
381
395
|
_(w(e(s)("service.conflict-theirs")), 1)
|
|
382
396
|
]),
|
|
383
397
|
_: 1
|
|
384
398
|
}),
|
|
385
|
-
p(e(
|
|
399
|
+
p(e(Q), {
|
|
386
400
|
size: "sm",
|
|
387
401
|
type: "primary",
|
|
388
|
-
onClick:
|
|
402
|
+
onClick: te
|
|
389
403
|
}, {
|
|
390
404
|
default: o(() => [
|
|
391
405
|
_(w(e(s)("service.conflict-mine")), 1)
|
|
@@ -394,37 +408,37 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
394
408
|
})
|
|
395
409
|
]),
|
|
396
410
|
_: 1
|
|
397
|
-
}, 8, ["title", "description"])) :
|
|
398
|
-
|
|
399
|
-
p(e(
|
|
411
|
+
}, 8, ["title", "description"])) : R("", !0),
|
|
412
|
+
E("div", wt, [
|
|
413
|
+
p(e(Me), {
|
|
400
414
|
modelValue: g.value,
|
|
401
|
-
"onUpdate:modelValue":
|
|
415
|
+
"onUpdate:modelValue": q[0] || (q[0] = (I) => g.value = I),
|
|
402
416
|
name: "services.form",
|
|
403
417
|
errors: H.value,
|
|
404
418
|
disabled: ue.value
|
|
405
419
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
406
420
|
]),
|
|
407
|
-
|
|
421
|
+
D.value ? (d(), k(e(nt), { key: 1 }, {
|
|
408
422
|
state: o(() => [
|
|
409
|
-
p(e(
|
|
423
|
+
p(e(Le), { state: de.value }, null, 8, ["state"])
|
|
410
424
|
]),
|
|
411
425
|
default: o(() => [
|
|
412
|
-
p(e(
|
|
426
|
+
p(e(Q), {
|
|
413
427
|
variant: "outline",
|
|
414
|
-
loading:
|
|
415
|
-
disabled: !
|
|
416
|
-
onClick:
|
|
428
|
+
loading: M.value,
|
|
429
|
+
disabled: !z.value,
|
|
430
|
+
onClick: t
|
|
417
431
|
}, {
|
|
418
432
|
default: o(() => [
|
|
419
433
|
_(w(e(s)("service.save")), 1)
|
|
420
434
|
]),
|
|
421
435
|
_: 1
|
|
422
436
|
}, 8, ["loading", "disabled"]),
|
|
423
|
-
p(e(
|
|
437
|
+
p(e(Q), {
|
|
424
438
|
type: "primary",
|
|
425
|
-
loading:
|
|
426
|
-
disabled: u.value.status === "published" && !
|
|
427
|
-
onClick:
|
|
439
|
+
loading: U.value,
|
|
440
|
+
disabled: u.value.status === "published" && !z.value,
|
|
441
|
+
onClick: Ee
|
|
428
442
|
}, {
|
|
429
443
|
default: o(() => [
|
|
430
444
|
_(w(e(s)("panel.publish")), 1)
|
|
@@ -433,46 +447,46 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
433
447
|
}, 8, ["loading", "disabled"])
|
|
434
448
|
]),
|
|
435
449
|
_: 1
|
|
436
|
-
})) :
|
|
450
|
+
})) : R("", !0)
|
|
437
451
|
], 64))
|
|
438
452
|
], 32));
|
|
439
453
|
}
|
|
440
454
|
}), be = (c, n) => {
|
|
441
455
|
const y = c.__vccOpts || c;
|
|
442
|
-
for (const [r,
|
|
443
|
-
y[r] =
|
|
456
|
+
for (const [r, l] of n)
|
|
457
|
+
y[r] = l;
|
|
444
458
|
return y;
|
|
445
|
-
},
|
|
459
|
+
}, kt = /* @__PURE__ */ be(xt, [["__scopeId", "data-v-15dec02d"]]), Tt = { class: "wx-service-history" }, St = { class: "wx-service-history__number" }, $t = { class: "wx-service-history__who" }, Wt = /* @__PURE__ */ ne({
|
|
446
460
|
name: "WxServiceHistory",
|
|
447
461
|
__name: "ServiceHistory",
|
|
448
462
|
setup(c) {
|
|
449
|
-
const n = ae(), y = oe(n), r =
|
|
463
|
+
const n = ae(), y = oe(n), r = mt();
|
|
450
464
|
ce();
|
|
451
|
-
const
|
|
465
|
+
const l = le("webx-services"), B = me(), a = b(null), T = b(!1), s = f(() => r?.service.value ?? null), $ = f(() => r?.canManage ?? !1), W = f(
|
|
452
466
|
() => s.value?.status === "published" || s.value?.status === "modified" ? a.value?.[0]?.number ?? null : null
|
|
453
467
|
);
|
|
454
|
-
async function
|
|
468
|
+
async function O() {
|
|
455
469
|
const g = s.value;
|
|
456
470
|
if (g)
|
|
457
471
|
try {
|
|
458
472
|
a.value = await y.versions(g.id);
|
|
459
473
|
} catch (m) {
|
|
460
|
-
a.value = [], S.danger(
|
|
474
|
+
a.value = [], S.danger(B(m));
|
|
461
475
|
}
|
|
462
476
|
}
|
|
463
477
|
async function u(g) {
|
|
464
478
|
const m = s.value;
|
|
465
|
-
if (!(!m || !await
|
|
466
|
-
title:
|
|
467
|
-
message:
|
|
468
|
-
confirmText:
|
|
469
|
-
cancelText:
|
|
479
|
+
if (!(!m || !await Z({
|
|
480
|
+
title: l("service.restore-title", { number: g.number }),
|
|
481
|
+
message: l("service.restore-text"),
|
|
482
|
+
confirmText: l("service.restore-version"),
|
|
483
|
+
cancelText: l("panel.cancel")
|
|
470
484
|
}))) {
|
|
471
485
|
T.value = !0;
|
|
472
486
|
try {
|
|
473
|
-
await y.restoreVersion(m.id, g.number), await r?.reload(), S.success(
|
|
487
|
+
await y.restoreVersion(m.id, g.number), await r?.reload(), S.success(l("service.restored-version", { number: g.number }));
|
|
474
488
|
} catch (C) {
|
|
475
|
-
S.danger(
|
|
489
|
+
S.danger(B(C));
|
|
476
490
|
} finally {
|
|
477
491
|
T.value = !1;
|
|
478
492
|
}
|
|
@@ -481,53 +495,53 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
481
495
|
return se(
|
|
482
496
|
() => [s.value?.id, s.value?.published_at, s.value?.updated_at],
|
|
483
497
|
() => {
|
|
484
|
-
|
|
498
|
+
O();
|
|
485
499
|
},
|
|
486
500
|
{ immediate: !0 }
|
|
487
|
-
), (g, m) => (d(),
|
|
501
|
+
), (g, m) => (d(), N("div", Tt, [
|
|
488
502
|
a.value === null ? (d(), k(e(ie), {
|
|
489
503
|
key: 0,
|
|
490
504
|
class: "wx-service-history__ghost",
|
|
491
505
|
rows: 3
|
|
492
506
|
})) : a.value.length === 0 ? (d(), k(e(qe), {
|
|
493
507
|
key: 1,
|
|
494
|
-
description: e(
|
|
495
|
-
}, null, 8, ["description"])) : (d(!0),
|
|
508
|
+
description: e(l)("service.history-empty")
|
|
509
|
+
}, null, 8, ["description"])) : (d(!0), N(X, { key: 2 }, $e(a.value, (h) => (d(), N("div", {
|
|
496
510
|
key: h.number,
|
|
497
511
|
class: ye(["wx-service-history__row", { "is-live": h.number === W.value }])
|
|
498
512
|
}, [
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
h.created_at ? (d(), k(e(
|
|
513
|
+
E("code", St, w(e(l)("service.version", { number: h.number })), 1),
|
|
514
|
+
E("div", $t, [
|
|
515
|
+
h.created_at ? (d(), k(e(Re), {
|
|
502
516
|
key: 0,
|
|
503
517
|
value: h.created_at,
|
|
504
518
|
size: "md",
|
|
505
519
|
tone: "default"
|
|
506
|
-
}, null, 8, ["value"])) :
|
|
507
|
-
p(e(
|
|
520
|
+
}, null, 8, ["value"])) : R("", !0),
|
|
521
|
+
p(e(ot), {
|
|
508
522
|
size: "sm",
|
|
509
523
|
tone: "muted"
|
|
510
524
|
}, {
|
|
511
525
|
default: o(() => [
|
|
512
|
-
_(w(h.author ?? e(
|
|
513
|
-
h.comment ? (d(),
|
|
526
|
+
_(w(h.author ?? e(l)(`service.source-${h.source}`)) + " ", 1),
|
|
527
|
+
h.comment ? (d(), N(X, { key: 0 }, [
|
|
514
528
|
_(" · " + w(h.comment), 1)
|
|
515
|
-
], 64)) :
|
|
529
|
+
], 64)) : R("", !0)
|
|
516
530
|
]),
|
|
517
531
|
_: 2
|
|
518
532
|
}, 1024)
|
|
519
533
|
]),
|
|
520
|
-
h.number === W.value ? (d(), k(e(
|
|
534
|
+
h.number === W.value ? (d(), k(e(j), {
|
|
521
535
|
key: 0,
|
|
522
536
|
type: "success",
|
|
523
537
|
dot: ""
|
|
524
538
|
}, {
|
|
525
539
|
default: o(() => [
|
|
526
|
-
_(w(e(
|
|
540
|
+
_(w(e(l)("service.version-live")), 1)
|
|
527
541
|
]),
|
|
528
542
|
_: 1
|
|
529
|
-
})) :
|
|
530
|
-
$.value && h.number !== W.value ? (d(), k(e(
|
|
543
|
+
})) : R("", !0),
|
|
544
|
+
$.value && h.number !== W.value ? (d(), k(e(Q), {
|
|
531
545
|
key: 1,
|
|
532
546
|
size: "sm",
|
|
533
547
|
variant: "outline",
|
|
@@ -535,27 +549,27 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
535
549
|
onClick: (C) => u(h)
|
|
536
550
|
}, {
|
|
537
551
|
default: o(() => [
|
|
538
|
-
_(w(e(
|
|
552
|
+
_(w(e(l)("service.restore-version")), 1)
|
|
539
553
|
]),
|
|
540
554
|
_: 1
|
|
541
|
-
}, 8, ["loading", "onClick"])) :
|
|
555
|
+
}, 8, ["loading", "onClick"])) : R("", !0)
|
|
542
556
|
], 2))), 128))
|
|
543
557
|
]));
|
|
544
558
|
}
|
|
545
|
-
}),
|
|
559
|
+
}), Ct = /* @__PURE__ */ be(Wt, [["__scopeId", "data-v-72dccbb1"]]), Vt = /* @__PURE__ */ ne({
|
|
546
560
|
__name: "ServiceCreateDialog",
|
|
547
561
|
setup(c) {
|
|
548
|
-
const { open: n, resolve: y, dismiss: r } =
|
|
562
|
+
const { open: n, resolve: y, dismiss: r } = ct(), l = ae(), B = oe(l);
|
|
549
563
|
ce();
|
|
550
|
-
const a = le("webx-services"), T = b(""), s = b(!1), $ = b({}), W =
|
|
564
|
+
const a = le("webx-services"), T = b(""), s = b(!1), $ = b({}), W = je("field");
|
|
551
565
|
Te(async () => {
|
|
552
|
-
await
|
|
566
|
+
await Qe(), W.value?.querySelector("input")?.focus();
|
|
553
567
|
});
|
|
554
|
-
async function
|
|
568
|
+
async function O() {
|
|
555
569
|
if (!(T.value.trim() === "" || s.value)) {
|
|
556
570
|
s.value = !0, $.value = {};
|
|
557
571
|
try {
|
|
558
|
-
y(await
|
|
572
|
+
y(await B.create({ title: T.value.trim() }));
|
|
559
573
|
} catch (u) {
|
|
560
574
|
$.value = u.body?.errors ?? {};
|
|
561
575
|
} finally {
|
|
@@ -563,16 +577,16 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
563
577
|
}
|
|
564
578
|
}
|
|
565
579
|
}
|
|
566
|
-
return (u, g) => (d(), k(e(
|
|
580
|
+
return (u, g) => (d(), k(e(ut), {
|
|
567
581
|
open: e(n),
|
|
568
|
-
"onUpdate:open": g[2] || (g[2] = (m) =>
|
|
582
|
+
"onUpdate:open": g[2] || (g[2] = (m) => Xe(n) ? n.value = m : null),
|
|
569
583
|
title: e(a)("panel.new-title"),
|
|
570
584
|
width: 440
|
|
571
585
|
}, {
|
|
572
586
|
footer: o(() => [
|
|
573
|
-
p(e(
|
|
587
|
+
p(e(vt), { size: "sm" }, {
|
|
574
588
|
default: o(() => [
|
|
575
|
-
p(e(
|
|
589
|
+
p(e(Q), {
|
|
576
590
|
variant: "outline",
|
|
577
591
|
onClick: g[1] || (g[1] = (m) => e(r)())
|
|
578
592
|
}, {
|
|
@@ -581,11 +595,11 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
581
595
|
]),
|
|
582
596
|
_: 1
|
|
583
597
|
}),
|
|
584
|
-
p(e(
|
|
598
|
+
p(e(Q), {
|
|
585
599
|
type: "primary",
|
|
586
600
|
loading: s.value,
|
|
587
601
|
disabled: T.value.trim() === "",
|
|
588
|
-
onClick:
|
|
602
|
+
onClick: O
|
|
589
603
|
}, {
|
|
590
604
|
default: o(() => [
|
|
591
605
|
_(w(e(a)("panel.create")), 1)
|
|
@@ -597,13 +611,13 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
597
611
|
})
|
|
598
612
|
]),
|
|
599
613
|
default: o(() => [
|
|
600
|
-
p(e(
|
|
614
|
+
p(e(dt), {
|
|
601
615
|
label: e(a)("panel.field-title"),
|
|
602
616
|
error: $.value.title?.[0] ?? $.value.slug?.[0],
|
|
603
617
|
required: ""
|
|
604
618
|
}, {
|
|
605
619
|
default: o(() => [
|
|
606
|
-
|
|
620
|
+
E("div", {
|
|
607
621
|
ref_key: "field",
|
|
608
622
|
ref: W
|
|
609
623
|
}, [
|
|
@@ -611,7 +625,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
611
625
|
modelValue: T.value,
|
|
612
626
|
"onUpdate:modelValue": g[0] || (g[0] = (m) => T.value = m),
|
|
613
627
|
"aria-label": e(a)("panel.field-title"),
|
|
614
|
-
onKeyup:
|
|
628
|
+
onKeyup: Ye(O, ["enter"])
|
|
615
629
|
}, null, 8, ["modelValue", "aria-label"])
|
|
616
630
|
], 512)
|
|
617
631
|
]),
|
|
@@ -621,42 +635,42 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
621
635
|
_: 1
|
|
622
636
|
}, 8, ["open", "title"]));
|
|
623
637
|
}
|
|
624
|
-
}),
|
|
638
|
+
}), qt = { class: "wx-services" }, It = { class: "wx-services__bar" }, zt = ["src"], Et = { class: "wx-service-row__name" }, Nt = { class: "wx-service-row__title" }, Bt = { class: "wx-service-row__address" }, Dt = { class: "wx-service-row__facts" }, Ot = { class: "wx-service-row__chips" }, Pt = { class: "wx-service-row__state" }, At = /* @__PURE__ */ ne({
|
|
625
639
|
__name: "ServicesPage",
|
|
626
640
|
props: {
|
|
627
641
|
base: { default: "/services" }
|
|
628
642
|
},
|
|
629
643
|
setup(c) {
|
|
630
|
-
const n = c, y = ae(), r = oe(y),
|
|
644
|
+
const n = c, y = ae(), r = oe(y), l = We(), B = Ce();
|
|
631
645
|
ce();
|
|
632
|
-
const a = le("webx-services"), T = me(), s = b([]), $ = b([]), W = b(!0),
|
|
646
|
+
const a = le("webx-services"), T = me(), s = b([]), $ = b([]), W = b(!0), O = pt(Vt), u = f(() => y.can("services.manage")), g = f(
|
|
633
647
|
() => y.state.manifest?.modules.find((t) => t.id === "services")?.title ?? a("module.services")
|
|
634
648
|
), m = f({
|
|
635
|
-
get: () => typeof
|
|
649
|
+
get: () => typeof l.query.view == "string" ? l.query.view : "",
|
|
636
650
|
set: (t) => {
|
|
637
|
-
|
|
638
|
-
query: { ...
|
|
651
|
+
B.replace({
|
|
652
|
+
query: { ...l.query, view: t === "" ? void 0 : String(t) }
|
|
639
653
|
});
|
|
640
654
|
}
|
|
641
655
|
}), h = f(() => m.value === "trashed"), C = f(() => {
|
|
642
|
-
const t =
|
|
656
|
+
const t = l.query.category;
|
|
643
657
|
return typeof t == "string" && t !== "" && Number(t) || null;
|
|
644
|
-
}),
|
|
658
|
+
}), P = f(() => typeof l.query.q == "string" ? l.query.q : ""), M = b(P.value), U = f(() => [
|
|
645
659
|
{ value: "", label: a("panel.view-all") },
|
|
646
660
|
{ value: "published", label: a("panel.view-published") },
|
|
647
661
|
{ value: "draft", label: a("panel.view-draft") },
|
|
648
662
|
{ value: "unpublished", label: a("panel.view-unpublished") },
|
|
649
663
|
{ value: "trashed", label: a("panel.bin"), icon: "trash" }
|
|
650
|
-
]), H =
|
|
651
|
-
q:
|
|
664
|
+
]), H = Ue(ge, () => ({
|
|
665
|
+
q: P.value,
|
|
652
666
|
category: C.value,
|
|
653
667
|
filtered: m.value !== ""
|
|
654
|
-
})), V = f(() => u.value && H.sortable.value),
|
|
668
|
+
})), V = f(() => u.value && H.sortable.value), Y = f(() => P.value !== "" ? a("panel.empty-search") : h.value ? a("panel.empty-bin") : a("panel.empty"));
|
|
655
669
|
async function F() {
|
|
656
670
|
W.value = !0;
|
|
657
671
|
try {
|
|
658
672
|
const t = await r.list({
|
|
659
|
-
q:
|
|
673
|
+
q: P.value,
|
|
660
674
|
category: C.value,
|
|
661
675
|
status: h.value ? "" : m.value,
|
|
662
676
|
trashed: h.value
|
|
@@ -669,28 +683,28 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
669
683
|
}
|
|
670
684
|
}
|
|
671
685
|
se(
|
|
672
|
-
() => [m.value, C.value,
|
|
686
|
+
() => [m.value, C.value, P.value],
|
|
673
687
|
() => {
|
|
674
688
|
F();
|
|
675
689
|
}
|
|
676
690
|
), F();
|
|
677
|
-
let
|
|
678
|
-
se(
|
|
679
|
-
clearTimeout(
|
|
680
|
-
|
|
691
|
+
let D;
|
|
692
|
+
se(M, (t) => {
|
|
693
|
+
clearTimeout(D), D = setTimeout(() => {
|
|
694
|
+
B.replace({ query: { ...l.query, q: t.trim() === "" ? void 0 : t } });
|
|
681
695
|
}, 300);
|
|
682
|
-
}), Se(() => clearTimeout(
|
|
696
|
+
}), Se(() => clearTimeout(D));
|
|
683
697
|
function ue(t) {
|
|
684
|
-
|
|
685
|
-
query: { ...
|
|
698
|
+
B.replace({
|
|
699
|
+
query: { ...l.query, category: typeof t == "number" ? String(t) : void 0 }
|
|
686
700
|
});
|
|
687
701
|
}
|
|
688
|
-
function
|
|
689
|
-
|
|
702
|
+
function L(t) {
|
|
703
|
+
B.push({ path: `${n.base}/${t.id}`, query: { ...l.query } });
|
|
690
704
|
}
|
|
691
|
-
async function
|
|
692
|
-
const t = await
|
|
693
|
-
t &&
|
|
705
|
+
async function z() {
|
|
706
|
+
const t = await O({});
|
|
707
|
+
t && L(t);
|
|
694
708
|
}
|
|
695
709
|
async function de() {
|
|
696
710
|
try {
|
|
@@ -699,7 +713,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
699
713
|
S.danger(T(t, a("panel.reorder-failed"))), await F();
|
|
700
714
|
}
|
|
701
715
|
}
|
|
702
|
-
function
|
|
716
|
+
function ee(t) {
|
|
703
717
|
if (!u.value) return [];
|
|
704
718
|
if (h.value)
|
|
705
719
|
return [
|
|
@@ -713,7 +727,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
713
727
|
}
|
|
714
728
|
];
|
|
715
729
|
const x = [
|
|
716
|
-
{ key: "open", icon: "edit", label: a("panel.open"), run: () =>
|
|
730
|
+
{ key: "open", icon: "edit", label: a("panel.open"), run: () => L(t) }
|
|
717
731
|
];
|
|
718
732
|
return t.url && t.status !== "draft" && x.push({
|
|
719
733
|
key: "site",
|
|
@@ -725,7 +739,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
725
739
|
icon: "copy",
|
|
726
740
|
label: a("panel.copy-address"),
|
|
727
741
|
run: () => {
|
|
728
|
-
|
|
742
|
+
K(t);
|
|
729
743
|
}
|
|
730
744
|
}), x.push(
|
|
731
745
|
t.status === "published" || t.status === "modified" ? {
|
|
@@ -754,7 +768,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
754
768
|
}), x;
|
|
755
769
|
}
|
|
756
770
|
async function ve(t) {
|
|
757
|
-
await
|
|
771
|
+
await Z({
|
|
758
772
|
title: a("panel.delete-title", { title: t.title }),
|
|
759
773
|
message: a("panel.delete-text"),
|
|
760
774
|
confirmText: a("panel.delete"),
|
|
@@ -774,7 +788,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
774
788
|
await F();
|
|
775
789
|
}
|
|
776
790
|
}
|
|
777
|
-
async function
|
|
791
|
+
async function K(t) {
|
|
778
792
|
if (t.url)
|
|
779
793
|
try {
|
|
780
794
|
await navigator.clipboard.writeText(t.url), S.success(a("panel.address-copied"));
|
|
@@ -787,25 +801,25 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
787
801
|
function he(t) {
|
|
788
802
|
return h.value ? "—" : t.path === null ? a("panel.no-address") : `/${t.path}`;
|
|
789
803
|
}
|
|
790
|
-
const
|
|
804
|
+
const G = f(
|
|
791
805
|
() => u.value ? [{ key: "new", label: a("panel.new"), icon: "plus", primary: !0, run: () => {
|
|
792
|
-
|
|
806
|
+
z();
|
|
793
807
|
} }] : []
|
|
794
808
|
);
|
|
795
|
-
return (t, x) => (d(),
|
|
796
|
-
p(e(
|
|
809
|
+
return (t, x) => (d(), N("div", qt, [
|
|
810
|
+
p(e(He), {
|
|
797
811
|
view: m.value,
|
|
798
812
|
"onUpdate:view": x[2] || (x[2] = (v) => m.value = v),
|
|
799
813
|
title: g.value,
|
|
800
|
-
views:
|
|
801
|
-
actions:
|
|
814
|
+
views: U.value,
|
|
815
|
+
actions: G.value,
|
|
802
816
|
padding: "sm"
|
|
803
817
|
}, {
|
|
804
818
|
default: o(() => [
|
|
805
|
-
|
|
819
|
+
E("div", It, [
|
|
806
820
|
p(e(Ie), {
|
|
807
|
-
modelValue:
|
|
808
|
-
"onUpdate:modelValue": x[0] || (x[0] = (v) =>
|
|
821
|
+
modelValue: M.value,
|
|
822
|
+
"onUpdate:modelValue": x[0] || (x[0] = (v) => M.value = v),
|
|
809
823
|
class: "wx-services__search",
|
|
810
824
|
size: "sm",
|
|
811
825
|
clearable: "",
|
|
@@ -820,7 +834,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
820
834
|
]),
|
|
821
835
|
_: 1
|
|
822
836
|
}, 8, ["modelValue", "placeholder", "aria-label"]),
|
|
823
|
-
p(e(
|
|
837
|
+
p(e(ht), {
|
|
824
838
|
class: "wx-services__category",
|
|
825
839
|
"model-value": C.value,
|
|
826
840
|
options: $.value.map((v) => ({ value: v.id, label: v.title })),
|
|
@@ -837,10 +851,10 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
837
851
|
rows: 5
|
|
838
852
|
})) : s.value.length === 0 ? (d(), k(e(qe), {
|
|
839
853
|
key: 1,
|
|
840
|
-
title:
|
|
841
|
-
description: m.value === "" &&
|
|
842
|
-
}, null, 8, ["title", "description"])) : (d(),
|
|
843
|
-
p(e(
|
|
854
|
+
title: Y.value,
|
|
855
|
+
description: m.value === "" && P.value === "" && C.value === null ? e(a)("panel.empty-help") : void 0
|
|
856
|
+
}, null, 8, ["title", "description"])) : (d(), N(X, { key: 2 }, [
|
|
857
|
+
p(e(ft), {
|
|
844
858
|
modelValue: s.value,
|
|
845
859
|
"onUpdate:modelValue": x[1] || (x[1] = (v) => s.value = v),
|
|
846
860
|
class: ye(["wx-services__list", { "is-loading": W.value }]),
|
|
@@ -852,62 +866,62 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
852
866
|
onMove: de
|
|
853
867
|
}, {
|
|
854
868
|
default: o(({ item: v }) => [
|
|
855
|
-
(d(), k(
|
|
869
|
+
(d(), k(Ze(h.value ? "div" : "router-link"), et({ class: "wx-service-row" }, h.value ? {} : { to: { path: `${n.base}/${v.id}`, query: e(l).query } }), {
|
|
856
870
|
default: o(() => [
|
|
857
|
-
|
|
871
|
+
E("span", {
|
|
858
872
|
class: ye(["wx-service-row__cover", { "is-empty": !v.cover }])
|
|
859
873
|
}, [
|
|
860
|
-
v.cover?.thumb ? (d(),
|
|
874
|
+
v.cover?.thumb ? (d(), N("img", {
|
|
861
875
|
key: 0,
|
|
862
876
|
src: v.cover.thumb,
|
|
863
877
|
alt: "",
|
|
864
878
|
loading: "lazy"
|
|
865
|
-
}, null, 8,
|
|
879
|
+
}, null, 8, zt)) : (d(), k(e(xe), {
|
|
866
880
|
key: 1,
|
|
867
881
|
name: "image",
|
|
868
882
|
size: "sm"
|
|
869
883
|
}))
|
|
870
884
|
], 2),
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
885
|
+
E("span", Et, [
|
|
886
|
+
E("span", Nt, w(v.title), 1),
|
|
887
|
+
E("span", Bt, w(he(v)), 1)
|
|
874
888
|
]),
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
(d(!0),
|
|
878
|
-
key:
|
|
889
|
+
E("span", Dt, [
|
|
890
|
+
E("span", Ot, [
|
|
891
|
+
(d(!0), N(X, null, $e(v.categories, (te, fe) => (d(), N(X, {
|
|
892
|
+
key: te.id
|
|
879
893
|
}, [
|
|
880
|
-
fe === 0 ? (d(), k(e(
|
|
894
|
+
fe === 0 ? (d(), k(e(yt), {
|
|
881
895
|
key: 0,
|
|
882
896
|
content: e(a)("panel.main-category")
|
|
883
897
|
}, {
|
|
884
898
|
default: o(() => [
|
|
885
|
-
p(e(
|
|
899
|
+
p(e(j), {
|
|
886
900
|
size: "sm",
|
|
887
901
|
round: "",
|
|
888
902
|
type: "primary"
|
|
889
903
|
}, {
|
|
890
904
|
default: o(() => [
|
|
891
|
-
_(w(
|
|
905
|
+
_(w(te.title), 1)
|
|
892
906
|
]),
|
|
893
907
|
_: 2
|
|
894
908
|
}, 1024)
|
|
895
909
|
]),
|
|
896
910
|
_: 2
|
|
897
|
-
}, 1032, ["content"])) : (d(), k(e(
|
|
911
|
+
}, 1032, ["content"])) : (d(), k(e(j), {
|
|
898
912
|
key: 1,
|
|
899
913
|
size: "sm",
|
|
900
914
|
round: ""
|
|
901
915
|
}, {
|
|
902
916
|
default: o(() => [
|
|
903
|
-
_(w(
|
|
917
|
+
_(w(te.title), 1)
|
|
904
918
|
]),
|
|
905
919
|
_: 2
|
|
906
920
|
}, 1024))
|
|
907
921
|
], 64))), 128))
|
|
908
922
|
]),
|
|
909
|
-
|
|
910
|
-
p(e(
|
|
923
|
+
E("span", Pt, [
|
|
924
|
+
p(e(j), {
|
|
911
925
|
type: pe(v.status),
|
|
912
926
|
dot: "",
|
|
913
927
|
size: "sm"
|
|
@@ -917,7 +931,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
917
931
|
]),
|
|
918
932
|
_: 2
|
|
919
933
|
}, 1032, ["type"]),
|
|
920
|
-
v.status === "modified" ? (d(), k(e(
|
|
934
|
+
v.status === "modified" ? (d(), k(e(j), {
|
|
921
935
|
key: 0,
|
|
922
936
|
type: "primary",
|
|
923
937
|
size: "sm",
|
|
@@ -927,7 +941,7 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
927
941
|
_(w(e(a)("panel.edits")), 1)
|
|
928
942
|
]),
|
|
929
943
|
_: 1
|
|
930
|
-
})) :
|
|
944
|
+
})) : R("", !0)
|
|
931
945
|
])
|
|
932
946
|
])
|
|
933
947
|
]),
|
|
@@ -935,8 +949,8 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
935
949
|
}, 1040))
|
|
936
950
|
]),
|
|
937
951
|
actions: o(({ item: v }) => [
|
|
938
|
-
p(e(
|
|
939
|
-
actions:
|
|
952
|
+
p(e(Fe), {
|
|
953
|
+
actions: ee(v),
|
|
940
954
|
label: v.title
|
|
941
955
|
}, null, 8, ["actions", "label"])
|
|
942
956
|
]),
|
|
@@ -947,15 +961,15 @@ const mt = { class: "wx-service-editor__screen" }, bt = 1200, wt = /* @__PURE__
|
|
|
947
961
|
class: "wx-services__note",
|
|
948
962
|
type: "info",
|
|
949
963
|
description: e(H).hint.value
|
|
950
|
-
}, null, 8, ["description"])) :
|
|
964
|
+
}, null, 8, ["description"])) : R("", !0)
|
|
951
965
|
], 64))
|
|
952
966
|
]),
|
|
953
967
|
_: 1
|
|
954
968
|
}, 8, ["view", "title", "views", "actions"])
|
|
955
969
|
]));
|
|
956
970
|
}
|
|
957
|
-
}),
|
|
958
|
-
function
|
|
971
|
+
}), Mt = /* @__PURE__ */ be(At, [["__scopeId", "data-v-f99d37d6"]]);
|
|
972
|
+
function Lt(c = "/services") {
|
|
959
973
|
return {
|
|
960
974
|
api: "services/categories",
|
|
961
975
|
path: `${c}/categories`,
|
|
@@ -985,18 +999,18 @@ function At(c = "/services") {
|
|
|
985
999
|
}
|
|
986
1000
|
};
|
|
987
1001
|
}
|
|
988
|
-
function
|
|
1002
|
+
function Gt(c = {}) {
|
|
989
1003
|
const n = c.path ?? "/services";
|
|
990
1004
|
return [
|
|
991
1005
|
{
|
|
992
1006
|
id: "services",
|
|
993
1007
|
path: n,
|
|
994
1008
|
routes: [
|
|
995
|
-
{ path: n, name: "webx.services", component:
|
|
1009
|
+
{ path: n, name: "webx.services", component: Mt, props: { base: n } },
|
|
996
1010
|
{
|
|
997
1011
|
path: `${n}/:id(\\d+)`,
|
|
998
1012
|
name: "webx.services.edit",
|
|
999
|
-
component:
|
|
1013
|
+
component: kt,
|
|
1000
1014
|
props: { base: n }
|
|
1001
1015
|
}
|
|
1002
1016
|
],
|
|
@@ -1006,28 +1020,28 @@ function Ft(c = {}) {
|
|
|
1006
1020
|
* particular is shared, and reads the prefix from the editor hosting the screen.
|
|
1007
1021
|
*/
|
|
1008
1022
|
types: {
|
|
1009
|
-
"wx-service-history": { component:
|
|
1023
|
+
"wx-service-history": { component: Ct, kind: "display" }
|
|
1010
1024
|
}
|
|
1011
1025
|
},
|
|
1012
1026
|
{
|
|
1013
1027
|
id: "service-categories",
|
|
1014
1028
|
path: `${n}/categories`,
|
|
1015
|
-
routes:
|
|
1029
|
+
routes: Ke(Lt(n))
|
|
1016
1030
|
}
|
|
1017
1031
|
];
|
|
1018
1032
|
}
|
|
1019
1033
|
export {
|
|
1020
1034
|
ge as SERVICES_API,
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1035
|
+
Vt as WxServiceCreateDialog,
|
|
1036
|
+
kt as WxServiceEditorPage,
|
|
1037
|
+
Ct as WxServiceHistory,
|
|
1038
|
+
Mt as WxServicesPage,
|
|
1025
1039
|
oe as createServicesApi,
|
|
1026
|
-
|
|
1027
|
-
|
|
1040
|
+
gt as provideServiceEditor,
|
|
1041
|
+
Lt as serviceCategoriesOptions,
|
|
1028
1042
|
ze as serviceEditorKey,
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1043
|
+
Gt as services,
|
|
1044
|
+
bt as servicesMessages,
|
|
1045
|
+
mt as useServiceEditor
|
|
1032
1046
|
};
|
|
1033
1047
|
//# sourceMappingURL=index.js.map
|