@webx-ui/module-vacancies 0.1.7 → 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 +517 -484
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +4 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { reorderItems as Ke, useAdmin as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useRoute as
|
|
4
|
-
import { useModal as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
1
|
+
import { reorderItems as Ke, useAdmin as ce, useTranslate as oe, useErrorText as Ve, WxListScreen as je, WxFilterChips as Ye, WxRowMenu as Ge, WxAddressNote as Je, useDates as Qe, provideRelationOwner as Xe, provideRecordAddress as Ze, WxScreenHead as et, WxScreen as tt, WxSaveState as at, WxDate as nt, categoryRoutes as lt } from "@webx-ui/module-admin";
|
|
2
|
+
import { defineComponent as pe, ref as W, useTemplateRef as st, onMounted as Ee, nextTick as it, openBlock as y, createBlock as $, unref as e, isRef as ot, withCtx as i, createVNode as p, createElementVNode as A, withKeys as rt, createTextVNode as x, toDisplayString as g, computed as h, watch as re, onBeforeUnmount as Oe, createElementBlock as z, createCommentVNode as R, Fragment as ne, normalizeClass as De, resolveDynamicComponent as ct, mergeProps as ut, renderList as Ae, provide as dt, inject as pt } from "vue";
|
|
3
|
+
import { useRoute as Pe, useRouter as ze, onBeforeRouteLeave as vt } from "vue-router";
|
|
4
|
+
import { useModal as ht, WxDialog as yt, WxFormItem as $e, WxInput as Me, WxSpace as ft, WxButton as K, createModal as mt, WxIcon as ie, WxPopover as gt, WxSelect as Ie, WxIndicator as bt, WxAction as wt, WxSkeleton as de, WxEmpty as Le, WxSortableList as _t, WxTooltip as Ne, WxBadge as J, WxAlert as Fe, toast as _, confirm as j, useLocales as xt, localizedValue as kt, WxCard as Tt, WxBreadcrumb as $t, WxBreadcrumbItem as Re, WxActionBar as Vt, WxText as Wt } from "@webx-ui/core";
|
|
5
|
+
const Se = "vacancies";
|
|
6
|
+
function ve(c) {
|
|
7
|
+
const u = `${c.apiPath}/${Se}`, f = (n) => n.data, v = (n, m) => c.http.post(`${u}/${n}/${m}`, {}).then(f);
|
|
8
8
|
return {
|
|
9
9
|
list: (n = {}) => {
|
|
10
10
|
const m = new URLSearchParams();
|
|
11
|
-
return n.trashed ? m.set("trashed", "1") : m.set("state", n.state ?? "open"), n.q && m.set("q", n.q), n.category != null && m.set("category", String(n.category)), n.status && m.set("status", n.status),
|
|
11
|
+
return n.trashed ? m.set("trashed", "1") : m.set("state", n.state ?? "open"), n.q && m.set("q", n.q), n.category != null && m.set("category", String(n.category)), n.status && m.set("status", n.status), c.http.get(`${u}?${m}`);
|
|
12
12
|
},
|
|
13
|
-
get: (n) =>
|
|
14
|
-
create: (n) =>
|
|
15
|
-
save: (n, m) =>
|
|
16
|
-
discard: (n) =>
|
|
17
|
-
duplicate: (n) =>
|
|
18
|
-
publish: (n) =>
|
|
19
|
-
unpublish: (n) =>
|
|
20
|
-
close: (n) =>
|
|
21
|
-
reopen: (n) =>
|
|
22
|
-
remove: (n) =>
|
|
13
|
+
get: (n) => c.http.get(`${u}/${n}`).then(f),
|
|
14
|
+
create: (n) => c.http.post(u, n).then(f),
|
|
15
|
+
save: (n, m) => c.http.put(`${u}/${n}`, m).then(f),
|
|
16
|
+
discard: (n) => c.http.post(`${u}/${n}/discard`, {}).then(f),
|
|
17
|
+
duplicate: (n) => c.http.post(`${u}/${n}/duplicate`, {}).then(f),
|
|
18
|
+
publish: (n) => v(n, "publish"),
|
|
19
|
+
unpublish: (n) => v(n, "unpublish"),
|
|
20
|
+
close: (n) => v(n, "close"),
|
|
21
|
+
reopen: (n) => v(n, "reopen"),
|
|
22
|
+
remove: (n) => c.http.delete(`${u}/${n}`).then(() => {
|
|
23
23
|
}),
|
|
24
|
-
restore: (n) =>
|
|
24
|
+
restore: (n) => v(n, "restore"),
|
|
25
25
|
// No `category`, ever: vacancies have one order (§4.11), unlike services.
|
|
26
|
-
reorder: (n) => Ke(
|
|
27
|
-
versions: (n) =>
|
|
28
|
-
restoreVersion: (n, m) =>
|
|
26
|
+
reorder: (n) => Ke(c, Se, n, null),
|
|
27
|
+
versions: (n) => c.http.get(`${u}/${n}/versions`).then(f),
|
|
28
|
+
restoreVersion: (n, m) => c.http.post(`${u}/${n}/versions/${m}/restore`, {}).then(f)
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const [,
|
|
31
|
+
const Ct = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
32
|
+
function Ue(c) {
|
|
33
|
+
const u = typeof c == "string" ? Ct.exec(c.slice(0, 10)) : null;
|
|
34
|
+
if (u === null) return null;
|
|
35
|
+
const [, f, v, n] = u, m = new Date(Number(f), Number(v) - 1, Number(n));
|
|
36
36
|
return Number.isNaN(m.getTime()) ? null : m;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
function It(c, u, f = /* @__PURE__ */ new Date()) {
|
|
39
|
+
const v = Ue(c);
|
|
40
|
+
return v === null ? "" : new Intl.DateTimeFormat(u, {
|
|
41
41
|
day: "numeric",
|
|
42
42
|
month: "short",
|
|
43
|
-
...
|
|
44
|
-
}).format(
|
|
43
|
+
...v.getFullYear() === f.getFullYear() ? {} : { year: "numeric" }
|
|
44
|
+
}).format(v);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
46
|
+
function Be(c, u) {
|
|
47
|
+
const f = Ue(c);
|
|
48
|
+
return f === null ? "" : new Intl.DateTimeFormat(u, { day: "numeric", month: "long", year: "numeric" }).format(f);
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const Nt = {
|
|
51
51
|
module: {
|
|
52
52
|
group: "Vacancies",
|
|
53
53
|
vacancies: "Vacancies",
|
|
@@ -130,8 +130,6 @@ const It = {
|
|
|
130
130
|
"publish-nowhere": "It has no address in this language yet, so nothing will answer.",
|
|
131
131
|
preview: "Preview",
|
|
132
132
|
discard: "Discard changes",
|
|
133
|
-
"discard-title": "Discard what is waiting?",
|
|
134
|
-
"discard-text": "The vacancy goes back to what the site is showing. What was written since is not listed anywhere.",
|
|
135
133
|
discarded: "The vacancy is back to what is published.",
|
|
136
134
|
"conflict-title": "The vacancy changed while you were editing",
|
|
137
135
|
"conflict-mine": "Keep mine",
|
|
@@ -190,64 +188,64 @@ const It = {
|
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
};
|
|
193
|
-
function
|
|
194
|
-
return `vacancy.employment.${
|
|
191
|
+
function Rt(c) {
|
|
192
|
+
return `vacancy.employment.${c}`;
|
|
195
193
|
}
|
|
196
|
-
const
|
|
197
|
-
function
|
|
194
|
+
const qe = /* @__PURE__ */ new WeakSet();
|
|
195
|
+
function he() {
|
|
198
196
|
try {
|
|
199
|
-
const { i18n:
|
|
200
|
-
|
|
197
|
+
const { i18n: c } = ce();
|
|
198
|
+
qe.has(c) || (c.defaults("webx-vacancies", Nt), qe.add(c));
|
|
201
199
|
} catch {
|
|
202
200
|
}
|
|
203
201
|
}
|
|
204
|
-
const
|
|
202
|
+
const St = /* @__PURE__ */ pe({
|
|
205
203
|
__name: "VacancyCreateDialog",
|
|
206
|
-
setup(
|
|
207
|
-
const { open:
|
|
208
|
-
|
|
209
|
-
const a =
|
|
210
|
-
|
|
211
|
-
await
|
|
204
|
+
setup(c) {
|
|
205
|
+
const { open: u, resolve: f, dismiss: v } = ht(), n = ce(), m = ve(n);
|
|
206
|
+
he();
|
|
207
|
+
const a = oe("webx-vacancies"), I = W(""), l = W(!1), k = W({}), C = st("field");
|
|
208
|
+
Ee(async () => {
|
|
209
|
+
await it(), C.value?.querySelector("input")?.focus();
|
|
212
210
|
});
|
|
213
|
-
async function
|
|
214
|
-
if (!(
|
|
215
|
-
l.value = !0,
|
|
211
|
+
async function F() {
|
|
212
|
+
if (!(I.value.trim() === "" || l.value)) {
|
|
213
|
+
l.value = !0, k.value = {};
|
|
216
214
|
try {
|
|
217
|
-
|
|
218
|
-
} catch (
|
|
219
|
-
|
|
215
|
+
f((await m.create({ title: I.value.trim() })).vacancy);
|
|
216
|
+
} catch (q) {
|
|
217
|
+
k.value = q.body?.errors ?? {};
|
|
220
218
|
} finally {
|
|
221
219
|
l.value = !1;
|
|
222
220
|
}
|
|
223
221
|
}
|
|
224
222
|
}
|
|
225
|
-
return (
|
|
226
|
-
open: e(
|
|
227
|
-
"onUpdate:open":
|
|
223
|
+
return (q, o) => (y(), $(e(yt), {
|
|
224
|
+
open: e(u),
|
|
225
|
+
"onUpdate:open": o[2] || (o[2] = (T) => ot(u) ? u.value = T : null),
|
|
228
226
|
title: e(a)("panel.new-title"),
|
|
229
227
|
width: 440
|
|
230
228
|
}, {
|
|
231
229
|
footer: i(() => [
|
|
232
|
-
|
|
230
|
+
p(e(ft), { size: "sm" }, {
|
|
233
231
|
default: i(() => [
|
|
234
|
-
|
|
232
|
+
p(e(K), {
|
|
235
233
|
variant: "outline",
|
|
236
|
-
onClick:
|
|
234
|
+
onClick: o[1] || (o[1] = (T) => e(v)())
|
|
237
235
|
}, {
|
|
238
236
|
default: i(() => [
|
|
239
|
-
|
|
237
|
+
x(g(e(a)("panel.cancel")), 1)
|
|
240
238
|
]),
|
|
241
239
|
_: 1
|
|
242
240
|
}),
|
|
243
|
-
|
|
241
|
+
p(e(K), {
|
|
244
242
|
type: "primary",
|
|
245
243
|
loading: l.value,
|
|
246
|
-
disabled:
|
|
247
|
-
onClick:
|
|
244
|
+
disabled: I.value.trim() === "",
|
|
245
|
+
onClick: F
|
|
248
246
|
}, {
|
|
249
247
|
default: i(() => [
|
|
250
|
-
|
|
248
|
+
x(g(e(a)("panel.create")), 1)
|
|
251
249
|
]),
|
|
252
250
|
_: 1
|
|
253
251
|
}, 8, ["loading", "disabled"])
|
|
@@ -256,21 +254,21 @@ const Rt = /* @__PURE__ */ de({
|
|
|
256
254
|
})
|
|
257
255
|
]),
|
|
258
256
|
default: i(() => [
|
|
259
|
-
|
|
257
|
+
p(e($e), {
|
|
260
258
|
label: e(a)("panel.field-title"),
|
|
261
|
-
error:
|
|
259
|
+
error: k.value.title?.[0] ?? k.value.slug?.[0],
|
|
262
260
|
required: ""
|
|
263
261
|
}, {
|
|
264
262
|
default: i(() => [
|
|
265
|
-
|
|
263
|
+
A("div", {
|
|
266
264
|
ref_key: "field",
|
|
267
|
-
ref:
|
|
265
|
+
ref: C
|
|
268
266
|
}, [
|
|
269
|
-
|
|
270
|
-
modelValue:
|
|
271
|
-
"onUpdate:modelValue":
|
|
267
|
+
p(e(Me), {
|
|
268
|
+
modelValue: I.value,
|
|
269
|
+
"onUpdate:modelValue": o[0] || (o[0] = (T) => I.value = T),
|
|
272
270
|
"aria-label": e(a)("panel.field-title"),
|
|
273
|
-
onKeyup:
|
|
271
|
+
onKeyup: rt(F, ["enter"])
|
|
274
272
|
}, null, 8, ["modelValue", "aria-label"])
|
|
275
273
|
], 512)
|
|
276
274
|
]),
|
|
@@ -280,128 +278,128 @@ const Rt = /* @__PURE__ */ de({
|
|
|
280
278
|
_: 1
|
|
281
279
|
}, 8, ["open", "title"]));
|
|
282
280
|
}
|
|
283
|
-
}),
|
|
281
|
+
}), qt = { class: "wx-vacancies" }, Et = { class: "wx-vacancies__bar" }, Ot = { class: "wx-vacancies__filters" }, Dt = {
|
|
284
282
|
key: 0,
|
|
285
283
|
class: "wx-vacancies__applied"
|
|
286
|
-
},
|
|
284
|
+
}, At = { class: "wx-vacancy-row__name" }, Pt = { class: "wx-vacancy-row__title" }, zt = { class: "wx-vacancy-row__address" }, Mt = { class: "wx-vacancy-row__facts" }, Lt = { class: "wx-vacancy-row__where" }, Ft = {
|
|
287
285
|
key: 0,
|
|
288
286
|
class: "wx-vacancy-row__employment"
|
|
289
|
-
},
|
|
287
|
+
}, Ut = { class: "wx-vacancy-row__until" }, Bt = { class: "wx-vacancy-row__state" }, Ht = /* @__PURE__ */ pe({
|
|
290
288
|
__name: "VacanciesPage",
|
|
291
289
|
props: {
|
|
292
290
|
base: { default: "/vacancies" }
|
|
293
291
|
},
|
|
294
|
-
setup(
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
const a =
|
|
298
|
-
() =>
|
|
299
|
-
),
|
|
292
|
+
setup(c) {
|
|
293
|
+
const u = c, f = ce(), v = ve(f), n = Pe(), m = ze();
|
|
294
|
+
he();
|
|
295
|
+
const a = oe("webx-vacancies"), I = Ve(), l = W([]), k = W({ categories: [] }), C = W(!0), F = mt(St), q = h(() => f.can("vacancies.manage")), o = h(
|
|
296
|
+
() => f.state.manifest?.modules.find((t) => t.id === "vacancies")?.title ?? a("module.vacancies")
|
|
297
|
+
), T = h(() => f.i18n.state.locale), b = h({
|
|
300
298
|
get: () => typeof n.query.view == "string" ? n.query.view : "",
|
|
301
299
|
set: (t) => {
|
|
302
300
|
m.replace({
|
|
303
301
|
query: { ...n.query, view: t === "" ? void 0 : String(t) }
|
|
304
302
|
});
|
|
305
303
|
}
|
|
306
|
-
}),
|
|
304
|
+
}), V = h(() => b.value === "trashed"), M = h(() => b.value === "closed" ? "closed" : b.value === "all" ? "all" : "open"), U = h(() => {
|
|
307
305
|
const t = n.query.category;
|
|
308
306
|
return typeof t == "string" && t !== "" && Number(t) || null;
|
|
309
|
-
}),
|
|
307
|
+
}), E = h(
|
|
310
308
|
() => typeof n.query.status == "string" ? n.query.status : ""
|
|
311
|
-
),
|
|
309
|
+
), N = h(() => typeof n.query.q == "string" ? n.query.q : ""), Q = W(N.value), D = h(() => [
|
|
312
310
|
{ value: "", label: a("panel.view-open") },
|
|
313
311
|
{ value: "closed", label: a("panel.view-closed") },
|
|
314
312
|
{ value: "all", label: a("panel.view-all") },
|
|
315
313
|
{ value: "trashed", label: a("panel.bin"), icon: "trash" }
|
|
316
|
-
]),
|
|
314
|
+
]), te = h(
|
|
317
315
|
() => ["published", "draft", "unpublished"].map((t) => ({
|
|
318
316
|
value: t,
|
|
319
317
|
label: a(`panel.status-${t}`)
|
|
320
318
|
}))
|
|
321
|
-
),
|
|
322
|
-
() =>
|
|
323
|
-
),
|
|
319
|
+
), P = h(
|
|
320
|
+
() => N.value.trim() === "" && U.value === null && E.value === ""
|
|
321
|
+
), ue = h(() => M.value !== "closed" && !V.value), X = h(() => q.value && ue.value && P.value), O = h(() => ue.value ? a(P.value ? "panel.order-all" : "panel.order-locked") : a("panel.order-closed")), ye = h(() => N.value !== "" ? a("panel.empty-search") : V.value ? a("panel.empty-bin") : M.value === "closed" ? a("panel.empty-closed") : M.value === "all" ? a("panel.empty") : a("panel.empty-open")), B = h(() => {
|
|
324
322
|
const t = [];
|
|
325
|
-
|
|
323
|
+
E.value !== "" && t.push({
|
|
326
324
|
key: "status",
|
|
327
|
-
label: `${a("panel.filter-status")}: ${a(`panel.status-${
|
|
325
|
+
label: `${a("panel.filter-status")}: ${a(`panel.status-${E.value}`)}`,
|
|
328
326
|
clear: () => L("status", void 0)
|
|
329
327
|
});
|
|
330
|
-
const
|
|
331
|
-
return
|
|
328
|
+
const d = k.value.categories.find((r) => r.id === U.value);
|
|
329
|
+
return d && t.push({
|
|
332
330
|
key: "category",
|
|
333
|
-
label: `${a("panel.filter-category")}: ${
|
|
331
|
+
label: `${a("panel.filter-category")}: ${d.title}`,
|
|
334
332
|
clear: () => L("category", void 0)
|
|
335
333
|
}), t;
|
|
336
334
|
});
|
|
337
|
-
async function
|
|
338
|
-
|
|
335
|
+
async function Z() {
|
|
336
|
+
C.value = !0;
|
|
339
337
|
try {
|
|
340
|
-
const t = await
|
|
338
|
+
const t = await v.list({
|
|
341
339
|
state: M.value,
|
|
342
|
-
q:
|
|
343
|
-
category:
|
|
344
|
-
status:
|
|
345
|
-
trashed:
|
|
340
|
+
q: N.value,
|
|
341
|
+
category: U.value,
|
|
342
|
+
status: V.value ? "" : E.value,
|
|
343
|
+
trashed: V.value
|
|
346
344
|
});
|
|
347
|
-
l.value = t.data,
|
|
345
|
+
l.value = t.data, k.value = t.filters;
|
|
348
346
|
} catch (t) {
|
|
349
|
-
_.danger(
|
|
347
|
+
_.danger(I(t));
|
|
350
348
|
} finally {
|
|
351
|
-
|
|
349
|
+
C.value = !1;
|
|
352
350
|
}
|
|
353
351
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}),
|
|
357
|
-
let
|
|
358
|
-
|
|
359
|
-
clearTimeout(
|
|
352
|
+
re([b, U, E, N], () => {
|
|
353
|
+
Z();
|
|
354
|
+
}), Z();
|
|
355
|
+
let ae;
|
|
356
|
+
re(Q, (t) => {
|
|
357
|
+
clearTimeout(ae), ae = setTimeout(() => {
|
|
360
358
|
m.replace({ query: { ...n.query, q: t.trim() === "" ? void 0 : t } });
|
|
361
359
|
}, 300);
|
|
362
|
-
}),
|
|
363
|
-
function L(t,
|
|
360
|
+
}), Oe(() => clearTimeout(ae));
|
|
361
|
+
function L(t, d) {
|
|
364
362
|
m.replace({
|
|
365
363
|
query: {
|
|
366
364
|
...n.query,
|
|
367
|
-
[t]: typeof
|
|
365
|
+
[t]: typeof d == "number" || typeof d == "string" && d !== "" ? String(d) : void 0
|
|
368
366
|
}
|
|
369
367
|
});
|
|
370
368
|
}
|
|
371
|
-
function
|
|
369
|
+
function ee() {
|
|
372
370
|
const t = { ...n.query };
|
|
373
371
|
delete t.category, delete t.status, m.replace({ query: t });
|
|
374
372
|
}
|
|
375
|
-
function
|
|
376
|
-
m.push({ path: `${
|
|
377
|
-
}
|
|
378
|
-
async function H() {
|
|
379
|
-
const t = await A({});
|
|
380
|
-
t && ne(t);
|
|
373
|
+
function le(t) {
|
|
374
|
+
m.push({ path: `${u.base}/${t.id}`, query: { ...n.query } });
|
|
381
375
|
}
|
|
382
376
|
async function fe() {
|
|
377
|
+
const t = await F({});
|
|
378
|
+
t && le(t);
|
|
379
|
+
}
|
|
380
|
+
async function H() {
|
|
383
381
|
try {
|
|
384
|
-
await
|
|
382
|
+
await v.reorder(l.value.map((t) => t.id));
|
|
385
383
|
} catch (t) {
|
|
386
|
-
_.danger(
|
|
384
|
+
_.danger(I(t, a("panel.reorder-failed"))), await Z();
|
|
387
385
|
}
|
|
388
386
|
}
|
|
389
|
-
const
|
|
387
|
+
const se = (t) => t.status === "published" || t.status === "modified";
|
|
390
388
|
function me(t) {
|
|
391
|
-
if (!
|
|
392
|
-
if (
|
|
389
|
+
if (!q.value) return [];
|
|
390
|
+
if (V.value)
|
|
393
391
|
return [
|
|
394
392
|
{
|
|
395
393
|
key: "restore",
|
|
396
394
|
icon: "refresh",
|
|
397
395
|
label: a("panel.restore"),
|
|
398
396
|
run: () => {
|
|
399
|
-
|
|
397
|
+
xe(t);
|
|
400
398
|
}
|
|
401
399
|
}
|
|
402
400
|
];
|
|
403
|
-
const
|
|
404
|
-
{ key: "open", icon: "edit", label: a("panel.open"), run: () =>
|
|
401
|
+
const d = [
|
|
402
|
+
{ key: "open", icon: "edit", label: a("panel.open"), run: () => le(t) },
|
|
405
403
|
{
|
|
406
404
|
key: "duplicate",
|
|
407
405
|
icon: "copy",
|
|
@@ -411,147 +409,147 @@ const Rt = /* @__PURE__ */ de({
|
|
|
411
409
|
}
|
|
412
410
|
}
|
|
413
411
|
];
|
|
414
|
-
return t.url && t.status !== "draft" &&
|
|
412
|
+
return t.url && t.status !== "draft" && d.push({
|
|
415
413
|
key: "site",
|
|
416
414
|
icon: "external-link",
|
|
417
415
|
label: a("panel.open-on-site"),
|
|
418
416
|
href: t.url
|
|
419
|
-
}),
|
|
417
|
+
}), se(t) && t.closed_reason === "manual" ? d.push({
|
|
420
418
|
key: "reopen",
|
|
421
419
|
icon: "refresh",
|
|
422
420
|
label: a("panel.reopen"),
|
|
423
421
|
run: () => {
|
|
424
|
-
|
|
422
|
+
we(t);
|
|
425
423
|
}
|
|
426
|
-
}) :
|
|
424
|
+
}) : se(t) && t.closed_reason === null && d.push({
|
|
427
425
|
key: "close",
|
|
428
426
|
icon: "lock",
|
|
429
427
|
label: a("panel.close"),
|
|
430
428
|
run: () => {
|
|
431
|
-
|
|
429
|
+
be(t);
|
|
432
430
|
}
|
|
433
|
-
}),
|
|
434
|
-
|
|
431
|
+
}), d.push(
|
|
432
|
+
se(t) ? {
|
|
435
433
|
key: "unpublish",
|
|
436
434
|
icon: "eye-off",
|
|
437
435
|
label: a("panel.unpublish"),
|
|
438
436
|
run: () => {
|
|
439
|
-
|
|
437
|
+
Y(() => v.unpublish(t.id), a("panel.unpublished-done"));
|
|
440
438
|
}
|
|
441
439
|
} : {
|
|
442
440
|
key: "publish",
|
|
443
441
|
icon: "upload",
|
|
444
442
|
label: a("panel.publish"),
|
|
445
443
|
run: () => {
|
|
446
|
-
|
|
444
|
+
Y(() => v.publish(t.id), a("panel.published"));
|
|
447
445
|
}
|
|
448
446
|
}
|
|
449
|
-
),
|
|
447
|
+
), d.push({
|
|
450
448
|
key: "delete",
|
|
451
449
|
icon: "trash",
|
|
452
450
|
label: a("panel.delete"),
|
|
453
451
|
danger: !0,
|
|
454
452
|
run: () => {
|
|
455
|
-
|
|
453
|
+
_e(t);
|
|
456
454
|
}
|
|
457
|
-
}),
|
|
455
|
+
}), d;
|
|
458
456
|
}
|
|
459
457
|
async function ge(t) {
|
|
460
458
|
try {
|
|
461
|
-
const
|
|
462
|
-
_.success(a("panel.duplicated")),
|
|
463
|
-
} catch (
|
|
464
|
-
_.danger(
|
|
459
|
+
const d = await v.duplicate(t.id);
|
|
460
|
+
_.success(a("panel.duplicated")), le(d.vacancy);
|
|
461
|
+
} catch (d) {
|
|
462
|
+
_.danger(I(d));
|
|
465
463
|
}
|
|
466
464
|
}
|
|
467
|
-
async function
|
|
465
|
+
async function be(t) {
|
|
468
466
|
if (t.status === "modified") {
|
|
469
467
|
_.warning(a("panel.close-edits"));
|
|
470
468
|
return;
|
|
471
469
|
}
|
|
472
|
-
await
|
|
470
|
+
await j({
|
|
473
471
|
title: a("panel.close-title", { title: t.title }),
|
|
474
472
|
message: a("panel.close-text"),
|
|
475
473
|
confirmText: a("panel.close"),
|
|
476
474
|
cancelText: a("panel.cancel")
|
|
477
|
-
}) && await
|
|
475
|
+
}) && await Y(() => v.close(t.id), a("panel.closed"));
|
|
478
476
|
}
|
|
479
|
-
async function
|
|
477
|
+
async function we(t) {
|
|
480
478
|
if (t.status === "modified") {
|
|
481
479
|
_.warning(a("panel.close-edits"));
|
|
482
480
|
return;
|
|
483
481
|
}
|
|
484
|
-
if (await
|
|
482
|
+
if (await j({
|
|
485
483
|
title: a("panel.reopen-title", { title: t.title }),
|
|
486
484
|
message: a("panel.reopen-text"),
|
|
487
485
|
confirmText: a("panel.reopen"),
|
|
488
486
|
cancelText: a("panel.cancel")
|
|
489
487
|
}))
|
|
490
488
|
try {
|
|
491
|
-
(await
|
|
492
|
-
} catch (
|
|
493
|
-
_.danger(
|
|
489
|
+
(await v.reopen(t.id)).closed ? _.warning(a("panel.reopen-expired")) : _.success(a("panel.reopened"));
|
|
490
|
+
} catch (r) {
|
|
491
|
+
_.danger(I(r));
|
|
494
492
|
} finally {
|
|
495
|
-
await
|
|
493
|
+
await Z();
|
|
496
494
|
}
|
|
497
495
|
}
|
|
498
|
-
async function
|
|
499
|
-
await
|
|
496
|
+
async function _e(t) {
|
|
497
|
+
await j({
|
|
500
498
|
title: a("panel.delete-title", { title: t.title }),
|
|
501
499
|
message: a("panel.delete-text"),
|
|
502
500
|
confirmText: a("panel.delete"),
|
|
503
501
|
cancelText: a("panel.cancel"),
|
|
504
502
|
tone: "danger"
|
|
505
|
-
}) && await
|
|
503
|
+
}) && await Y(() => v.remove(t.id), a("panel.deleted"));
|
|
506
504
|
}
|
|
507
|
-
async function
|
|
508
|
-
await
|
|
505
|
+
async function xe(t) {
|
|
506
|
+
await Y(() => v.restore(t.id), a("panel.restored"));
|
|
509
507
|
}
|
|
510
|
-
async function
|
|
508
|
+
async function Y(t, d) {
|
|
511
509
|
try {
|
|
512
|
-
await t(), _.success(
|
|
513
|
-
} catch (
|
|
514
|
-
_.danger(
|
|
510
|
+
await t(), _.success(d);
|
|
511
|
+
} catch (r) {
|
|
512
|
+
_.danger(I(r));
|
|
515
513
|
} finally {
|
|
516
|
-
await
|
|
514
|
+
await Z();
|
|
517
515
|
}
|
|
518
516
|
}
|
|
519
|
-
function
|
|
517
|
+
function ke(t) {
|
|
520
518
|
return t === "published" || t === "modified" ? "success" : "default";
|
|
521
519
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
520
|
+
function s(t) {
|
|
521
|
+
return V.value ? "—" : t.path === null ? a("panel.no-address") : `/${t.path}`;
|
|
524
522
|
}
|
|
525
|
-
function
|
|
523
|
+
function w(t) {
|
|
526
524
|
if (t.workplace === "remote") return a("vacancy.workplace.remote");
|
|
527
|
-
const
|
|
528
|
-
return t.workplace === "hybrid" ? `${
|
|
525
|
+
const d = t.city !== "" ? t.city : a("panel.no-city");
|
|
526
|
+
return t.workplace === "hybrid" ? `${d} · ${a("vacancy.workplace.hybrid")}` : d;
|
|
529
527
|
}
|
|
530
|
-
function
|
|
531
|
-
return t.employment_types.map((
|
|
528
|
+
function S(t) {
|
|
529
|
+
return t.employment_types.map((d) => a(Rt(d))).join(", ");
|
|
532
530
|
}
|
|
533
|
-
function
|
|
534
|
-
return t.closed && M.value === "all" && !
|
|
531
|
+
function G(t) {
|
|
532
|
+
return t.closed && M.value === "all" && !V.value;
|
|
535
533
|
}
|
|
536
|
-
const
|
|
537
|
-
() =>
|
|
538
|
-
|
|
534
|
+
const Te = h(
|
|
535
|
+
() => q.value ? [{ key: "new", label: a("panel.new"), icon: "plus", primary: !0, run: () => {
|
|
536
|
+
fe();
|
|
539
537
|
} }] : []
|
|
540
538
|
);
|
|
541
|
-
return (t,
|
|
542
|
-
|
|
539
|
+
return (t, d) => (y(), z("div", qt, [
|
|
540
|
+
p(e(je), {
|
|
543
541
|
view: b.value,
|
|
544
|
-
"onUpdate:view":
|
|
545
|
-
title:
|
|
546
|
-
views:
|
|
547
|
-
actions:
|
|
542
|
+
"onUpdate:view": d[4] || (d[4] = (r) => b.value = r),
|
|
543
|
+
title: o.value,
|
|
544
|
+
views: D.value,
|
|
545
|
+
actions: Te.value,
|
|
548
546
|
padding: "sm"
|
|
549
547
|
}, {
|
|
550
548
|
default: i(() => [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
modelValue:
|
|
554
|
-
"onUpdate:modelValue":
|
|
549
|
+
A("div", Et, [
|
|
550
|
+
p(e(Me), {
|
|
551
|
+
modelValue: Q.value,
|
|
552
|
+
"onUpdate:modelValue": d[0] || (d[0] = (r) => Q.value = r),
|
|
555
553
|
class: "wx-vacancies__search",
|
|
556
554
|
size: "sm",
|
|
557
555
|
clearable: "",
|
|
@@ -559,29 +557,29 @@ const Rt = /* @__PURE__ */ de({
|
|
|
559
557
|
"aria-label": e(a)("panel.search")
|
|
560
558
|
}, {
|
|
561
559
|
prefix: i(() => [
|
|
562
|
-
|
|
560
|
+
p(e(ie), {
|
|
563
561
|
name: "search",
|
|
564
562
|
size: "sm"
|
|
565
563
|
})
|
|
566
564
|
]),
|
|
567
565
|
_: 1
|
|
568
566
|
}, 8, ["modelValue", "placeholder", "aria-label"]),
|
|
569
|
-
|
|
567
|
+
p(e(gt), {
|
|
570
568
|
title: e(a)("panel.filters"),
|
|
571
569
|
width: 280,
|
|
572
570
|
side: "bottom",
|
|
573
571
|
align: "end"
|
|
574
572
|
}, {
|
|
575
573
|
trigger: i(() => [
|
|
576
|
-
|
|
574
|
+
p(e(bt), {
|
|
577
575
|
class: "wx-vacancies__funnel",
|
|
578
|
-
value:
|
|
579
|
-
hidden:
|
|
576
|
+
value: B.value.length,
|
|
577
|
+
hidden: B.value.length === 0,
|
|
580
578
|
type: "primary",
|
|
581
579
|
label: e(a)("panel.filters")
|
|
582
580
|
}, {
|
|
583
581
|
default: i(() => [
|
|
584
|
-
|
|
582
|
+
p(e(wt), {
|
|
585
583
|
icon: "filter",
|
|
586
584
|
size: "sm",
|
|
587
585
|
title: e(a)("panel.filters")
|
|
@@ -591,50 +589,50 @@ const Rt = /* @__PURE__ */ de({
|
|
|
591
589
|
}, 8, ["value", "hidden", "label"])
|
|
592
590
|
]),
|
|
593
591
|
default: i(() => [
|
|
594
|
-
|
|
595
|
-
|
|
592
|
+
A("div", Ot, [
|
|
593
|
+
V.value ? R("", !0) : (y(), $(e($e), {
|
|
596
594
|
key: 0,
|
|
597
595
|
label: e(a)("panel.filter-status")
|
|
598
596
|
}, {
|
|
599
597
|
default: i(() => [
|
|
600
|
-
|
|
601
|
-
"model-value":
|
|
602
|
-
options:
|
|
598
|
+
p(e(Ie), {
|
|
599
|
+
"model-value": E.value === "" ? null : E.value,
|
|
600
|
+
options: te.value,
|
|
603
601
|
placeholder: e(a)("panel.any-status"),
|
|
604
602
|
clearable: "",
|
|
605
603
|
size: "sm",
|
|
606
|
-
"onUpdate:modelValue":
|
|
604
|
+
"onUpdate:modelValue": d[1] || (d[1] = (r) => L("status", r))
|
|
607
605
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
608
606
|
]),
|
|
609
607
|
_: 1
|
|
610
608
|
}, 8, ["label"])),
|
|
611
|
-
|
|
609
|
+
p(e($e), {
|
|
612
610
|
label: e(a)("panel.filter-category")
|
|
613
611
|
}, {
|
|
614
612
|
default: i(() => [
|
|
615
|
-
|
|
616
|
-
"model-value":
|
|
617
|
-
options:
|
|
613
|
+
p(e(Ie), {
|
|
614
|
+
"model-value": U.value,
|
|
615
|
+
options: k.value.categories.map((r) => ({ value: r.id, label: r.title })),
|
|
618
616
|
placeholder: e(a)("panel.any-category"),
|
|
619
617
|
clearable: "",
|
|
620
618
|
size: "sm",
|
|
621
|
-
"onUpdate:modelValue":
|
|
619
|
+
"onUpdate:modelValue": d[2] || (d[2] = (r) => L("category", r))
|
|
622
620
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
623
621
|
]),
|
|
624
622
|
_: 1
|
|
625
623
|
}, 8, ["label"]),
|
|
626
|
-
|
|
624
|
+
B.value.length > 0 ? (y(), $(e(K), {
|
|
627
625
|
key: 1,
|
|
628
626
|
variant: "text",
|
|
629
627
|
size: "sm",
|
|
630
628
|
block: "",
|
|
631
|
-
onClick:
|
|
629
|
+
onClick: ee
|
|
632
630
|
}, {
|
|
633
631
|
icon: i(() => [
|
|
634
|
-
|
|
632
|
+
p(e(ie), { name: "close" })
|
|
635
633
|
]),
|
|
636
634
|
default: i(() => [
|
|
637
|
-
|
|
635
|
+
x(" " + g(e(a)("panel.filters-reset")), 1)
|
|
638
636
|
]),
|
|
639
637
|
_: 1
|
|
640
638
|
})) : R("", !0)
|
|
@@ -643,110 +641,116 @@ const Rt = /* @__PURE__ */ de({
|
|
|
643
641
|
_: 1
|
|
644
642
|
}, 8, ["title"])
|
|
645
643
|
]),
|
|
646
|
-
|
|
647
|
-
|
|
644
|
+
B.value.length > 0 ? (y(), z("div", Dt, [
|
|
645
|
+
p(e(Ye), { filters: B.value }, null, 8, ["filters"])
|
|
648
646
|
])) : R("", !0),
|
|
649
|
-
|
|
647
|
+
C.value && l.value.length === 0 ? (y(), $(e(de), {
|
|
650
648
|
key: 1,
|
|
651
649
|
class: "wx-vacancies__loading",
|
|
652
650
|
rows: 5
|
|
653
|
-
})) : l.value.length === 0 ? (
|
|
651
|
+
})) : l.value.length === 0 ? (y(), $(e(Le), {
|
|
654
652
|
key: 2,
|
|
655
|
-
title:
|
|
656
|
-
description: M.value === "all" && !
|
|
657
|
-
}, null, 8, ["title", "description"])) : (
|
|
658
|
-
|
|
653
|
+
title: ye.value,
|
|
654
|
+
description: M.value === "all" && !V.value && P.value ? e(a)("panel.empty-help") : void 0
|
|
655
|
+
}, null, 8, ["title", "description"])) : (y(), z(ne, { key: 3 }, [
|
|
656
|
+
p(e(_t), {
|
|
659
657
|
modelValue: l.value,
|
|
660
|
-
"onUpdate:modelValue":
|
|
661
|
-
class:
|
|
658
|
+
"onUpdate:modelValue": d[3] || (d[3] = (r) => l.value = r),
|
|
659
|
+
class: De(["wx-vacancies__list", { "is-loading": C.value }]),
|
|
662
660
|
plain: "",
|
|
663
661
|
"item-key": "id",
|
|
664
|
-
handle:
|
|
665
|
-
"item-label": (
|
|
666
|
-
disabled: !
|
|
667
|
-
onMove:
|
|
662
|
+
handle: X.value ? "grip" : "row",
|
|
663
|
+
"item-label": (r) => r.title,
|
|
664
|
+
disabled: !X.value,
|
|
665
|
+
onMove: H
|
|
668
666
|
}, {
|
|
669
|
-
default: i(({ item:
|
|
670
|
-
(
|
|
671
|
-
class: ["wx-vacancy-row", { "is-closed":
|
|
672
|
-
},
|
|
667
|
+
default: i(({ item: r }) => [
|
|
668
|
+
(y(), $(ct(V.value ? "div" : "router-link"), ut({
|
|
669
|
+
class: ["wx-vacancy-row", { "is-closed": G(r) }]
|
|
670
|
+
}, V.value ? {} : { to: { path: `${u.base}/${r.id}`, query: e(n).query } }), {
|
|
673
671
|
default: i(() => [
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
672
|
+
A("span", At, [
|
|
673
|
+
A("span", Pt, g(r.title), 1),
|
|
674
|
+
A("span", zt, [
|
|
675
|
+
x(g(s(r)), 1),
|
|
676
|
+
V.value ? R("", !0) : (y(), $(e(Je), {
|
|
677
|
+
key: 0,
|
|
678
|
+
locale: r.address_locale
|
|
679
|
+
}, null, 8, ["locale"]))
|
|
680
|
+
])
|
|
677
681
|
]),
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
name:
|
|
682
|
+
A("span", Mt, [
|
|
683
|
+
A("span", Lt, [
|
|
684
|
+
p(e(ie), {
|
|
685
|
+
name: r.workplace === "remote" ? "monitor" : "map-pin",
|
|
682
686
|
size: "sm"
|
|
683
687
|
}, null, 8, ["name"]),
|
|
684
|
-
|
|
688
|
+
x(" " + g(w(r)), 1)
|
|
685
689
|
]),
|
|
686
|
-
|
|
687
|
-
|
|
690
|
+
r.employment_types.length > 0 ? (y(), z("span", Ft, g(S(r)), 1)) : R("", !0),
|
|
691
|
+
r.valid_through ? (y(), $(e(Ne), {
|
|
688
692
|
key: 1,
|
|
689
|
-
content: e(a)("panel.until-help", { date: e(
|
|
693
|
+
content: e(a)("panel.until-help", { date: e(Be)(r.valid_through, T.value) })
|
|
690
694
|
}, {
|
|
691
695
|
default: i(() => [
|
|
692
|
-
|
|
693
|
-
|
|
696
|
+
A("span", Ut, [
|
|
697
|
+
p(e(ie), {
|
|
694
698
|
name: "calendar",
|
|
695
699
|
size: "sm"
|
|
696
700
|
}),
|
|
697
|
-
|
|
701
|
+
x(" " + g(e(a)("panel.until", { date: e(It)(r.valid_through, T.value) })), 1)
|
|
698
702
|
])
|
|
699
703
|
]),
|
|
700
704
|
_: 2
|
|
701
705
|
}, 1032, ["content"])) : R("", !0)
|
|
702
706
|
]),
|
|
703
|
-
|
|
704
|
-
(
|
|
705
|
-
key:
|
|
707
|
+
A("span", Bt, [
|
|
708
|
+
(y(!0), z(ne, null, Ae(r.categories, (Ce) => (y(), $(e(J), {
|
|
709
|
+
key: Ce.id,
|
|
706
710
|
size: "sm",
|
|
707
711
|
round: ""
|
|
708
712
|
}, {
|
|
709
713
|
default: i(() => [
|
|
710
|
-
|
|
714
|
+
x(g(Ce.title), 1)
|
|
711
715
|
]),
|
|
712
716
|
_: 2
|
|
713
717
|
}, 1024))), 128)),
|
|
714
|
-
|
|
718
|
+
r.closed_reason ? (y(), $(e(Ne), {
|
|
715
719
|
key: 0,
|
|
716
|
-
content: e(a)(`panel.closed-${
|
|
720
|
+
content: e(a)(`panel.closed-${r.closed_reason}-help`)
|
|
717
721
|
}, {
|
|
718
722
|
default: i(() => [
|
|
719
|
-
|
|
723
|
+
p(e(J), {
|
|
720
724
|
type: "warning",
|
|
721
725
|
size: "sm",
|
|
722
726
|
round: ""
|
|
723
727
|
}, {
|
|
724
728
|
default: i(() => [
|
|
725
|
-
|
|
729
|
+
x(g(e(a)(`panel.closed-${r.closed_reason}`)), 1)
|
|
726
730
|
]),
|
|
727
731
|
_: 2
|
|
728
732
|
}, 1024)
|
|
729
733
|
]),
|
|
730
734
|
_: 2
|
|
731
735
|
}, 1032, ["content"])) : R("", !0),
|
|
732
|
-
|
|
733
|
-
type:
|
|
736
|
+
p(e(J), {
|
|
737
|
+
type: ke(r.status),
|
|
734
738
|
dot: "",
|
|
735
739
|
size: "sm"
|
|
736
740
|
}, {
|
|
737
741
|
default: i(() => [
|
|
738
|
-
|
|
742
|
+
x(g(e(a)(`panel.status-${r.status}`)), 1)
|
|
739
743
|
]),
|
|
740
744
|
_: 2
|
|
741
745
|
}, 1032, ["type"]),
|
|
742
|
-
|
|
746
|
+
r.status === "modified" ? (y(), $(e(J), {
|
|
743
747
|
key: 1,
|
|
744
748
|
type: "primary",
|
|
745
749
|
size: "sm",
|
|
746
750
|
round: ""
|
|
747
751
|
}, {
|
|
748
752
|
default: i(() => [
|
|
749
|
-
|
|
753
|
+
x(g(e(a)("panel.edits")), 1)
|
|
750
754
|
]),
|
|
751
755
|
_: 1
|
|
752
756
|
})) : R("", !0)
|
|
@@ -755,19 +759,19 @@ const Rt = /* @__PURE__ */ de({
|
|
|
755
759
|
_: 2
|
|
756
760
|
}, 1040, ["class"]))
|
|
757
761
|
]),
|
|
758
|
-
actions: i(({ item:
|
|
759
|
-
|
|
760
|
-
actions: me(
|
|
761
|
-
label:
|
|
762
|
+
actions: i(({ item: r }) => [
|
|
763
|
+
p(e(Ge), {
|
|
764
|
+
actions: me(r),
|
|
765
|
+
label: r.title
|
|
762
766
|
}, null, 8, ["actions", "label"])
|
|
763
767
|
]),
|
|
764
768
|
_: 1
|
|
765
769
|
}, 8, ["modelValue", "class", "handle", "item-label", "disabled"]),
|
|
766
|
-
|
|
770
|
+
q.value && !V.value ? (y(), $(e(Fe), {
|
|
767
771
|
key: 0,
|
|
768
772
|
class: "wx-vacancies__note",
|
|
769
773
|
type: "info",
|
|
770
|
-
description:
|
|
774
|
+
description: O.value
|
|
771
775
|
}, null, 8, ["description"])) : R("", !0)
|
|
772
776
|
], 64))
|
|
773
777
|
]),
|
|
@@ -775,225 +779,254 @@ const Rt = /* @__PURE__ */ de({
|
|
|
775
779
|
}, 8, ["view", "title", "views", "actions"])
|
|
776
780
|
]));
|
|
777
781
|
}
|
|
778
|
-
}),
|
|
779
|
-
const
|
|
780
|
-
for (const [
|
|
781
|
-
|
|
782
|
-
return
|
|
783
|
-
},
|
|
784
|
-
function
|
|
785
|
-
|
|
782
|
+
}), We = (c, u) => {
|
|
783
|
+
const f = c.__vccOpts || c;
|
|
784
|
+
for (const [v, n] of u)
|
|
785
|
+
f[v] = n;
|
|
786
|
+
return f;
|
|
787
|
+
}, Kt = /* @__PURE__ */ We(Ht, [["__scopeId", "data-v-491c2b10"]]), He = /* @__PURE__ */ Symbol("wx-vacancy-editor");
|
|
788
|
+
function jt(c) {
|
|
789
|
+
dt(He, c);
|
|
786
790
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
791
|
+
function Yt() {
|
|
792
|
+
return pt(He, null);
|
|
789
793
|
}
|
|
790
|
-
const
|
|
794
|
+
const Gt = { class: "wx-vacancy-editor__word" }, Jt = 1200, Qt = /* @__PURE__ */ pe({
|
|
791
795
|
__name: "VacancyEditorPage",
|
|
792
796
|
props: {
|
|
793
797
|
base: { default: "/vacancies" }
|
|
794
798
|
},
|
|
795
|
-
setup(
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
const l =
|
|
799
|
-
const s =
|
|
800
|
-
return
|
|
801
|
-
}),
|
|
802
|
-
const s =
|
|
799
|
+
setup(c) {
|
|
800
|
+
const u = c, f = ce(), v = ve(f), n = Pe(), m = ze(), a = xt(), I = Qe();
|
|
801
|
+
he();
|
|
802
|
+
const l = oe("webx-vacancies"), k = oe("webx-admin"), C = Ve(), F = h(() => Number(n.params.id)), q = h(() => u.base), o = W(null), T = W({}), b = W(""), V = W(null), M = W(null), U = W(!0), E = W(!1), N = W(!1), Q = W({}), D = W(null), te = W(""), P = h(() => f.can("vacancies.manage")), ue = h(() => !P.value || N.value), X = h(() => JSON.stringify(T.value)), O = h(() => te.value !== "" && X.value !== te.value), ye = h(() => E.value ? "saving" : O.value ? "unsaved" : "saved"), B = h(() => {
|
|
803
|
+
const s = T.value.title;
|
|
804
|
+
return kt(s, a.active.value, o.value?.title ?? "");
|
|
805
|
+
}), Z = h(() => {
|
|
806
|
+
const s = o.value;
|
|
803
807
|
if (!s) return "";
|
|
804
|
-
const
|
|
805
|
-
return s.valid_through !== null && !s.closed &&
|
|
806
|
-
l("editor.open-until", { date:
|
|
807
|
-
), (s.status === "published" || s.status === "modified") &&
|
|
808
|
+
const w = [];
|
|
809
|
+
return s.valid_through !== null && !s.closed && w.push(
|
|
810
|
+
l("editor.open-until", { date: Be(s.valid_through, f.i18n.state.locale) })
|
|
811
|
+
), (s.status === "published" || s.status === "modified") && w.push(l("editor.live-since", { date: I.short(s.published_at) })), w.join(" · ");
|
|
808
812
|
});
|
|
809
|
-
|
|
810
|
-
values:
|
|
811
|
-
prefix:
|
|
812
|
-
path: h(() =>
|
|
813
|
+
Xe({ type: "vacancy", id: h(() => o.value?.id ?? null) }), Ze({
|
|
814
|
+
values: T,
|
|
815
|
+
prefix: V,
|
|
816
|
+
path: h(() => o.value?.path),
|
|
813
817
|
moving: () => l("editor.address-moving")
|
|
814
|
-
}),
|
|
815
|
-
function
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
+
}), jt({ vacancy: o, canManage: P.value, reload: () => L(!0) });
|
|
819
|
+
function ae(s) {
|
|
820
|
+
const w = s.values;
|
|
821
|
+
o.value = s.vacancy, T.value = w, b.value = s.revision, V.value = s.prefix, M.value = s.preview_url, te.value = JSON.stringify(w), D.value = null;
|
|
818
822
|
}
|
|
819
|
-
async function
|
|
820
|
-
s || (
|
|
823
|
+
async function L(s = !1) {
|
|
824
|
+
s || (U.value = !0);
|
|
821
825
|
try {
|
|
822
|
-
|
|
823
|
-
} catch (
|
|
824
|
-
_.danger(
|
|
826
|
+
ae(await v.get(F.value));
|
|
827
|
+
} catch (w) {
|
|
828
|
+
_.danger(C(w)), m.push(q.value);
|
|
825
829
|
} finally {
|
|
826
|
-
|
|
830
|
+
U.value = !1;
|
|
827
831
|
}
|
|
828
832
|
}
|
|
829
|
-
let
|
|
830
|
-
function
|
|
831
|
-
!
|
|
833
|
+
let ee;
|
|
834
|
+
function le() {
|
|
835
|
+
!P.value || D.value || !O.value || (clearTimeout(ee), ee = setTimeout(() => {
|
|
832
836
|
H();
|
|
833
|
-
},
|
|
837
|
+
}, Jt));
|
|
834
838
|
}
|
|
835
|
-
function
|
|
836
|
-
!
|
|
839
|
+
function fe() {
|
|
840
|
+
!P.value || D.value || !O.value || E.value || (clearTimeout(ee), H());
|
|
837
841
|
}
|
|
838
842
|
async function H() {
|
|
839
|
-
if (!
|
|
840
|
-
clearTimeout(
|
|
841
|
-
const s =
|
|
842
|
-
|
|
843
|
+
if (!o.value || E.value || !P.value) return;
|
|
844
|
+
clearTimeout(ee);
|
|
845
|
+
const s = X.value, w = T.value;
|
|
846
|
+
E.value = !0, Q.value = {};
|
|
843
847
|
try {
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
} catch (
|
|
847
|
-
const
|
|
848
|
-
|
|
848
|
+
const S = await v.save(o.value.id, { values: w, revision: b.value });
|
|
849
|
+
o.value = S.vacancy, b.value = S.revision, V.value = S.prefix, M.value = S.preview_url, D.value = null, X.value === s && (te.value = s);
|
|
850
|
+
} catch (S) {
|
|
851
|
+
const G = S;
|
|
852
|
+
G.status === 409 && G.body?.data ? D.value = G.body : G.body?.errors ? (Q.value = G.body.errors, _.danger(l("editor.save-failed"))) : _.danger(C(S));
|
|
849
853
|
} finally {
|
|
850
|
-
|
|
854
|
+
E.value = !1;
|
|
851
855
|
}
|
|
852
856
|
}
|
|
853
|
-
async function
|
|
854
|
-
await
|
|
857
|
+
async function se() {
|
|
858
|
+
await j({
|
|
855
859
|
title: l("editor.conflict-theirs-title"),
|
|
856
860
|
message: l("editor.conflict-theirs-text"),
|
|
857
861
|
confirmText: l("editor.conflict-theirs"),
|
|
858
862
|
cancelText: l("panel.cancel"),
|
|
859
863
|
tone: "danger"
|
|
860
|
-
}) && await
|
|
861
|
-
}
|
|
862
|
-
async function le() {
|
|
863
|
-
const s = S.value;
|
|
864
|
-
s && (W.value = s.data.revision, S.value = null, await H());
|
|
864
|
+
}) && await L(!0);
|
|
865
865
|
}
|
|
866
866
|
async function me() {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
867
|
+
const s = D.value;
|
|
868
|
+
s && (b.value = s.data.revision, D.value = null, await H());
|
|
869
|
+
}
|
|
870
|
+
async function ge() {
|
|
871
|
+
if (!(!o.value || !await j({
|
|
872
|
+
title: k("editor.discard-title"),
|
|
873
|
+
message: k("editor.discard-text"),
|
|
870
874
|
confirmText: l("editor.discard"),
|
|
871
|
-
|
|
875
|
+
// Not «Cancel»: beside «Discard changes» the two read as the same word.
|
|
876
|
+
cancelText: k("editor.keep-changes"),
|
|
872
877
|
tone: "danger"
|
|
873
878
|
}))) {
|
|
874
|
-
|
|
879
|
+
N.value = !0;
|
|
875
880
|
try {
|
|
876
|
-
|
|
877
|
-
} catch (
|
|
878
|
-
_.danger(
|
|
881
|
+
ae(await v.discard(o.value.id)), _.success(l("editor.discarded"));
|
|
882
|
+
} catch (w) {
|
|
883
|
+
_.danger(C(w));
|
|
879
884
|
} finally {
|
|
880
|
-
|
|
885
|
+
N.value = !1;
|
|
881
886
|
}
|
|
882
887
|
}
|
|
883
888
|
}
|
|
884
|
-
async function
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
+
async function be() {
|
|
890
|
+
if (O.value && await H(), D.value || O.value) return;
|
|
891
|
+
const s = o.value;
|
|
892
|
+
if (!s) return;
|
|
893
|
+
const w = s.next_path ?? s.path, S = s.next_path != null && s.path !== null ? ` ${k("editor.publish-moves", { old: `/${s.path}` })}` : "";
|
|
894
|
+
if (await j({
|
|
895
|
+
title: l("editor.publish-title", { title: B.value || s.title }),
|
|
896
|
+
message: w === null ? l("editor.publish-nowhere") : l("editor.publish-text", { address: `/${w}` }) + S,
|
|
889
897
|
confirmText: l("panel.publish"),
|
|
890
898
|
cancelText: l("panel.cancel")
|
|
891
|
-
}))
|
|
892
|
-
|
|
899
|
+
})) {
|
|
900
|
+
N.value = !0;
|
|
893
901
|
try {
|
|
894
|
-
await
|
|
895
|
-
} catch (
|
|
896
|
-
_.danger(
|
|
902
|
+
await v.publish(s.id), await L(!0), _.success(l("panel.published"));
|
|
903
|
+
} catch (Te) {
|
|
904
|
+
_.danger(C(Te));
|
|
897
905
|
} finally {
|
|
898
|
-
|
|
906
|
+
N.value = !1;
|
|
899
907
|
}
|
|
900
908
|
}
|
|
901
909
|
}
|
|
902
910
|
async function we() {
|
|
903
|
-
const s =
|
|
904
|
-
if (s && (
|
|
905
|
-
|
|
911
|
+
const s = o.value;
|
|
912
|
+
if (s && (O.value && await H(), !(D.value || O.value))) {
|
|
913
|
+
N.value = !0;
|
|
906
914
|
try {
|
|
907
|
-
const
|
|
908
|
-
_.success(l("panel.duplicated")), await m.push({ path: `${
|
|
909
|
-
} catch (
|
|
910
|
-
_.danger(
|
|
915
|
+
const w = await v.duplicate(s.id);
|
|
916
|
+
_.success(l("panel.duplicated")), await m.push({ path: `${q.value}/${w.vacancy.id}`, query: { ...n.query } });
|
|
917
|
+
} catch (w) {
|
|
918
|
+
_.danger(C(w));
|
|
911
919
|
} finally {
|
|
912
|
-
|
|
920
|
+
N.value = !1;
|
|
913
921
|
}
|
|
914
922
|
}
|
|
915
923
|
}
|
|
916
|
-
function
|
|
917
|
-
const s =
|
|
924
|
+
async function _e() {
|
|
925
|
+
const s = o.value;
|
|
926
|
+
if (!(!s || !await j({
|
|
927
|
+
title: k("editor.unpublish-title"),
|
|
928
|
+
message: k("editor.unpublish-text"),
|
|
929
|
+
confirmText: k("editor.unpublish"),
|
|
930
|
+
cancelText: k("editor.keep-published")
|
|
931
|
+
}))) {
|
|
932
|
+
N.value = !0;
|
|
933
|
+
try {
|
|
934
|
+
await v.unpublish(s.id), await L(!0), _.success(k("editor.unpublished"));
|
|
935
|
+
} catch (S) {
|
|
936
|
+
_.danger(C(S));
|
|
937
|
+
} finally {
|
|
938
|
+
N.value = !1;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
function xe() {
|
|
943
|
+
const s = o.value?.status;
|
|
918
944
|
return s === "published" || s === "modified" ? "success" : "default";
|
|
919
945
|
}
|
|
920
|
-
function
|
|
921
|
-
|
|
946
|
+
function Y(s) {
|
|
947
|
+
O.value && s.preventDefault();
|
|
922
948
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}),
|
|
926
|
-
|
|
927
|
-
}),
|
|
928
|
-
clearTimeout(
|
|
929
|
-
}),
|
|
949
|
+
re(X, le), re(F, () => {
|
|
950
|
+
L();
|
|
951
|
+
}), Ee(() => {
|
|
952
|
+
L(), window.addEventListener("beforeunload", Y);
|
|
953
|
+
}), Oe(() => {
|
|
954
|
+
clearTimeout(ee), window.removeEventListener("beforeunload", Y);
|
|
955
|
+
}), vt(async () => !O.value || !P.value || (await H(), !O.value) ? !0 : await j({
|
|
930
956
|
title: l("editor.leave-title"),
|
|
931
957
|
message: l("editor.leave-text"),
|
|
932
958
|
confirmText: l("editor.leave"),
|
|
933
959
|
cancelText: l("panel.cancel"),
|
|
934
960
|
tone: "danger"
|
|
935
961
|
}));
|
|
936
|
-
const
|
|
962
|
+
const ke = h(() => {
|
|
937
963
|
const s = [];
|
|
938
|
-
return
|
|
964
|
+
return M.value && s.push({ key: "preview", label: l("editor.preview"), icon: "eye", href: M.value }), o.value?.url && o.value.status !== "draft" && s.push({
|
|
939
965
|
key: "site",
|
|
940
966
|
label: l("panel.open-on-site"),
|
|
941
967
|
icon: "link",
|
|
942
|
-
href:
|
|
943
|
-
}),
|
|
968
|
+
href: o.value.url
|
|
969
|
+
}), P.value && (o.value?.status === "published" || o.value?.status === "modified") && s.push({
|
|
970
|
+
key: "unpublish",
|
|
971
|
+
label: k("editor.unpublish"),
|
|
972
|
+
icon: "eye-off",
|
|
973
|
+
run: () => {
|
|
974
|
+
_e();
|
|
975
|
+
}
|
|
976
|
+
}), o.value?.status === "modified" && s.push({
|
|
944
977
|
key: "discard",
|
|
945
978
|
label: l("editor.discard"),
|
|
946
979
|
icon: "refresh",
|
|
947
980
|
danger: !0,
|
|
948
981
|
menu: !0,
|
|
949
982
|
run: () => {
|
|
950
|
-
|
|
983
|
+
ge();
|
|
951
984
|
}
|
|
952
985
|
}), s;
|
|
953
986
|
});
|
|
954
|
-
return (s,
|
|
987
|
+
return (s, w) => (y(), z("div", {
|
|
955
988
|
class: "wx-vacancy-editor",
|
|
956
|
-
onFocusout:
|
|
989
|
+
onFocusout: fe
|
|
957
990
|
}, [
|
|
958
|
-
|
|
959
|
-
|
|
991
|
+
U.value || !o.value ? (y(), z(ne, { key: 0 }, [
|
|
992
|
+
p(e(de), {
|
|
960
993
|
class: "wx-vacancy-editor__ghost",
|
|
961
994
|
title: "",
|
|
962
995
|
rows: 1
|
|
963
996
|
}),
|
|
964
|
-
|
|
997
|
+
p(e(Tt), null, {
|
|
965
998
|
default: i(() => [
|
|
966
|
-
|
|
999
|
+
p(e(de), { rows: 8 })
|
|
967
1000
|
]),
|
|
968
1001
|
_: 1
|
|
969
1002
|
})
|
|
970
|
-
], 64)) : (
|
|
971
|
-
|
|
1003
|
+
], 64)) : (y(), z(ne, { key: 1 }, [
|
|
1004
|
+
p(e(et), {
|
|
972
1005
|
divider: "",
|
|
973
|
-
back:
|
|
1006
|
+
back: q.value,
|
|
974
1007
|
"back-label": e(l)("module.vacancies"),
|
|
975
|
-
title:
|
|
976
|
-
subtitle:
|
|
977
|
-
actions:
|
|
1008
|
+
title: B.value || e(l)("editor.untitled"),
|
|
1009
|
+
subtitle: Z.value,
|
|
1010
|
+
actions: ke.value
|
|
978
1011
|
}, {
|
|
979
1012
|
trail: i(() => [
|
|
980
|
-
|
|
1013
|
+
p(e($t), {
|
|
981
1014
|
size: "sm",
|
|
982
1015
|
label: e(l)("editor.trail")
|
|
983
1016
|
}, {
|
|
984
1017
|
default: i(() => [
|
|
985
|
-
|
|
1018
|
+
p(e(Re), {
|
|
986
1019
|
as: "router-link",
|
|
987
|
-
to:
|
|
1020
|
+
to: q.value
|
|
988
1021
|
}, {
|
|
989
1022
|
default: i(() => [
|
|
990
|
-
|
|
1023
|
+
x(g(e(l)("module.vacancies")), 1)
|
|
991
1024
|
]),
|
|
992
1025
|
_: 1
|
|
993
1026
|
}, 8, ["to"]),
|
|
994
|
-
|
|
1027
|
+
p(e(Re), { current: "" }, {
|
|
995
1028
|
default: i(() => [
|
|
996
|
-
|
|
1029
|
+
x(g(B.value || e(l)("editor.untitled")), 1)
|
|
997
1030
|
]),
|
|
998
1031
|
_: 1
|
|
999
1032
|
})
|
|
@@ -1002,113 +1035,113 @@ const Yt = { class: "wx-vacancy-editor__word" }, Gt = 1200, Jt = /* @__PURE__ */
|
|
|
1002
1035
|
}, 8, ["label"])
|
|
1003
1036
|
]),
|
|
1004
1037
|
"title-after": i(() => [
|
|
1005
|
-
|
|
1006
|
-
type:
|
|
1038
|
+
p(e(J), {
|
|
1039
|
+
type: xe(),
|
|
1007
1040
|
dot: ""
|
|
1008
1041
|
}, {
|
|
1009
1042
|
default: i(() => [
|
|
1010
|
-
|
|
1043
|
+
x(g(e(l)(`panel.status-${o.value.status}`)), 1)
|
|
1011
1044
|
]),
|
|
1012
1045
|
_: 1
|
|
1013
1046
|
}, 8, ["type"]),
|
|
1014
|
-
|
|
1047
|
+
o.value.status === "modified" ? (y(), $(e(J), {
|
|
1015
1048
|
key: 0,
|
|
1016
1049
|
type: "primary",
|
|
1017
1050
|
round: ""
|
|
1018
1051
|
}, {
|
|
1019
1052
|
default: i(() => [
|
|
1020
|
-
|
|
1053
|
+
x(g(e(l)("panel.edits")), 1)
|
|
1021
1054
|
]),
|
|
1022
1055
|
_: 1
|
|
1023
1056
|
})) : R("", !0),
|
|
1024
|
-
|
|
1057
|
+
o.value.closed_reason ? (y(), $(e(J), {
|
|
1025
1058
|
key: 1,
|
|
1026
1059
|
type: "warning",
|
|
1027
1060
|
round: ""
|
|
1028
1061
|
}, {
|
|
1029
1062
|
default: i(() => [
|
|
1030
|
-
|
|
1063
|
+
x(g(e(l)(`panel.closed-${o.value.closed_reason}`)), 1)
|
|
1031
1064
|
]),
|
|
1032
1065
|
_: 1
|
|
1033
1066
|
})) : R("", !0)
|
|
1034
1067
|
]),
|
|
1035
1068
|
_: 1
|
|
1036
1069
|
}, 8, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
1037
|
-
|
|
1070
|
+
D.value ? (y(), $(e(Fe), {
|
|
1038
1071
|
key: 0,
|
|
1039
1072
|
type: "warning",
|
|
1040
1073
|
title: e(l)("editor.conflict-title"),
|
|
1041
|
-
description:
|
|
1074
|
+
description: D.value.message
|
|
1042
1075
|
}, {
|
|
1043
1076
|
actions: i(() => [
|
|
1044
|
-
|
|
1077
|
+
p(e(K), {
|
|
1045
1078
|
size: "sm",
|
|
1046
1079
|
variant: "outline",
|
|
1047
|
-
onClick:
|
|
1080
|
+
onClick: se
|
|
1048
1081
|
}, {
|
|
1049
1082
|
default: i(() => [
|
|
1050
|
-
|
|
1083
|
+
x(g(e(l)("editor.conflict-theirs")), 1)
|
|
1051
1084
|
]),
|
|
1052
1085
|
_: 1
|
|
1053
1086
|
}),
|
|
1054
|
-
|
|
1087
|
+
p(e(K), {
|
|
1055
1088
|
size: "sm",
|
|
1056
1089
|
type: "primary",
|
|
1057
|
-
onClick:
|
|
1090
|
+
onClick: me
|
|
1058
1091
|
}, {
|
|
1059
1092
|
default: i(() => [
|
|
1060
|
-
|
|
1093
|
+
x(g(e(l)("editor.conflict-mine")), 1)
|
|
1061
1094
|
]),
|
|
1062
1095
|
_: 1
|
|
1063
1096
|
})
|
|
1064
1097
|
]),
|
|
1065
1098
|
_: 1
|
|
1066
1099
|
}, 8, ["title", "description"])) : R("", !0),
|
|
1067
|
-
|
|
1068
|
-
modelValue:
|
|
1069
|
-
"onUpdate:modelValue":
|
|
1100
|
+
p(e(tt), {
|
|
1101
|
+
modelValue: T.value,
|
|
1102
|
+
"onUpdate:modelValue": w[0] || (w[0] = (S) => T.value = S),
|
|
1070
1103
|
name: "vacancies.form",
|
|
1071
|
-
errors:
|
|
1072
|
-
disabled:
|
|
1104
|
+
errors: Q.value,
|
|
1105
|
+
disabled: ue.value
|
|
1073
1106
|
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
1074
|
-
|
|
1107
|
+
P.value ? (y(), $(e(Vt), { key: 1 }, {
|
|
1075
1108
|
state: i(() => [
|
|
1076
|
-
|
|
1109
|
+
p(e(at), { state: ye.value }, null, 8, ["state"])
|
|
1077
1110
|
]),
|
|
1078
1111
|
default: i(() => [
|
|
1079
|
-
|
|
1112
|
+
p(e(K), {
|
|
1080
1113
|
variant: "text",
|
|
1081
|
-
disabled:
|
|
1114
|
+
disabled: N.value,
|
|
1082
1115
|
"aria-label": e(l)("panel.duplicate"),
|
|
1083
1116
|
onClick: we
|
|
1084
1117
|
}, {
|
|
1085
1118
|
icon: i(() => [
|
|
1086
|
-
|
|
1119
|
+
p(e(ie), { name: "copy" })
|
|
1087
1120
|
]),
|
|
1088
1121
|
default: i(() => [
|
|
1089
|
-
|
|
1122
|
+
A("span", Gt, g(e(l)("panel.duplicate")), 1)
|
|
1090
1123
|
]),
|
|
1091
1124
|
_: 1
|
|
1092
1125
|
}, 8, ["disabled", "aria-label"]),
|
|
1093
|
-
|
|
1126
|
+
p(e(K), {
|
|
1094
1127
|
variant: "outline",
|
|
1095
|
-
loading:
|
|
1096
|
-
disabled: !
|
|
1128
|
+
loading: E.value,
|
|
1129
|
+
disabled: !O.value,
|
|
1097
1130
|
onClick: H
|
|
1098
1131
|
}, {
|
|
1099
1132
|
default: i(() => [
|
|
1100
|
-
|
|
1133
|
+
x(g(e(l)("editor.save")), 1)
|
|
1101
1134
|
]),
|
|
1102
1135
|
_: 1
|
|
1103
1136
|
}, 8, ["loading", "disabled"]),
|
|
1104
|
-
|
|
1137
|
+
p(e(K), {
|
|
1105
1138
|
type: "primary",
|
|
1106
|
-
loading:
|
|
1107
|
-
disabled:
|
|
1108
|
-
onClick:
|
|
1139
|
+
loading: N.value,
|
|
1140
|
+
disabled: o.value.status === "published" && !O.value,
|
|
1141
|
+
onClick: be
|
|
1109
1142
|
}, {
|
|
1110
1143
|
default: i(() => [
|
|
1111
|
-
|
|
1144
|
+
x(g(e(l)("panel.publish")), 1)
|
|
1112
1145
|
]),
|
|
1113
1146
|
_: 1
|
|
1114
1147
|
}, 8, ["loading", "disabled"])
|
|
@@ -1118,118 +1151,118 @@ const Yt = { class: "wx-vacancy-editor__word" }, Gt = 1200, Jt = /* @__PURE__ */
|
|
|
1118
1151
|
], 64))
|
|
1119
1152
|
], 32));
|
|
1120
1153
|
}
|
|
1121
|
-
}),
|
|
1154
|
+
}), Xt = /* @__PURE__ */ We(Qt, [["__scopeId", "data-v-12e705f9"]]), Zt = { class: "wx-vacancy-history" }, ea = { class: "wx-vacancy-history__number" }, ta = { class: "wx-vacancy-history__who" }, aa = /* @__PURE__ */ pe({
|
|
1122
1155
|
name: "WxVacancyHistory",
|
|
1123
1156
|
__name: "VacancyHistory",
|
|
1124
|
-
setup(
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
const n =
|
|
1157
|
+
setup(c) {
|
|
1158
|
+
const u = ce(), f = ve(u), v = Yt();
|
|
1159
|
+
he();
|
|
1160
|
+
const n = oe("webx-vacancies"), m = Ve(), a = W(null), I = W(!1), l = h(() => v?.vacancy.value ?? null), k = h(() => v?.canManage ?? !1), C = h(
|
|
1128
1161
|
() => l.value?.status === "published" || l.value?.status === "modified" ? a.value?.[0]?.number ?? null : null
|
|
1129
1162
|
);
|
|
1130
|
-
async function
|
|
1131
|
-
const
|
|
1132
|
-
if (
|
|
1163
|
+
async function F() {
|
|
1164
|
+
const o = l.value;
|
|
1165
|
+
if (o)
|
|
1133
1166
|
try {
|
|
1134
|
-
a.value = await
|
|
1135
|
-
} catch (
|
|
1136
|
-
a.value = [], _.danger(m(
|
|
1167
|
+
a.value = await f.versions(o.id);
|
|
1168
|
+
} catch (T) {
|
|
1169
|
+
a.value = [], _.danger(m(T));
|
|
1137
1170
|
}
|
|
1138
1171
|
}
|
|
1139
|
-
async function
|
|
1140
|
-
const
|
|
1141
|
-
if (!(!
|
|
1142
|
-
title: n("editor.restore-title", { number:
|
|
1172
|
+
async function q(o) {
|
|
1173
|
+
const T = l.value;
|
|
1174
|
+
if (!(!T || !await j({
|
|
1175
|
+
title: n("editor.restore-title", { number: o.number }),
|
|
1143
1176
|
message: n("editor.restore-text"),
|
|
1144
1177
|
confirmText: n("editor.restore-version"),
|
|
1145
1178
|
cancelText: n("panel.cancel")
|
|
1146
1179
|
}))) {
|
|
1147
|
-
|
|
1180
|
+
I.value = !0;
|
|
1148
1181
|
try {
|
|
1149
|
-
await
|
|
1150
|
-
} catch (
|
|
1151
|
-
_.danger(m(
|
|
1182
|
+
await f.restoreVersion(T.id, o.number), await v?.reload(), _.success(n("editor.restored-version", { number: o.number }));
|
|
1183
|
+
} catch (V) {
|
|
1184
|
+
_.danger(m(V));
|
|
1152
1185
|
} finally {
|
|
1153
|
-
|
|
1186
|
+
I.value = !1;
|
|
1154
1187
|
}
|
|
1155
1188
|
}
|
|
1156
1189
|
}
|
|
1157
|
-
return
|
|
1190
|
+
return re(
|
|
1158
1191
|
() => [l.value?.id, l.value?.published_at, l.value?.updated_at],
|
|
1159
1192
|
() => {
|
|
1160
|
-
|
|
1193
|
+
F();
|
|
1161
1194
|
},
|
|
1162
1195
|
{ immediate: !0 }
|
|
1163
|
-
), (
|
|
1164
|
-
a.value === null ? (
|
|
1196
|
+
), (o, T) => (y(), z("div", Zt, [
|
|
1197
|
+
a.value === null ? (y(), $(e(de), {
|
|
1165
1198
|
key: 0,
|
|
1166
1199
|
class: "wx-vacancy-history__ghost",
|
|
1167
1200
|
rows: 3
|
|
1168
|
-
})) : a.value.length === 0 ? (
|
|
1201
|
+
})) : a.value.length === 0 ? (y(), $(e(Le), {
|
|
1169
1202
|
key: 1,
|
|
1170
1203
|
description: e(n)("editor.history-empty")
|
|
1171
|
-
}, null, 8, ["description"])) : (
|
|
1204
|
+
}, null, 8, ["description"])) : (y(!0), z(ne, { key: 2 }, Ae(a.value, (b) => (y(), z("div", {
|
|
1172
1205
|
key: b.number,
|
|
1173
|
-
class:
|
|
1206
|
+
class: De(["wx-vacancy-history__row", { "is-live": b.number === C.value }])
|
|
1174
1207
|
}, [
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
b.created_at ? (
|
|
1208
|
+
A("code", ea, g(e(n)("editor.version", { number: b.number })), 1),
|
|
1209
|
+
A("div", ta, [
|
|
1210
|
+
b.created_at ? (y(), $(e(nt), {
|
|
1178
1211
|
key: 0,
|
|
1179
1212
|
value: b.created_at,
|
|
1180
1213
|
size: "md",
|
|
1181
1214
|
tone: "default"
|
|
1182
1215
|
}, null, 8, ["value"])) : R("", !0),
|
|
1183
|
-
|
|
1216
|
+
p(e(Wt), {
|
|
1184
1217
|
size: "sm",
|
|
1185
1218
|
tone: "muted"
|
|
1186
1219
|
}, {
|
|
1187
1220
|
default: i(() => [
|
|
1188
|
-
|
|
1189
|
-
b.comment ? (
|
|
1190
|
-
|
|
1221
|
+
x(g(b.author ?? e(n)(`editor.source-${b.source}`)) + " ", 1),
|
|
1222
|
+
b.comment ? (y(), z(ne, { key: 0 }, [
|
|
1223
|
+
x(" · " + g(b.comment), 1)
|
|
1191
1224
|
], 64)) : R("", !0)
|
|
1192
1225
|
]),
|
|
1193
1226
|
_: 2
|
|
1194
1227
|
}, 1024)
|
|
1195
1228
|
]),
|
|
1196
|
-
b.number ===
|
|
1229
|
+
b.number === C.value ? (y(), $(e(J), {
|
|
1197
1230
|
key: 0,
|
|
1198
1231
|
type: "success",
|
|
1199
1232
|
dot: ""
|
|
1200
1233
|
}, {
|
|
1201
1234
|
default: i(() => [
|
|
1202
|
-
|
|
1235
|
+
x(g(e(n)("editor.version-live")), 1)
|
|
1203
1236
|
]),
|
|
1204
1237
|
_: 1
|
|
1205
1238
|
})) : R("", !0),
|
|
1206
|
-
|
|
1239
|
+
k.value && b.number !== C.value ? (y(), $(e(K), {
|
|
1207
1240
|
key: 1,
|
|
1208
1241
|
size: "sm",
|
|
1209
1242
|
variant: "outline",
|
|
1210
|
-
loading:
|
|
1211
|
-
onClick: (
|
|
1243
|
+
loading: I.value,
|
|
1244
|
+
onClick: (V) => q(b)
|
|
1212
1245
|
}, {
|
|
1213
1246
|
default: i(() => [
|
|
1214
|
-
|
|
1247
|
+
x(g(e(n)("editor.restore-version")), 1)
|
|
1215
1248
|
]),
|
|
1216
1249
|
_: 1
|
|
1217
1250
|
}, 8, ["loading", "onClick"])) : R("", !0)
|
|
1218
1251
|
], 2))), 128))
|
|
1219
1252
|
]));
|
|
1220
1253
|
}
|
|
1221
|
-
}),
|
|
1222
|
-
function
|
|
1254
|
+
}), na = /* @__PURE__ */ We(aa, [["__scopeId", "data-v-77bc9b70"]]);
|
|
1255
|
+
function la(c = "/vacancies") {
|
|
1223
1256
|
return {
|
|
1224
1257
|
api: "vacancies/categories",
|
|
1225
|
-
path: `${
|
|
1258
|
+
path: `${c}/categories`,
|
|
1226
1259
|
name: "webx.vacancies.categories",
|
|
1227
1260
|
module: "vacancy-categories",
|
|
1228
1261
|
screen: "vacancies.category-form",
|
|
1229
1262
|
manage: "vacancies.categories.manage",
|
|
1230
1263
|
count: "vacancies_count",
|
|
1231
1264
|
// Every vacancy of the category, closed ones included: "what is filed here" is the question.
|
|
1232
|
-
items: (
|
|
1265
|
+
items: (u) => ({ path: c, query: { category: String(u), view: "all" } }),
|
|
1233
1266
|
words: {
|
|
1234
1267
|
new: "webx-vacancies::category.new",
|
|
1235
1268
|
empty: "webx-vacancies::category.empty",
|
|
@@ -1248,19 +1281,19 @@ function na(r = "/vacancies") {
|
|
|
1248
1281
|
}
|
|
1249
1282
|
};
|
|
1250
1283
|
}
|
|
1251
|
-
function
|
|
1252
|
-
const
|
|
1284
|
+
function ca(c = {}) {
|
|
1285
|
+
const u = c.path ?? "/vacancies";
|
|
1253
1286
|
return [
|
|
1254
1287
|
{
|
|
1255
1288
|
id: "vacancies",
|
|
1256
|
-
path:
|
|
1289
|
+
path: u,
|
|
1257
1290
|
routes: [
|
|
1258
|
-
{ path:
|
|
1291
|
+
{ path: u, name: "webx.vacancies", component: Kt, props: { base: u } },
|
|
1259
1292
|
{
|
|
1260
|
-
path: `${
|
|
1293
|
+
path: `${u}/:id(\\d+)`,
|
|
1261
1294
|
name: "webx.vacancies.edit",
|
|
1262
|
-
component:
|
|
1263
|
-
props: { base:
|
|
1295
|
+
component: Xt,
|
|
1296
|
+
props: { base: u }
|
|
1264
1297
|
}
|
|
1265
1298
|
],
|
|
1266
1299
|
/*
|
|
@@ -1269,28 +1302,28 @@ function ra(r = {}) {
|
|
|
1269
1302
|
* `wx-date-picker`, `wx-checkbox-group`).
|
|
1270
1303
|
*/
|
|
1271
1304
|
types: {
|
|
1272
|
-
"wx-vacancy-history": { component:
|
|
1305
|
+
"wx-vacancy-history": { component: na, kind: "display" }
|
|
1273
1306
|
}
|
|
1274
1307
|
},
|
|
1275
1308
|
{
|
|
1276
1309
|
id: "vacancy-categories",
|
|
1277
|
-
path: `${
|
|
1278
|
-
routes:
|
|
1310
|
+
path: `${u}/categories`,
|
|
1311
|
+
routes: lt(la(u))
|
|
1279
1312
|
}
|
|
1280
1313
|
];
|
|
1281
1314
|
}
|
|
1282
1315
|
export {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1316
|
+
Se as VACANCIES_API,
|
|
1317
|
+
Kt as WxVacanciesPage,
|
|
1318
|
+
St as WxVacancyCreateDialog,
|
|
1319
|
+
Xt as WxVacancyEditorPage,
|
|
1320
|
+
na as WxVacancyHistory,
|
|
1321
|
+
ve as createVacanciesApi,
|
|
1322
|
+
jt as provideVacancyEditor,
|
|
1323
|
+
Yt as useVacancyEditor,
|
|
1324
|
+
ca as vacancies,
|
|
1325
|
+
Nt as vacanciesMessages,
|
|
1326
|
+
la as vacancyCategoriesOptions,
|
|
1327
|
+
He as vacancyEditorKey
|
|
1295
1328
|
};
|
|
1296
1329
|
//# sourceMappingURL=index.js.map
|