@opengis/surveyor 0.0.8 → 0.0.10

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.
Files changed (68) hide show
  1. package/README.md +4 -3
  2. package/dist/chunks/{AppIcon-CO70tpMX.js → AppIcon-Di5F4Bu_.js} +1 -1
  3. package/dist/chunks/{AppealDetailField-DNRGpnyD.js → AppealDetailField-DNpsGpPY.js} +2 -2
  4. package/dist/chunks/{AppealStatusBadge-Cu-UzdzA.js → AppealStatusBadge-MP1qD952.js} +1 -1
  5. package/dist/chunks/{AppealStatusBadge-BlAaNUSK.js → AppealStatusBadge-z77wwkFD.js} +2 -2
  6. package/dist/chunks/{ApplicationHistorySection-Cwq0-Frd.js → ApplicationHistorySection-DIoFZwH6.js} +4 -4
  7. package/dist/chunks/{BaseModal-SQXvRRNW.js → BaseModal-DP_ilBdg.js} +21 -11
  8. package/dist/chunks/{FormFilePicker-DxPQlxgy.js → FormFilePicker-D5fAUE0Z.js} +2 -2
  9. package/dist/chunks/{MapLayerMenu-AUeTqgEp.js → MapLayerMenu-CI5cbLEC.js} +1 -1
  10. package/dist/chunks/{RegistryForm-wG-c8GKf.js → RegistryForm-DbCxZsr0.js} +1 -1
  11. package/dist/chunks/{RegistryFormModal-R_iZYqGE.js → RegistryFormModal-D_KLGj2d.js} +3 -3
  12. package/dist/chunks/{RegistryToolbar-322DKUXi.js → RegistryToolbar-DvbrASlj.js} +6 -6
  13. package/dist/chunks/{SurveyorTeleport-CnSF0Ptl.js → SurveyorTeleport-D6-KXe_5.js} +1 -1
  14. package/dist/chunks/{UserAccessBadge-DyZDv7Oo.js → UserAccessBadge-B5Q1LvNv.js} +1 -1
  15. package/dist/chunks/{UserTypeBadge-LvnMuKGo.js → UserTypeBadge-CuAMctTK.js} +1 -1
  16. package/dist/chunks/{VerifiedBadge-bk0n-rlC.js → VerifiedBadge-D6L7mCdp.js} +2 -2
  17. package/dist/chunks/{card-CWqi1K-x.js → card--XUb1kFK.js} +4 -4
  18. package/dist/chunks/{card-C3y-j2TA.js → card-BrjnXf1N.js} +6 -6
  19. package/dist/chunks/{card-6z-m7UkM.js → card-BsTSF6aL.js} +10 -10
  20. package/dist/chunks/{card-Dlp8_KhV.js → card-CI7ntIHf.js} +5 -5
  21. package/dist/chunks/{card-DWpAv92l.js → card-Cu8QOSIw.js} +4 -4
  22. package/dist/chunks/{card-X9UVFgdR.js → card-ylC5NYbz.js} +241 -208
  23. package/dist/chunks/certificates-BnseQylH.js +209 -0
  24. package/dist/chunks/certificates-aJ-hvaP-.js +236 -0
  25. package/dist/chunks/{create-CAVC1qXJ.js → create-Bi7-j9Ri.js} +413 -413
  26. package/dist/chunks/{forgot-DoG6vXhq.js → forgot-DnixBqdc.js} +2 -2
  27. package/dist/chunks/{login-BWGylcSU.js → login-BWCQdEkv.js} +2 -2
  28. package/dist/chunks/map-CwsVIW79.js +2872 -0
  29. package/dist/chunks/{map-layers-sT-gTiD_.js → map-layers-BLiEYC4C.js} +5 -5
  30. package/dist/chunks/{organizations-ByVE2f0c.js → organizations-mc6FlSwe.js} +6 -6
  31. package/dist/chunks/{profile-CkwMFh82.js → profile-F7mr0poI.js} +3 -3
  32. package/dist/chunks/{registration-3GLgq-ae.js → registration-BRF4985_.js} +2 -2
  33. package/dist/chunks/{requests-BTpLXrNj.js → requests-7pD2ckdx.js} +4 -4
  34. package/dist/chunks/{requests-rWq8ok3C.js → requests-BCJN-CNx.js} +5 -5
  35. package/dist/chunks/{reset-CP9LsLkC.js → reset-OZCgLi6f.js} +2 -2
  36. package/dist/chunks/{useEntityPath-C5Owtidc.js → useEntityPath-8s0Y1tjA.js} +1 -1
  37. package/dist/chunks/{users-U1P6xCP4.js → users-CAEjpaI1.js} +6 -6
  38. package/dist/index.css +1 -1
  39. package/dist/index.js +40 -40
  40. package/migrations/20261016120000_map_layers.sql +156 -156
  41. package/migrations/20261016150000_password_reset.sql +15 -15
  42. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  43. package/package.json +1 -1
  44. package/server/dictionaries/index.ts +17 -17
  45. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  46. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  47. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  48. package/server/modules/surveyor/route.ts +4 -2
  49. package/server/modules/surveyor/schema.ts +18 -1
  50. package/server/modules/surveyor/services/applicationTile.ts +36 -8
  51. package/server/modules/surveyor/services/createApplication.ts +2 -3
  52. package/server/modules/surveyor/services/mapLayers.ts +61 -61
  53. package/server/modules/surveyor/services/registerSurveyor.ts +3 -4
  54. package/server/modules/surveyor/services/requestPasswordReset.ts +1 -0
  55. package/server/modules/surveyor/services/resetSurveyorPassword.ts +1 -0
  56. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
  57. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
  58. package/server/modules/surveyor/utils/certificateStatus.ts +15 -0
  59. package/server/modules/surveyor/utils/mail.ts +49 -20
  60. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
  61. package/server/resources/helpers/settlement_lookup.ts +7 -7
  62. package/server/resources/surveyor-admin/certificates.ts +27 -1
  63. package/server/resources/surveyor-admin/map_layers.ts +69 -69
  64. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  65. package/server/resources/surveyor-admin/organizations.ts +61 -61
  66. package/server/resources/surveyor-user/applications.ts +1 -1
  67. package/dist/chunks/certificates-Cwch72-o.js +0 -425
  68. package/dist/chunks/map-UTBxwT7-.js +0 -2776
@@ -1,32 +1,32 @@
1
- import type { ResourceContract } from '@opengis/fcore';
2
-
3
- export default {
4
- name: 'organization_surveyors',
5
- version: 1,
6
- table: 'surveyor.organization_surveyors',
7
- key: 'org_id',
8
- module: 'surveyor',
9
- operations: ["read"],
10
- fields: {
11
- org_id: { type: 'text', read: true, },
12
- surveyor_id: { type: 'text', read: true },
13
- first_name: { type: 'text', read: true },
14
- last_name: { type: 'text', read: true },
15
- middle_name: { type: 'text', read: true },
16
- enabled: { type: 'boolean', read: true },
17
- created_by: { type: 'text', read: true },
18
- created_at: { type: 'timestamp', read: true },
19
- registered_at: { type: 'timestamp', read: true },
20
- email: { type: 'text', read: true },
21
- phone: { type: 'text', read: true },
22
- certificate_id: {
23
- type: 'text',
24
- read: true,
25
- lookup: { table: 'surveyor.certificates', value: 'certificate_id', text: 'number_certificate' },
26
- },
27
- },
28
- joins: [{
29
- sql: `LEFT JOIN LATERAL (select first_name, last_name, middle_name, registered_at, email, phone, certificate_id, enabled AS surveyor_enabled from surveyor.surveyors s where s.surveyor_id = t.surveyor_id) as s on true`
30
- }]
31
-
1
+ import type { ResourceContract } from '@opengis/fcore';
2
+
3
+ export default {
4
+ name: 'organization_surveyors',
5
+ version: 1,
6
+ table: 'surveyor.organization_surveyors',
7
+ key: 'org_id',
8
+ module: 'surveyor',
9
+ operations: ["read"],
10
+ fields: {
11
+ org_id: { type: 'text', read: true, },
12
+ surveyor_id: { type: 'text', read: true },
13
+ first_name: { type: 'text', read: true },
14
+ last_name: { type: 'text', read: true },
15
+ middle_name: { type: 'text', read: true },
16
+ enabled: { type: 'boolean', read: true },
17
+ created_by: { type: 'text', read: true },
18
+ created_at: { type: 'timestamp', read: true },
19
+ registered_at: { type: 'timestamp', read: true },
20
+ email: { type: 'text', read: true },
21
+ phone: { type: 'text', read: true },
22
+ certificate_id: {
23
+ type: 'text',
24
+ read: true,
25
+ lookup: { table: 'surveyor.certificates', value: 'certificate_id', text: 'number_certificate' },
26
+ },
27
+ },
28
+ joins: [{
29
+ sql: `LEFT JOIN LATERAL (select first_name, last_name, middle_name, registered_at, email, phone, certificate_id, enabled AS surveyor_enabled from surveyor.surveyors s where s.surveyor_id = t.surveyor_id) as s on true`
30
+ }]
31
+
32
32
  } satisfies ResourceContract;
@@ -1,61 +1,61 @@
1
- import type { ResourceContract } from "@opengis/fcore";
2
- import { userLookup } from "../helpers/user_lookup.js";
3
-
4
- export default {
5
- version: 1,
6
- name: "organizations",
7
- module: "surveyor",
8
- title: "Організації",
9
- table: "surveyor.organizations",
10
- key: "org_id",
11
- display: ["name"],
12
- access: "admin",
13
- operations: ["read", "create", "update", "delete"],
14
- searchable: ["name", "email", "phone"],
15
- capabilities: ["notes", "files"],
16
- fields: {
17
- org_id: {
18
- type: "text",
19
- write: false,
20
- filterable: true,
21
- lookup: {
22
- table: "surveyor.organizations",
23
- value: "org_id",
24
- text: "name",
25
- },
26
- },
27
- name: { type: "string", write: true, required: true, searchable: true, sortable: true },
28
- legal_address: { type: "text", write: true },
29
- phone: { type: "string", write: true, required: true, searchable: true },
30
- email: { type: "string", write: true, required: true, searchable: true },
31
- scan_path: { type: "file", write: true },
32
- created_by: { type: "string", write: false, lookup: userLookup },
33
- updated_by: { type: "string", write: false, lookup: userLookup },
34
- created_at: { type: "timestamp", write: false, filterable: true, sortable: true },
35
- updated_at: { type: "timestamp", write: false, sortable: true },
36
- verified: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
37
- },
38
- relations: {
39
- surveyors: {
40
- resource: "organization_surveyors",
41
- localKey: "org_id",
42
- // `enabled` is the surveyor account flag; the membership flag is exposed separately.
43
- fields: [
44
- 't."org_id"',
45
- 't."surveyor_id"',
46
- 's."first_name"',
47
- 's."last_name"',
48
- 's."middle_name"',
49
- 's."email"',
50
- 's."phone"',
51
- 's."registered_at"',
52
- 's."certificate_id"',
53
- 's."surveyor_enabled" AS "enabled"',
54
- 't."enabled" AS "membership_enabled"',
55
- 't."created_by"',
56
- 't."created_at"',
57
- ],
58
- },
59
- applications: { resource: "applications", localKey: "org_id", foreignKey: "org_id" },
60
- },
61
- } satisfies ResourceContract;
1
+ import type { ResourceContract } from "@opengis/fcore";
2
+ import { userLookup } from "../helpers/user_lookup.js";
3
+
4
+ export default {
5
+ version: 1,
6
+ name: "organizations",
7
+ module: "surveyor",
8
+ title: "Організації",
9
+ table: "surveyor.organizations",
10
+ key: "org_id",
11
+ display: ["name"],
12
+ access: "admin",
13
+ operations: ["read", "create", "update", "delete"],
14
+ searchable: ["name", "email", "phone"],
15
+ capabilities: ["notes", "files"],
16
+ fields: {
17
+ org_id: {
18
+ type: "text",
19
+ write: false,
20
+ filterable: true,
21
+ lookup: {
22
+ table: "surveyor.organizations",
23
+ value: "org_id",
24
+ text: "name",
25
+ },
26
+ },
27
+ name: { type: "string", write: true, required: true, searchable: true, sortable: true },
28
+ legal_address: { type: "text", write: true },
29
+ phone: { type: "string", write: true, required: true, searchable: true },
30
+ email: { type: "string", write: true, required: true, searchable: true },
31
+ scan_path: { type: "file", write: true },
32
+ created_by: { type: "string", write: false, lookup: userLookup },
33
+ updated_by: { type: "string", write: false, lookup: userLookup },
34
+ created_at: { type: "timestamp", write: false, filterable: true, sortable: true },
35
+ updated_at: { type: "timestamp", write: false, sortable: true },
36
+ verified: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
37
+ },
38
+ relations: {
39
+ surveyors: {
40
+ resource: "organization_surveyors",
41
+ localKey: "org_id",
42
+ // `enabled` is the surveyor account flag; the membership flag is exposed separately.
43
+ fields: [
44
+ 't."org_id"',
45
+ 't."surveyor_id"',
46
+ 's."first_name"',
47
+ 's."last_name"',
48
+ 's."middle_name"',
49
+ 's."email"',
50
+ 's."phone"',
51
+ 's."registered_at"',
52
+ 's."certificate_id"',
53
+ 's."surveyor_enabled" AS "enabled"',
54
+ 't."enabled" AS "membership_enabled"',
55
+ 't."created_by"',
56
+ 't."created_at"',
57
+ ],
58
+ },
59
+ applications: { resource: "applications", localKey: "org_id", foreignKey: "org_id" },
60
+ },
61
+ } satisfies ResourceContract;
@@ -96,7 +96,7 @@ export default {
96
96
  cancelled_by: { type: "string", write: false, lookup: userLookup },
97
97
  created_by: { type: "string", write: false, lookup: actorLookup },
98
98
  updated_by: { type: "string", write: false, lookup: actorLookup },
99
- created_at: { type: "timestamp", write: false, sortable: true },
99
+ created_at: { type: "timestamp", write: false, filterable: true, sortable: true },
100
100
  updated_at: { type: "timestamp", write: false, sortable: true },
101
101
  },
102
102
  relations: {
@@ -1,425 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
- import { n, t as r } from "./useEntityPath-C5Owtidc.js";
4
- import { i, o as a, t as o } from "./resources-2e8RFqWR.js";
5
- import { t as s } from "./VerifiedBadge-bk0n-rlC.js";
6
- import { n as c } from "./account-types-Br7gx_D_.js";
7
- import { n as l } from "./filterQuery-CvfZrkTC.js";
8
- import { a as u, i as d, n as f, r as p, t as m } from "./RegistryToolbar-322DKUXi.js";
9
- import { t as h } from "./RegistryFormModal-R_iZYqGE.js";
10
- import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createTextVNode as S, createVNode as C, defineComponent as w, normalizeClass as T, openBlock as E, ref as D, renderList as O, toDisplayString as k, vModelText as A, withCtx as j, withDirectives as M } from "vue";
11
- import { RouterLink as N } from "vue-router";
12
- //#region admin/src/static/registry/certificates/resource.ts
13
- var P = "certificates", F = {
14
- resource: P,
15
- pageSize: 10,
16
- sort: "-created_at",
17
- columns: [
18
- {
19
- key: "fullName",
20
- label: "Прізвище, ім'я та по батькові геодезиста"
21
- },
22
- {
23
- key: "certificate",
24
- label: "Номер кваліфікаційного сертифіката"
25
- },
26
- {
27
- key: "verified",
28
- label: "Верифікація"
29
- },
30
- {
31
- key: "qualificationUpgrade",
32
- label: "Підвищення кваліфікації"
33
- },
34
- {
35
- key: "suspendedAt",
36
- label: "Дата призупинення"
37
- },
38
- {
39
- key: "terminatedAt",
40
- label: "Дата припинення"
41
- }
42
- ]
43
- }, I = {
44
- resource: P,
45
- view: "inline",
46
- fields: { verified: {
47
- component: "select",
48
- label: "Верифікація",
49
- placeholder: "Верифікація",
50
- width: 160,
51
- options: [{
52
- id: "verified",
53
- text: "Верифіковані"
54
- }, {
55
- id: "unverified",
56
- text: "Не верифіковані"
57
- }]
58
- } }
59
- };
60
- //#endregion
61
- //#region admin/src/static/registry/certificates/form.ts
62
- function L(e) {
63
- return [
64
- e.last_name,
65
- e.first_name,
66
- e.middle_name
67
- ].map((e) => String(e ?? "").trim()).filter(Boolean).join(" ");
68
- }
69
- function R(e) {
70
- let t = L(e);
71
- return {
72
- certificate_type: String(e.certificate_type ?? "").trim(),
73
- last_name: String(e.last_name ?? "").trim(),
74
- first_name: String(e.first_name ?? "").trim(),
75
- middle_name: String(e.middle_name ?? "").trim() || null,
76
- surveyor_name: t || null,
77
- number_certificate: String(e.number_certificate ?? "").trim(),
78
- date_certificate: e.date_certificate || null,
79
- name_school: String(e.name_school ?? "").trim() || null,
80
- surveyor_email: String(e.surveyor_email ?? "").trim() || null,
81
- surveyor_phone: String(e.surveyor_phone ?? "").trim() || null,
82
- isvalid: e.isvalid == null ? null : !!e.isvalid
83
- };
84
- }
85
- var z = {
86
- resource: P,
87
- emptyValues: () => ({
88
- certificate_type: c,
89
- last_name: "",
90
- first_name: "",
91
- middle_name: "",
92
- number_certificate: "",
93
- date_certificate: "",
94
- name_school: "",
95
- surveyor_email: "",
96
- surveyor_phone: "",
97
- isvalid: !0
98
- }),
99
- recordToValues: (e) => ({
100
- certificate_type: String(e.certificate_type ?? c),
101
- last_name: String(e.last_name ?? ""),
102
- first_name: String(e.first_name ?? ""),
103
- middle_name: String(e.middle_name ?? ""),
104
- number_certificate: String(e.number_certificate ?? ""),
105
- date_certificate: e.date_certificate ?? "",
106
- name_school: String(e.name_school ?? ""),
107
- surveyor_email: String(e.surveyor_email ?? ""),
108
- surveyor_phone: String(e.surveyor_phone ?? ""),
109
- isvalid: e.isvalid == null || !!e.isvalid
110
- }),
111
- save: async (e, t) => {
112
- let n = R(t);
113
- return e ? a(P, e, n) : o(P, n);
114
- },
115
- fields: {
116
- certificate_type: {
117
- component: "select",
118
- label: "Реєстр",
119
- col: 12,
120
- api: "/api/suggest/certificates/certificate_type",
121
- validators: ["required"]
122
- },
123
- last_name: {
124
- component: "text",
125
- label: "Прізвище",
126
- col: 4,
127
- validators: ["required"]
128
- },
129
- first_name: {
130
- component: "text",
131
- label: "Ім'я",
132
- col: 4,
133
- validators: ["required"]
134
- },
135
- middle_name: {
136
- component: "text",
137
- label: "По батькові",
138
- col: 4
139
- },
140
- number_certificate: {
141
- component: "text",
142
- label: "Номер кваліфікаційного сертифіката",
143
- col: 6,
144
- validators: ["required"]
145
- },
146
- date_certificate: {
147
- component: "date",
148
- label: "Дата видачі",
149
- col: 6
150
- },
151
- name_school: {
152
- component: "text",
153
- label: "Назва навчального закладу",
154
- col: 12
155
- },
156
- surveyor_email: {
157
- component: "email",
158
- label: "Email геодезиста",
159
- col: 6
160
- },
161
- surveyor_phone: {
162
- component: "text",
163
- label: "Телефон геодезиста",
164
- col: 6
165
- },
166
- isvalid: {
167
- component: "switcher",
168
- label: "Дійсний сертифікат",
169
- col: 12,
170
- view: "checkbox"
171
- }
172
- }
173
- }, B = {
174
- valid: {
175
- label: "Дійсний",
176
- dot: "bg-emerald-500",
177
- text: "text-emerald-700",
178
- bg: "bg-emerald-50",
179
- border: "border-emerald-200"
180
- },
181
- suspended: {
182
- label: "Призупинений",
183
- dot: "bg-amber-500",
184
- text: "text-amber-700",
185
- bg: "bg-amber-50",
186
- border: "border-amber-200"
187
- },
188
- no_data: {
189
- label: "Відсутні дані",
190
- dot: "bg-slate-400",
191
- text: "text-slate-600",
192
- bg: "bg-slate-100",
193
- border: "border-slate-200"
194
- }
195
- }, V = /* @__PURE__ */ e({
196
- VALIDITY_STATUS: () => B,
197
- filter: () => I,
198
- form: () => z,
199
- resource: () => P,
200
- table: () => F
201
- }), H = /*@__PURE__*/ w({
202
- __name: "index",
203
- setup(e, { expose: t }) {
204
- t();
205
- let a = F.columns, { query: o, filterValues: c, page: g, pageSize: v, listFilters: y, bindListLoader: b, refreshList: x } = u({
206
- arrayFilterKeys: ["verified"],
207
- buildFilters: l
208
- }), { detailPath: S } = r(), C = D(!1), w = D(a.map((e) => e.key)), T = D([]), E = D(0), O = D(!1), k = D(""), A = D(!1);
209
- function j(e) {
210
- return e.surveyor_name || [
211
- e.last_name,
212
- e.first_name,
213
- e.middle_name
214
- ].filter(Boolean).join(" ") || "—";
215
- }
216
- function M(e) {
217
- if (!e) return "";
218
- let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
219
- return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
220
- }
221
- let I = 0, L = _(() => O.value ? "Завантаження…" : k.value ? k.value : "Сертифікатів за заданими фільтрами не знайдено.");
222
- async function R() {
223
- let e = ++I;
224
- O.value = !0, k.value = "";
225
- try {
226
- let t = await i(P, {
227
- page: g.value,
228
- limit: v.value,
229
- sort: F.sort,
230
- search: o.value.trim() || void 0,
231
- filters: y.value
232
- });
233
- if (e !== I) return;
234
- T.value = t.rows ?? [], E.value = Number(t.total) || 0;
235
- } catch (t) {
236
- if (e !== I) return;
237
- T.value = [], E.value = 0, k.value = t instanceof Error ? t.message : "Не вдалося завантажити сертифікати";
238
- } finally {
239
- e === I && (O.value = !1);
240
- }
241
- }
242
- b(() => {
243
- R();
244
- });
245
- function z(e) {
246
- c.value = e;
247
- }
248
- function B(e) {
249
- w.value = w.value.includes(e) ? w.value.length > 1 ? w.value.filter((t) => t !== e) : w.value : [...w.value, e];
250
- }
251
- function H() {
252
- g.value === 1 ? x(() => {
253
- R();
254
- }) : g.value = 1;
255
- }
256
- let U = {
257
- columns: a,
258
- query: o,
259
- filterValues: c,
260
- page: g,
261
- pageSize: v,
262
- listFilters: y,
263
- bindListLoader: b,
264
- refreshList: x,
265
- detailPath: S,
266
- columnsOpen: C,
267
- visibleColumns: w,
268
- rows: T,
269
- total: E,
270
- loading: O,
271
- error: k,
272
- showAddModal: A,
273
- personName: j,
274
- formatDate: M,
275
- get requestId() {
276
- return I;
277
- },
278
- set requestId(e) {
279
- I = e;
280
- },
281
- emptyText: L,
282
- loadRows: R,
283
- onFilterValuesUpdate: z,
284
- toggleColumn: B,
285
- onCertificateSaved: H,
286
- AppIcon: n,
287
- get RouterLink() {
288
- return N;
289
- },
290
- PageHeader: d,
291
- VerifiedBadge: s,
292
- RegistryTable: p,
293
- TablePagination: f,
294
- RegistryFormModal: h,
295
- RegistryToolbar: m,
296
- get config() {
297
- return V;
298
- }
299
- };
300
- return Object.defineProperty(U, "__isScriptSetup", {
301
- enumerable: !1,
302
- value: !0
303
- }), U;
304
- }
305
- }), U = { class: "px-4" }, W = { class: "relative block" }, G = {
306
- type: "button",
307
- class: "inline-flex h-10 w-10 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 transition-colors hover:border-brand-300 hover:text-brand-700",
308
- "aria-label": "Експорт",
309
- title: "Експорт"
310
- }, K = { class: "relative" }, q = {
311
- key: 0,
312
- class: "absolute right-0 top-12 z-20 w-64 rounded-lg border border-slate-200 bg-white p-2 shadow-card-hover"
313
- }, J = ["checked", "onChange"], Y = { class: "mt-3 flex items-center justify-between border-t border-slate-100 pt-3 text-xs text-slate-400" }, X = { class: "font-semibold text-slate-600" }, Z = {
314
- key: 1,
315
- class: "break-words font-medium text-slate-700"
316
- }, Q = {
317
- key: 3,
318
- class: "text-slate-400"
319
- }, $ = {
320
- key: 4,
321
- class: "whitespace-nowrap text-slate-600"
322
- };
323
- function ee(e, t, n, r, i, a) {
324
- return E(), b("div", null, [
325
- C(r.PageHeader, {
326
- title: "Реєстр сертифікатів",
327
- subtitle: "Кваліфікаційні сертифікати геодезичного кабінету"
328
- }),
329
- x("section", U, [
330
- C(r.RegistryToolbar, {
331
- "filter-config": r.config.filter,
332
- "filter-values": r.filterValues,
333
- "onUpdate:filterValues": r.onFilterValuesUpdate
334
- }, {
335
- search: j(() => [x("label", W, [C(r.AppIcon, {
336
- name: "search",
337
- class: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"
338
- }), M(x("input", {
339
- "onUpdate:modelValue": t[0] ||= (e) => r.query = e,
340
- type: "search",
341
- placeholder: "Пошук (ПІБ, номер сертифіката)…",
342
- class: "h-10 w-full rounded-lg border border-slate-200 bg-white pl-9 pr-3 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:ring-1 focus:ring-brand-400"
343
- }, null, 512), [[A, r.query]])])]),
344
- actions: j(() => [x("button", G, [C(r.AppIcon, {
345
- name: "download",
346
- class: "h-4 w-4"
347
- })]), x("div", K, [x("button", {
348
- type: "button",
349
- class: "inline-flex h-10 w-10 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 transition-colors hover:border-brand-300 hover:text-brand-700",
350
- "aria-label": "Налаштувати колонки",
351
- onClick: t[1] ||= (e) => r.columnsOpen = !r.columnsOpen
352
- }, [C(r.AppIcon, {
353
- name: "columns-3",
354
- class: "h-4 w-4"
355
- })]), r.columnsOpen ? (E(), b("div", q, [t[5] ||= x("p", { class: "px-2 py-1 text-xs font-semibold uppercase tracking-wide text-slate-400" }, "Показати колонки", -1), (E(!0), b(g, null, O(r.columns, (e) => (E(), b("label", {
356
- key: e.key,
357
- class: "flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm text-slate-600 hover:bg-slate-50"
358
- }, [x("input", {
359
- type: "checkbox",
360
- checked: r.visibleColumns.includes(e.key),
361
- class: "h-4 w-4 accent-brand-600",
362
- onChange: (t) => r.toggleColumn(e.key)
363
- }, null, 40, J), S(" " + k(e.label), 1)]))), 128))])) : y("", !0)])]),
364
- _: 1
365
- }, 8, ["filter-config", "filter-values"]),
366
- x("div", Y, [x("span", null, [t[6] ||= S("Знайдено сертифікатів: ", -1), x("strong", X, k(r.total), 1)])]),
367
- C(r.RegistryTable, {
368
- class: "mt-3",
369
- rows: r.rows,
370
- columns: r.columns,
371
- "visible-keys": r.visibleColumns,
372
- "row-key": "certificate_id",
373
- "min-width": "1100px",
374
- "empty-text": r.emptyText
375
- }, {
376
- cell: j(({ row: e, column: t }) => [t === "fullName" ? (E(), v(r.RouterLink, {
377
- key: 0,
378
- to: r.detailPath(e.certificate_id),
379
- class: "block w-full max-w-full break-words text-left font-semibold text-brand-700 hover:text-brand-900 hover:underline"
380
- }, {
381
- default: j(() => [S(k(r.personName(e)), 1)]),
382
- _: 2
383
- }, 1032, ["to"])) : t === "certificate" ? (E(), b("span", Z, k(e.number_certificate || "—"), 1)) : t === "verified" && typeof e.isvalid == "boolean" ? (E(), v(r.VerifiedBadge, {
384
- key: 2,
385
- verified: e.isvalid
386
- }, null, 8, ["verified"])) : t === "verified" ? (E(), b("span", Q, "—")) : t === "qualificationUpgrade" ? (E(), b("span", $, k(r.formatDate(e.last_qualification_date) || "—"), 1)) : t === "suspendedAt" ? (E(), b("span", {
387
- key: 5,
388
- class: T(["whitespace-nowrap", e.certificate_suspension ? "font-medium text-danger-700" : "text-slate-400"])
389
- }, k(r.formatDate(e.certificate_suspension) || "—"), 3)) : t === "terminatedAt" ? (E(), b("span", {
390
- key: 6,
391
- class: T(["whitespace-nowrap", e.certificate_stopping ? "font-medium text-danger-700" : "text-slate-400"])
392
- }, k(e.certificate_stopping || "—"), 3)) : y("", !0)]),
393
- _: 1
394
- }, 8, [
395
- "rows",
396
- "columns",
397
- "visible-keys",
398
- "empty-text"
399
- ]),
400
- r.total > 0 ? (E(), v(r.TablePagination, {
401
- key: 0,
402
- page: r.page,
403
- "onUpdate:page": t[2] ||= (e) => r.page = e,
404
- "page-size": r.pageSize,
405
- "onUpdate:pageSize": t[3] ||= (e) => r.pageSize = e,
406
- total: r.total
407
- }, null, 8, [
408
- "page",
409
- "page-size",
410
- "total"
411
- ])) : y("", !0)
412
- ]),
413
- C(r.RegistryFormModal, {
414
- modelValue: r.showAddModal,
415
- "onUpdate:modelValue": t[4] ||= (e) => r.showAddModal = e,
416
- title: "Новий сертифікат",
417
- config: r.config.form,
418
- width: "max-w-3xl",
419
- onSaved: r.onCertificateSaved
420
- }, null, 8, ["modelValue", "config"])
421
- ]);
422
- }
423
- var te = /*#__PURE__*/ t(H, [["render", ee], ["__file", "C:/softpro/surveyor/admin/src/pages/certificates/index.vue"]]);
424
- //#endregion
425
- export { te as default };