@opengis/gis 0.2.17 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1459 -1450
- package/dist/index.umd.cjs +28 -28
- package/module/gis/table/gis.ogc_service.table.json +6 -0
- package/module/test/cls/doc_status.json +31 -31
- package/module/test/select/core.user_uid.sql +1 -1
- package/package.json +5 -3
- package/server/migrations/maps.sql +30 -0
- package/server/routes/map/maps/get.map.js +2 -4
- package/server/routes/map/vtile1.js +2 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"text": "Діючий",
|
|
5
|
-
"color": "#1ab394"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"id": "2",
|
|
9
|
-
"text": "Зупинений",
|
|
10
|
-
"color": "#ed82c8"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "3",
|
|
14
|
-
"text": "Скасований",
|
|
15
|
-
"color": "#4a4a4a"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"id": "5",
|
|
19
|
-
"text": "Проектний",
|
|
20
|
-
"color": "#6495ed"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"id": "7",
|
|
24
|
-
"text": "Очікує розгляду",
|
|
25
|
-
"color": "#92b8ef"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "10",
|
|
29
|
-
"text": "Архівний",
|
|
30
|
-
"color": "#d48428"
|
|
31
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "1",
|
|
4
|
+
"text": "Діючий",
|
|
5
|
+
"color": "#1ab394"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"id": "2",
|
|
9
|
+
"text": "Зупинений",
|
|
10
|
+
"color": "#ed82c8"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "3",
|
|
14
|
+
"text": "Скасований",
|
|
15
|
+
"color": "#4a4a4a"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "5",
|
|
19
|
+
"text": "Проектний",
|
|
20
|
+
"color": "#6495ed"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "7",
|
|
24
|
+
"text": "Очікує розгляду",
|
|
25
|
+
"color": "#92b8ef"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "10",
|
|
29
|
+
"text": "Архівний",
|
|
30
|
+
"color": "#d48428"
|
|
31
|
+
}
|
|
32
32
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
select uid, coalesce(coalesce(sur_name,'')||coalesce(' '||user_name,'') ||coalesce(' '||father_name,''),login) as text from admin.users
|
|
1
|
+
select uid, coalesce(coalesce(sur_name,'')||coalesce(' '||user_name,'') ||coalesce(' '||father_name,''),login) as text from admin.users
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/gis",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Softpro",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
+
"dump": "bun ./node_modules/@opengis/fastify-table/dist/script/dump.js",
|
|
19
|
+
"migrate": "MIGRATE=true bun ./node_modules/@opengis/fastify-table/dist/script/migrate.js",
|
|
18
20
|
"start1": "bun server",
|
|
19
21
|
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
|
|
20
22
|
"fix": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
48
|
"@opengis/core": "^0.0.23",
|
|
47
|
-
"@opengis/fastify-table": "^2.0.
|
|
49
|
+
"@opengis/fastify-table": "^2.0.114",
|
|
48
50
|
"@opengis/filter": "^0.1.25",
|
|
49
51
|
"@opengis/form": "^0.0.48",
|
|
50
52
|
"@opengis/table": "^0.0.27",
|
|
@@ -64,4 +66,4 @@
|
|
|
64
66
|
"vue-router": "4.5.1",
|
|
65
67
|
"vuedraggable": "^4.1.0"
|
|
66
68
|
}
|
|
67
|
-
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
create schema if not exists gis;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE if not exists gis.maps
|
|
4
|
+
(
|
|
5
|
+
map_id text DEFAULT next_id(), -- -
|
|
6
|
+
name text , -- Назва
|
|
7
|
+
center numeric[] , -- Геометрія центру
|
|
8
|
+
zoom integer DEFAULT 10, -- Зум
|
|
9
|
+
widgets json,
|
|
10
|
+
layers text[],
|
|
11
|
+
map_key text , -- Унікальний ключ
|
|
12
|
+
description text , -- Опис
|
|
13
|
+
image text , -- Фото
|
|
14
|
+
holder text , -- Власник/Утримувач/Відповідальний
|
|
15
|
+
keywords text[] , -- Ключові слова
|
|
16
|
+
is_public boolean DEFAULT true, -- Чи публічна карта
|
|
17
|
+
srid integer DEFAULT 4326, -- Система координат
|
|
18
|
+
config jsonb , -- Опціональна конфігурація
|
|
19
|
+
created_by text , -- -
|
|
20
|
+
updated_by text , -- -
|
|
21
|
+
updated_at timestamp without time zone , -- -
|
|
22
|
+
created_at timestamp without time zone DEFAULT now(),
|
|
23
|
+
CONSTRAINT maps_pkey PRIMARY KEY (map_id)
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
-- update gis.maps set center1=case when center is not null then array[st_x(center),st_y(center)] else null end
|
|
27
|
+
alter table gis.maps add column if not exists center numeric[];
|
|
28
|
+
alter table gis.maps add column if not exists zoom int;
|
|
29
|
+
alter table gis.maps add column if not exists widgets json;
|
|
30
|
+
alter table gis.maps add column if not exists layers text[];
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import yaml from 'js-yaml';
|
|
3
1
|
import {
|
|
4
|
-
getMeta, getTemplate, pgClients, getTemplates,
|
|
2
|
+
getMeta, getTemplate, pgClients, getTemplates, yml2json,
|
|
5
3
|
} from '@opengis/fastify-table/utils.js';
|
|
6
4
|
|
|
7
5
|
const table = 'gis.maps';
|
|
@@ -59,7 +57,7 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
|
|
|
59
57
|
const layerData = await getTemplate('layer', layer);
|
|
60
58
|
const serviceData = layerData || await pg.query('select service_id as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center from gis.services where service_id=$1', [layer]).then(el => el.rows?.[0]);
|
|
61
59
|
Object.assign(serviceData || {}, { count: totals[serviceData?.source_path || ''] || 0 });
|
|
62
|
-
if (serviceData) { serviceData.style = typeof serviceData.style === 'object' ? serviceData.style :
|
|
60
|
+
if (serviceData) { serviceData.style = typeof serviceData.style === 'object' ? serviceData.style : yml2json(serviceData.style); }
|
|
63
61
|
layers.push({ ...(serviceData || {}), id: layer, visible: !!serviceData });
|
|
64
62
|
}));
|
|
65
63
|
}
|
|
@@ -89,11 +89,11 @@ export default async function vtile({
|
|
|
89
89
|
const { name, type: type1, sql: sql1 } = cls || getColumnCLS(table, col.data || key) || {};
|
|
90
90
|
// console.log({ name, type, sql });
|
|
91
91
|
if (name && type1 === 'cls') {
|
|
92
|
-
return `(select name from admin.cls where parent='${name}' and code::text
|
|
92
|
+
return `(select name from admin.cls where parent='${name}' and code::text=q.${key}::text limit 1) as "${key}_text","${key}"::text`;
|
|
93
93
|
}
|
|
94
94
|
if (type1 === 'select' && sql1) {
|
|
95
95
|
const { fields = [] } = await pg.query(`${sql1} limit 0`);
|
|
96
|
-
return `(select "${fields[1].name}" from (${sql1})s${idx} where "${fields[0].name}"::text="${key}"::text limit 1) as "${key}_text","${key}"::text`;
|
|
96
|
+
return `(select "${fields[1].name}" from (${sql1})s${idx} where "${fields[0].name}"::text=q."${key}"::text limit 1) as "${key}_text","${key}"::text`;
|
|
97
97
|
}
|
|
98
98
|
return `"${key}"::text`;
|
|
99
99
|
}));
|