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