@opengis/surveyor 0.0.20 → 0.0.21

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.
@@ -238,8 +238,8 @@ var U = (e) => ({
238
238
  id: e,
239
239
  text: C[e] ?? e
240
240
  });
241
- function W(e) {
242
- return a.currentUser?.type === "admin" ? x.map(U) : R.includes(e) ? [U(e), U("cancelled")] : [];
241
+ function W(e, t) {
242
+ return t === "admin" ? x.map(U) : R.includes(e) ? [U(e), U("cancelled")] : [];
243
243
  }
244
244
  async function G(e, t, n) {
245
245
  if (!("status" in t)) return;
@@ -333,16 +333,16 @@ var K = {
333
333
  }
334
334
  }
335
335
  };
336
- function q(e) {
337
- let t = W(B(e?.status));
338
- if (!t.length) return K;
339
- let n = {
336
+ function q(e, t = a.currentUser?.type) {
337
+ let n = W(B(e?.status), t);
338
+ if (!n.length) return K;
339
+ let r = {
340
340
  status: {
341
341
  component: "select",
342
342
  label: "Статус",
343
343
  col: 12,
344
344
  validators: ["required"],
345
- options: t
345
+ options: n
346
346
  },
347
347
  cancel_reason: {
348
348
  component: "textarea",
@@ -363,7 +363,7 @@ function q(e) {
363
363
  cancel_reason: B(e.cancel_reason)
364
364
  }),
365
365
  fields: {
366
- ...n,
366
+ ...r,
367
367
  ...K.fields
368
368
  }
369
369
  };
@@ -4,14 +4,14 @@ import { d as r, l as i, s as a, u as o } from "./resources-Cj8BzrBX.js";
4
4
  import { n as s, t as c } from "./AppealDetailField-CWayoaII.js";
5
5
  import { t as l } from "./BaseModal-X-hzV_I2.js";
6
6
  import { t as u } from "./RegistryForm-J7R4RWO3.js";
7
- import { a as d, c as f, i as p, l as m, o as h, r as g, s as _, t as v } from "./AppealStatusBadge-DRWZst3M.js";
7
+ import { a as d, c as f, i as p, l as m, o as h, r as g, s as _, t as v } from "./AppealStatusBadge-RQkpbDmk.js";
8
8
  import { r as y } from "./geometry-DyhIVRcw.js";
9
9
  import { a as b, c as x, i as S, l as C, n as w, o as T, r as E, s as D, t as O } from "./ApplicationGeometryExportModal-CH9VrqxO.js";
10
10
  import { Fragment as k, computed as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createTextVNode as F, createVNode as I, defineComponent as L, mergeModels as R, normalizeClass as z, openBlock as B, ref as V, renderList as H, toDisplayString as U, useModel as W, vModelRadio as G, vModelSelect as K, vModelText as q, watch as J, withCtx as Y, withDirectives as X } from "vue";
11
11
  import { RouterLink as ee, useRoute as te, useRouter as ne } from "vue-router";
12
12
  import { notify as re } from "@opengis/core";
13
13
  //#region admin/src/pages/requests/components/AppealDetailBoolean.vue?vue&type=script&setup=true&lang.ts
14
- var Z = /*@__PURE__*/ L({
14
+ var ie = /*@__PURE__*/ L({
15
15
  __name: "AppealDetailBoolean",
16
16
  props: {
17
17
  label: {
@@ -31,15 +31,15 @@ var Z = /*@__PURE__*/ L({
31
31
  value: !0
32
32
  }), r;
33
33
  }
34
- }), Q = { class: "mb-1 text-xs font-medium text-slate-500" }, ie = {
34
+ }), Z = { class: "mb-1 text-xs font-medium text-slate-500" }, Q = {
35
35
  key: 0,
36
36
  class: "inline-flex items-center gap-1.5 text-[14px] font-medium text-emerald-700"
37
37
  }, ae = {
38
38
  key: 1,
39
39
  class: "inline-flex items-center gap-1.5 text-[14px] font-medium text-slate-400"
40
40
  };
41
- function $(e, t, n, r, i, a) {
42
- return B(), N("div", null, [P("dt", Q, U(n.label), 1), P("dd", null, [n.value ? (B(), N("span", ie, [I(r.AppIcon, {
41
+ function oe(e, t, n, r, i, a) {
42
+ return B(), N("div", null, [P("dt", Z, U(n.label), 1), P("dd", null, [n.value ? (B(), N("span", Q, [I(r.AppIcon, {
43
43
  name: "circle-check",
44
44
  class: "h-4 w-4"
45
45
  }), t[0] ||= F(" Так ", -1)])) : (B(), N("span", ae, [I(r.AppIcon, {
@@ -47,7 +47,7 @@ function $(e, t, n, r, i, a) {
47
47
  class: "h-4 w-4"
48
48
  }), t[1] ||= F(" Ні ", -1)]))])]);
49
49
  }
50
- var oe = /*#__PURE__*/ e(Z, [["render", $], ["__file", "D:/softpro/surveyor/admin/src/pages/requests/components/AppealDetailBoolean.vue"]]), se = /*@__PURE__*/ L({
50
+ var se = /*#__PURE__*/ e(ie, [["render", oe], ["__file", "D:/softpro/surveyor/admin/src/pages/requests/components/AppealDetailBoolean.vue"]]), $ = /*@__PURE__*/ L({
51
51
  __name: "FormFilePicker",
52
52
  props: {
53
53
  fileName: {
@@ -116,7 +116,7 @@ function ge(e, t, n, r, i, a) {
116
116
  onChange: r.onInputChange
117
117
  }, null, 40, he)]);
118
118
  }
119
- var _e = /*#__PURE__*/ e(se, [["render", ge], ["__file", "D:/softpro/surveyor/admin/src/components/ui/FormFilePicker.vue"]]), ve = /*@__PURE__*/ L({
119
+ var _e = /*#__PURE__*/ e($, [["render", ge], ["__file", "D:/softpro/surveyor/admin/src/components/ui/FormFilePicker.vue"]]), ve = /*@__PURE__*/ L({
120
120
  __name: "ApplicationWorkflowActions",
121
121
  props: {
122
122
  applicationId: {
@@ -621,20 +621,24 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
621
621
  ...e,
622
622
  id: e.app_id
623
623
  } : null;
624
- }), R = A(() => g(L.value));
625
- function z() {
624
+ }), R = V(o.currentUser?.type);
625
+ o.checkUser().then((e) => {
626
+ e && (R.value = e.type);
627
+ });
628
+ let z = A(() => g(L.value, R.value));
629
+ function B() {
626
630
  f.replace({ query: {
627
631
  ...d.query,
628
632
  edit: "1"
629
633
  } });
630
634
  }
631
- function B() {
635
+ function H() {
632
636
  let e = { ...d.query };
633
637
  delete e.edit, f.replace({ query: e });
634
638
  }
635
- async function H() {
639
+ async function U() {
636
640
  let e = m.value?.app_id;
637
- if (B(), e) try {
641
+ if (H(), e) try {
638
642
  await $(e);
639
643
  } catch (e) {
640
644
  re({
@@ -644,30 +648,30 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
644
648
  });
645
649
  }
646
650
  }
647
- let U = A(() => {
651
+ let W = A(() => {
648
652
  let e = I.value;
649
653
  return e && [
650
654
  e.last_name,
651
655
  e.first_name,
652
656
  e.middle_name
653
657
  ].filter(Boolean).join(" ") || "—";
654
- }), W = A(() => ({
658
+ }), G = A(() => ({
655
659
  name: "Адміністратор",
656
660
  role: "Перевірка",
657
661
  initials: "АД"
658
662
  }));
659
- function G(e) {
660
- let t = U.value === "—" ? "Заявник" : U.value, n = {
663
+ function K(e) {
664
+ let t = W.value === "—" ? "Заявник" : W.value, n = {
661
665
  name: t,
662
666
  role: "Заявник",
663
667
  initials: D(t)
664
668
  };
665
669
  if (!e.created_by) return x;
666
- if (e.created_by === o.currentUser?.id) return W.value;
670
+ if (e.created_by === o.currentUser?.id) return G.value;
667
671
  let r = I.value?.surveyor_id;
668
- return r && e.created_by === r ? n : W.value;
672
+ return r && e.created_by === r ? n : G.value;
669
673
  }
670
- let K = A(() => m.value?.address_id_data?.text || "—"), q = A(() => m.value?.is_found_address_id === !0 || !!m.value?.address_id_data?.text?.trim()), Y = A(() => y(m.value?.geom)), X = A(() => {
674
+ let q = A(() => m.value?.address_id_data?.text || "—"), Y = A(() => m.value?.is_found_address_id === !0 || !!m.value?.address_id_data?.text?.trim()), X = A(() => y(m.value?.geom)), ie = A(() => {
671
675
  let e = m.value;
672
676
  if (!e) return [];
673
677
  let t = [];
@@ -718,10 +722,10 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
718
722
  let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
719
723
  return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
720
724
  }
721
- function ie(e) {
725
+ function ae(e) {
722
726
  return `/api/file/${encodeURIComponent(e)}?download=true`;
723
727
  }
724
- async function ae(e) {
728
+ async function oe(e) {
725
729
  if (S.value = "", e) try {
726
730
  let t = await a(`/api/resource/certificates/${encodeURIComponent(e)}`);
727
731
  S.value = Q(t.date_certificate);
@@ -730,9 +734,9 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
730
734
  }
731
735
  }
732
736
  async function $(e) {
733
- m.value = await a(`/api/resource/applications/${encodeURIComponent(e)}?include=organization,surveyor,status_history&limit=100`), await ae(Z(m.value.surveyor)?.certificate_id);
737
+ m.value = await a(`/api/resource/applications/${encodeURIComponent(e)}?include=organization,surveyor,status_history&limit=100`), await oe(Z(m.value.surveyor)?.certificate_id);
734
738
  }
735
- async function se(e) {
739
+ async function ce(e) {
736
740
  w.value = !0, E.value = "", m.value = null, S.value = "";
737
741
  try {
738
742
  await $(e);
@@ -743,9 +747,9 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
743
747
  }
744
748
  }
745
749
  J(() => String(d.params.number), (e) => {
746
- e && se(e);
750
+ e && ce(e);
747
751
  }, { immediate: !0 });
748
- let ce = {
752
+ let le = {
749
753
  route: d,
750
754
  router: f,
751
755
  listPath: p,
@@ -763,25 +767,26 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
763
767
  organization: F,
764
768
  surveyor: I,
765
769
  editRecord: L,
766
- applicationForm: R,
767
- startEdit: z,
768
- cancelEdit: B,
769
- onFormSaved: H,
770
- applicantName: U,
771
- commentCurrentAuthor: W,
772
- resolveNoteAuthor: G,
773
- address: K,
774
- showAddress: q,
775
- showMap: Y,
776
- files: X,
770
+ currentUserType: R,
771
+ applicationForm: z,
772
+ startEdit: B,
773
+ cancelEdit: H,
774
+ onFormSaved: U,
775
+ applicantName: W,
776
+ commentCurrentAuthor: G,
777
+ resolveNoteAuthor: K,
778
+ address: q,
779
+ showAddress: Y,
780
+ showMap: X,
781
+ files: ie,
777
782
  fileDownloadBtnClass: nt,
778
783
  fileUploadBtnClass: rt,
779
784
  firstRelation: Z,
780
785
  formatDate: Q,
781
- fileUrl: ie,
782
- loadCertificateDate: ae,
786
+ fileUrl: ae,
787
+ loadCertificateDate: oe,
783
788
  fetchApplication: $,
784
- loadApplication: se,
789
+ loadApplication: ce,
785
790
  AppIcon: t,
786
791
  get RouterLink() {
787
792
  return ee;
@@ -790,7 +795,7 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
790
795
  AppealStatusBadge: v,
791
796
  AppealDetailSection: s,
792
797
  AppealDetailField: c,
793
- AppealDetailBoolean: oe,
798
+ AppealDetailBoolean: se,
794
799
  AppealDetailMap: C,
795
800
  ApplicationCommentsSection: T,
796
801
  ApplicationHistorySection: b,
@@ -804,10 +809,10 @@ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/ad
804
809
  return r;
805
810
  }
806
811
  };
807
- return Object.defineProperty(ce, "__isScriptSetup", {
812
+ return Object.defineProperty(le, "__isScriptSetup", {
808
813
  enumerable: !1,
809
814
  value: !0
810
- }), ce;
815
+ }), le;
811
816
  }
812
817
  }), at = {
813
818
  key: 0,
@@ -873,14 +878,15 @@ function Kt(e, t, n, r, i, a) {
873
878
  P("div", ht, [P("div", gt, [
874
879
  r.editing ? (B(), N("div", _t, [
875
880
  t[13] ||= P("h2", { class: "mb-4 text-sm font-semibold text-slate-800" }, "Редагування звернення", -1),
876
- I(r.RegistryForm, {
881
+ (B(), j(r.RegistryForm, {
877
882
  ref: "formRef",
883
+ key: r.currentUserType ?? "unknown",
878
884
  config: r.applicationForm,
879
885
  record: r.editRecord,
880
886
  "hide-actions": "",
881
887
  onSaved: r.onFormSaved,
882
888
  onCancel: r.cancelEdit
883
- }, null, 8, ["config", "record"]),
889
+ }, null, 8, ["config", "record"])),
884
890
  P("div", vt, [P("button", {
885
891
  type: "button",
886
892
  class: "inline-flex h-10 items-center rounded-lg bg-slate-100 px-4 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-200",
@@ -3,7 +3,7 @@ import { a as t, d as n, l as r, s as i, t as a } from "./resources-Cj8BzrBX.js"
3
3
  import { l as o, o as s } from "./filterQuery-Dka-mIso.js";
4
4
  import { t as c } from "./SurveyorTeleport-Y-NJhfsb.js";
5
5
  import { c as l, d as u, f as d, l as f, m as p, p as m, t as h, u as g } from "./appealMapLayers-CQMK3rrz.js";
6
- import { d as _, f as v, g as y, h as b, m as x, p as S, t as C } from "./AppealStatusBadge-DRWZst3M.js";
6
+ import { d as _, f as v, g as y, h as b, m as x, p as S, t as C } from "./AppealStatusBadge-RQkpbDmk.js";
7
7
  import { a as w, c as T, d as ee, i as E, l as D, n as te, o as O, r as ne, s as re, t as ie, u as ae } from "./mapLayersApi-CBLcbADa.js";
8
8
  import { i as oe, n as se } from "./geometry-DyhIVRcw.js";
9
9
  import { Fragment as k, computed as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createTextVNode as F, createVNode as I, defineComponent as L, nextTick as ce, normalizeClass as R, normalizeStyle as z, onMounted as le, onUnmounted as ue, openBlock as B, ref as V, renderList as H, shallowRef as de, toDisplayString as U, useTemplateRef as W, vModelText as fe, watch as G, withCtx as K, withDirectives as q, withModifiers as pe } from "vue";
@@ -5,7 +5,7 @@ import { t as i } from "./filterQuery-Dka-mIso.js";
5
5
  import { i as a, n as o, r as s, t as c } from "./RegistryToolbar-BDVaZ2Rf.js";
6
6
  import { t as l } from "./TablePagination-CZhRgCVr.js";
7
7
  import { t as u } from "./SurveyorTeleport-Y-NJhfsb.js";
8
- import { g as d, n as f, t as p, u as m } from "./AppealStatusBadge-DRWZst3M.js";
8
+ import { g as d, n as f, t as p, u as m } from "./AppealStatusBadge-RQkpbDmk.js";
9
9
  import { Fragment as h, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createTextVNode as x, createVNode as S, defineComponent as C, normalizeStyle as w, onMounted as T, onUnmounted as E, openBlock as D, ref as O, renderList as k, toDisplayString as A, vModelText as j, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
10
10
  import { RouterLink as F, useRouter as I } from "vue-router";
11
11
  //#region admin/src/pages/requests/index.vue?vue&type=script&setup=true&lang.ts
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ var B = /*#__PURE__*/ r(I, [["render", z], ["__file", "D:/softpro/surveyor/src/w
59
59
  setup(e, { expose: t }) {
60
60
  t();
61
61
  let n = {
62
- MapPage: S(() => import("./chunks/map-CNPzf0wE.js")),
62
+ MapPage: S(() => import("./chunks/map-BZg1CvsE.js")),
63
63
  SurveyorEmbedShell: B
64
64
  };
65
65
  return Object.defineProperty(n, "__isScriptSetup", {
@@ -135,8 +135,8 @@ var K = /*#__PURE__*/ r(W, [["render", G], ["__file", "D:/softpro/surveyor/src/w
135
135
  setup(e, { expose: t }) {
136
136
  t();
137
137
  let n = {
138
- Index: S(() => import("./chunks/requests-D-QPPUe4.js")),
139
- Card: S(() => import("./chunks/card-VMoiAe7V.js")),
138
+ Index: S(() => import("./chunks/requests-DhLUiL_6.js")),
139
+ Card: S(() => import("./chunks/card-pTFhEtmI.js")),
140
140
  BaseEntityWrapper: K,
141
141
  SurveyorEmbedShell: B
142
142
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/surveyor",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "description": "Surveyor admin and geodesist cabinet UI for embedded host applications",