@opengis/gis 0.1.80 → 0.1.82
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.css +1 -1
- package/dist/index.js +3263 -2789
- package/dist/index.umd.cjs +30 -30
- package/module/test/cls/doc_status.json +31 -31
- package/module/test/map/address/addr.yml +6 -0
- package/module/test/map/address/index.yml +22 -0
- package/module/test/map/address/street.yml +16 -0
- package/module/test/map/address2/addr.json +9 -0
- package/module/test/map/address2/index.json +35 -0
- package/module/test/map/address2/street.json +19 -0
- package/module/test/map/address3.yml +52 -0
- package/module/test/map/address4.json +74 -0
- package/module/test/map/mbd.json +243 -0
- package/module/test/select/core.user_uid.sql +1 -1
- package/module/test/table/data_address.street.table.json +70 -0
- package/package.json +61 -59
- package/server/migrations/services.sql +3 -0
- package/server/plugins/mapnik/funcs/map.proto +241 -241
- package/server/routes/gis/registers/funcs/classifiers.js +18 -3
- package/server/routes/gis/registers/funcs/handleRegistryRequest.js +4 -2
- package/server/routes/gis/services/add.service.js +51 -16
- package/server/routes/gis/services/get.services.js +24 -3
- package/server/routes/map/controllers/mapFormat.js +15 -5
- package/server/routes/map/controllers/marker_icon.js +2 -1
- package/server/routes/map/index.mjs +2 -0
- package/server/routes/map/vtile1.js +2 -1
package/package.json
CHANGED
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/gis",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"author": "Softpro",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist/*",
|
|
9
|
-
"module/*",
|
|
10
|
-
"server/*",
|
|
11
|
-
"plugin.js",
|
|
12
|
-
"utils.js",
|
|
13
|
-
"config.js",
|
|
14
|
-
"README.md",
|
|
15
|
-
"LICENSE"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"patch": "npm version patch && git push && npm publish",
|
|
19
|
-
"dev": "node server",
|
|
20
|
-
"front": "vite dev",
|
|
21
|
-
"build-lib": "vite build",
|
|
22
|
-
"build:admin": "vite build admin",
|
|
23
|
-
"build": "vite build",
|
|
24
|
-
"preview": "vite preview",
|
|
25
|
-
"prod": "NODE_ENV=production node server",
|
|
26
|
-
"docs:install": "npm install --prefix ./docs",
|
|
27
|
-
"docs:dev": "npm run --prefix ./docs docs:dev",
|
|
28
|
-
"docs:build": "npm run --prefix ./docs docs:build",
|
|
29
|
-
"docs:preview": "npm run --prefix ./docs docs:preview",
|
|
30
|
-
"prepublishOnly": "npm run build"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@mapbox/sphericalmercator": "1.2.0",
|
|
34
|
-
"carto": "0.16.3"
|
|
35
|
-
},
|
|
36
|
-
"peerDependencies": {
|
|
37
|
-
"@opengis/fastify-table": "^
|
|
38
|
-
},
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"@opengis/
|
|
45
|
-
"@opengis/
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/gis",
|
|
3
|
+
"version": "0.1.82",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"author": "Softpro",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/*",
|
|
9
|
+
"module/*",
|
|
10
|
+
"server/*",
|
|
11
|
+
"plugin.js",
|
|
12
|
+
"utils.js",
|
|
13
|
+
"config.js",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"patch": "npm version patch && git push && npm publish",
|
|
19
|
+
"dev": "node server",
|
|
20
|
+
"front": "vite dev",
|
|
21
|
+
"build-lib": "vite build",
|
|
22
|
+
"build:admin": "vite build admin",
|
|
23
|
+
"build": "vite build",
|
|
24
|
+
"preview": "vite preview",
|
|
25
|
+
"prod": "NODE_ENV=production node server",
|
|
26
|
+
"docs:install": "npm install --prefix ./docs",
|
|
27
|
+
"docs:dev": "npm run --prefix ./docs docs:dev",
|
|
28
|
+
"docs:build": "npm run --prefix ./docs docs:build",
|
|
29
|
+
"docs:preview": "npm run --prefix ./docs docs:preview",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@mapbox/sphericalmercator": "1.2.0",
|
|
34
|
+
"carto": "0.16.3"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@opengis/fastify-table": "^2.0.13"
|
|
38
|
+
},
|
|
39
|
+
"resolutions": {
|
|
40
|
+
"rollup": "4.30.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"yaml": "2.8.1",
|
|
44
|
+
"@opengis/form": "^0.0.28",
|
|
45
|
+
"@opengis/core": "^0.0.23",
|
|
46
|
+
"@opengis/fastify-table": "^2.0.13",
|
|
47
|
+
"@opengis/filter": "^0.1.7",
|
|
48
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
49
|
+
"axios": "^1.11.0",
|
|
50
|
+
"eslint": "8.49.0",
|
|
51
|
+
"eslint-config-airbnb": "19.0.4",
|
|
52
|
+
"lucide-vue-next": "^0.514.0",
|
|
53
|
+
"sass-embedded": "1.86.3",
|
|
54
|
+
"vite": "^6.3.5",
|
|
55
|
+
"vue": "^3.5.13",
|
|
56
|
+
"vue-router": "4.5.1",
|
|
57
|
+
"vuedraggable": "^4.1.0",
|
|
58
|
+
"typescript": "^5.9.2",
|
|
59
|
+
"@opengis/table": "^0.0.27"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -49,6 +49,9 @@ CREATE TABLE if not exists gis.services
|
|
|
49
49
|
REFERENCES gis.group_list (group_id)
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
+
alter table gis.services add column if not exists template text;
|
|
53
|
+
comment on column gis.services.template is 'Назва шаблону';
|
|
54
|
+
|
|
52
55
|
DROP INDEX if exists gis.gis_services_category_gin_idx;
|
|
53
56
|
|
|
54
57
|
CREATE INDEX gis_services_category_gin_idx
|
|
@@ -1,241 +1,241 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
message render_in {
|
|
5
|
-
string path = 1;
|
|
6
|
-
string name = 2;
|
|
7
|
-
repeated double bbox = 3 [packed=true];
|
|
8
|
-
string tile = 4;
|
|
9
|
-
string xml = 5;
|
|
10
|
-
int32 width = 6;
|
|
11
|
-
int32 height = 7;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
message render_out {
|
|
16
|
-
string err = 1;
|
|
17
|
-
string base64 = 2;
|
|
18
|
-
string tile = 3;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message xml_in {
|
|
22
|
-
string path = 1;
|
|
23
|
-
string name = 2;
|
|
24
|
-
string xml = 3;
|
|
25
|
-
bool reload = 4;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
message xml_out {
|
|
29
|
-
string err = 1;
|
|
30
|
-
bool is_ok = 2;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
message cmd_in {
|
|
34
|
-
string cmd = 1;
|
|
35
|
-
string svg = 2;
|
|
36
|
-
string filename = 3;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
message cmd_out {
|
|
40
|
-
string err = 1;
|
|
41
|
-
string base64 = 2;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
message gdal_in {
|
|
45
|
-
string name = 1;
|
|
46
|
-
string path = 2;
|
|
47
|
-
string out = 3;
|
|
48
|
-
string params = 4;
|
|
49
|
-
}
|
|
50
|
-
message gdal_out {
|
|
51
|
-
string result = 1;
|
|
52
|
-
string err = 2;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
message clear_tiles_in {
|
|
56
|
-
string path = 1;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
message clear_tiles_out {
|
|
60
|
-
oneof clear_message {
|
|
61
|
-
bool ok = 1;
|
|
62
|
-
string err = 2;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message empty {}
|
|
67
|
-
|
|
68
|
-
message statusRenderInfo {
|
|
69
|
-
string name = 1;
|
|
70
|
-
bool isActive = 2;
|
|
71
|
-
float workTime = 3;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
message statusInfo {
|
|
75
|
-
repeated statusRenderInfo info = 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
message printMapOut {
|
|
79
|
-
string map = 1;
|
|
80
|
-
string err = 2;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
message xyz {
|
|
84
|
-
float x = 1;
|
|
85
|
-
float y = 2;
|
|
86
|
-
float z = 3;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
message printMapIn {
|
|
90
|
-
string baseurl = 1;
|
|
91
|
-
string baseImg = 2;
|
|
92
|
-
repeated string xml = 3;
|
|
93
|
-
string overlayXml = 4;
|
|
94
|
-
string overlay = 5;
|
|
95
|
-
int32 width = 6;
|
|
96
|
-
int32 height = 7;
|
|
97
|
-
repeated double bbox = 8;
|
|
98
|
-
xyz pos = 9;
|
|
99
|
-
string geojsonSettings = 10;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
message log_in {
|
|
103
|
-
uint32 rows = 1;
|
|
104
|
-
string level = 2;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
message log_out {
|
|
108
|
-
repeated string logs = 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
message sqlToShpIn {
|
|
112
|
-
string db = 1;
|
|
113
|
-
string host = 2;
|
|
114
|
-
string port = 3;
|
|
115
|
-
string sql = 4;
|
|
116
|
-
string savePath = 5;
|
|
117
|
-
string shpName = 6;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
message shapeOut {
|
|
121
|
-
string zipPath = 1;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
message fileIn {
|
|
125
|
-
bytes fileBytes = 1;
|
|
126
|
-
string relativeFilepath = 2;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
message deleteFileIn {
|
|
130
|
-
string dir = 1;
|
|
131
|
-
repeated string objectList = 2;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
message fileManagerOut {
|
|
135
|
-
bool status = 1;
|
|
136
|
-
string operation = 2;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
message checkFilesDir {
|
|
140
|
-
string dir = 1;
|
|
141
|
-
repeated string filesSearch = 2;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
enum status {
|
|
145
|
-
LOADING = 0;
|
|
146
|
-
OK = 1;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
message filesStatus {
|
|
150
|
-
status fileLoadingStatus = 1;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
message fileListIn {
|
|
154
|
-
string dir = 1;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
message fileInfo {
|
|
158
|
-
repeated fileInfoL fileInfoList = 1;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
message fileInfoL {
|
|
162
|
-
oneof fileInfo {
|
|
163
|
-
fileInfoObj file = 1;
|
|
164
|
-
dirInfoObj dir = 2;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
message fileInfoObj {
|
|
169
|
-
string type = 1;
|
|
170
|
-
string birthtime = 2;
|
|
171
|
-
string name = 3;
|
|
172
|
-
uint64 size = 4;
|
|
173
|
-
string ext = 5;
|
|
174
|
-
string server = 6;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
message dirInfoObj {
|
|
178
|
-
string type = 1;
|
|
179
|
-
string birthtime = 2;
|
|
180
|
-
string name = 3;
|
|
181
|
-
uint64 size = 4;
|
|
182
|
-
uint64 count = 5;
|
|
183
|
-
string server = 6;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
message deleteOut {
|
|
187
|
-
repeated deleteObjSuccess success = 1;
|
|
188
|
-
repeated deleteObjError error = 2;
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
message deleteObjSuccess {
|
|
193
|
-
string object = 1;
|
|
194
|
-
string type = 2;
|
|
195
|
-
string status = 3;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
message deleteObjError {
|
|
199
|
-
string object = 1;
|
|
200
|
-
string fullPath = 2;
|
|
201
|
-
string result = 3;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
message readDirIn {
|
|
205
|
-
string dir = 1;
|
|
206
|
-
repeated string filter = 2;
|
|
207
|
-
string fullPath = 3;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
message readDirOut {
|
|
211
|
-
repeated string res = 1;
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
message downloadFileIn {
|
|
216
|
-
string filePath = 1;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
message downloadFileOut {
|
|
220
|
-
bytes chunk_data = 1;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
service Map {
|
|
225
|
-
rpc Render(render_in) returns (render_out) {}
|
|
226
|
-
rpc RenderXML(render_in) returns (render_out) {}
|
|
227
|
-
rpc LoadXML(xml_in) returns (xml_out) {}
|
|
228
|
-
rpc MarkerIcon(cmd_in) returns (cmd_out) {}
|
|
229
|
-
rpc Gdal(gdal_in) returns (gdal_out) {}
|
|
230
|
-
rpc ClearTiles(clear_tiles_in) returns (clear_tiles_out) {}
|
|
231
|
-
rpc RenderStatus(empty) returns (statusInfo) {}
|
|
232
|
-
rpc PrintMap(printMapIn) returns (printMapOut) {}
|
|
233
|
-
rpc Log(log_in) returns (log_out) {}
|
|
234
|
-
rpc SqlToShp(sqlToShpIn) returns (shapeOut) {}
|
|
235
|
-
rpc uploadFile(fileIn) returns (fileManagerOut) {}
|
|
236
|
-
rpc deleteFiles(deleteFileIn) returns (deleteOut) {}
|
|
237
|
-
rpc checkFiles(checkFilesDir) returns (filesStatus) {}
|
|
238
|
-
rpc fileList(fileListIn) returns (fileInfo) {}
|
|
239
|
-
rpc readDir(readDirIn) returns (readDirOut) {}
|
|
240
|
-
rpc downloadFile(downloadFileIn) returns (stream downloadFileOut) {}
|
|
241
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
message render_in {
|
|
5
|
+
string path = 1;
|
|
6
|
+
string name = 2;
|
|
7
|
+
repeated double bbox = 3 [packed=true];
|
|
8
|
+
string tile = 4;
|
|
9
|
+
string xml = 5;
|
|
10
|
+
int32 width = 6;
|
|
11
|
+
int32 height = 7;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
message render_out {
|
|
16
|
+
string err = 1;
|
|
17
|
+
string base64 = 2;
|
|
18
|
+
string tile = 3;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message xml_in {
|
|
22
|
+
string path = 1;
|
|
23
|
+
string name = 2;
|
|
24
|
+
string xml = 3;
|
|
25
|
+
bool reload = 4;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message xml_out {
|
|
29
|
+
string err = 1;
|
|
30
|
+
bool is_ok = 2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message cmd_in {
|
|
34
|
+
string cmd = 1;
|
|
35
|
+
string svg = 2;
|
|
36
|
+
string filename = 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message cmd_out {
|
|
40
|
+
string err = 1;
|
|
41
|
+
string base64 = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message gdal_in {
|
|
45
|
+
string name = 1;
|
|
46
|
+
string path = 2;
|
|
47
|
+
string out = 3;
|
|
48
|
+
string params = 4;
|
|
49
|
+
}
|
|
50
|
+
message gdal_out {
|
|
51
|
+
string result = 1;
|
|
52
|
+
string err = 2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message clear_tiles_in {
|
|
56
|
+
string path = 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message clear_tiles_out {
|
|
60
|
+
oneof clear_message {
|
|
61
|
+
bool ok = 1;
|
|
62
|
+
string err = 2;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message empty {}
|
|
67
|
+
|
|
68
|
+
message statusRenderInfo {
|
|
69
|
+
string name = 1;
|
|
70
|
+
bool isActive = 2;
|
|
71
|
+
float workTime = 3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message statusInfo {
|
|
75
|
+
repeated statusRenderInfo info = 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message printMapOut {
|
|
79
|
+
string map = 1;
|
|
80
|
+
string err = 2;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message xyz {
|
|
84
|
+
float x = 1;
|
|
85
|
+
float y = 2;
|
|
86
|
+
float z = 3;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message printMapIn {
|
|
90
|
+
string baseurl = 1;
|
|
91
|
+
string baseImg = 2;
|
|
92
|
+
repeated string xml = 3;
|
|
93
|
+
string overlayXml = 4;
|
|
94
|
+
string overlay = 5;
|
|
95
|
+
int32 width = 6;
|
|
96
|
+
int32 height = 7;
|
|
97
|
+
repeated double bbox = 8;
|
|
98
|
+
xyz pos = 9;
|
|
99
|
+
string geojsonSettings = 10;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message log_in {
|
|
103
|
+
uint32 rows = 1;
|
|
104
|
+
string level = 2;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message log_out {
|
|
108
|
+
repeated string logs = 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message sqlToShpIn {
|
|
112
|
+
string db = 1;
|
|
113
|
+
string host = 2;
|
|
114
|
+
string port = 3;
|
|
115
|
+
string sql = 4;
|
|
116
|
+
string savePath = 5;
|
|
117
|
+
string shpName = 6;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message shapeOut {
|
|
121
|
+
string zipPath = 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message fileIn {
|
|
125
|
+
bytes fileBytes = 1;
|
|
126
|
+
string relativeFilepath = 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message deleteFileIn {
|
|
130
|
+
string dir = 1;
|
|
131
|
+
repeated string objectList = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message fileManagerOut {
|
|
135
|
+
bool status = 1;
|
|
136
|
+
string operation = 2;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
message checkFilesDir {
|
|
140
|
+
string dir = 1;
|
|
141
|
+
repeated string filesSearch = 2;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
enum status {
|
|
145
|
+
LOADING = 0;
|
|
146
|
+
OK = 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
message filesStatus {
|
|
150
|
+
status fileLoadingStatus = 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
message fileListIn {
|
|
154
|
+
string dir = 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
message fileInfo {
|
|
158
|
+
repeated fileInfoL fileInfoList = 1;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
message fileInfoL {
|
|
162
|
+
oneof fileInfo {
|
|
163
|
+
fileInfoObj file = 1;
|
|
164
|
+
dirInfoObj dir = 2;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
message fileInfoObj {
|
|
169
|
+
string type = 1;
|
|
170
|
+
string birthtime = 2;
|
|
171
|
+
string name = 3;
|
|
172
|
+
uint64 size = 4;
|
|
173
|
+
string ext = 5;
|
|
174
|
+
string server = 6;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
message dirInfoObj {
|
|
178
|
+
string type = 1;
|
|
179
|
+
string birthtime = 2;
|
|
180
|
+
string name = 3;
|
|
181
|
+
uint64 size = 4;
|
|
182
|
+
uint64 count = 5;
|
|
183
|
+
string server = 6;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
message deleteOut {
|
|
187
|
+
repeated deleteObjSuccess success = 1;
|
|
188
|
+
repeated deleteObjError error = 2;
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
message deleteObjSuccess {
|
|
193
|
+
string object = 1;
|
|
194
|
+
string type = 2;
|
|
195
|
+
string status = 3;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message deleteObjError {
|
|
199
|
+
string object = 1;
|
|
200
|
+
string fullPath = 2;
|
|
201
|
+
string result = 3;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
message readDirIn {
|
|
205
|
+
string dir = 1;
|
|
206
|
+
repeated string filter = 2;
|
|
207
|
+
string fullPath = 3;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
message readDirOut {
|
|
211
|
+
repeated string res = 1;
|
|
212
|
+
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
message downloadFileIn {
|
|
216
|
+
string filePath = 1;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
message downloadFileOut {
|
|
220
|
+
bytes chunk_data = 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
service Map {
|
|
225
|
+
rpc Render(render_in) returns (render_out) {}
|
|
226
|
+
rpc RenderXML(render_in) returns (render_out) {}
|
|
227
|
+
rpc LoadXML(xml_in) returns (xml_out) {}
|
|
228
|
+
rpc MarkerIcon(cmd_in) returns (cmd_out) {}
|
|
229
|
+
rpc Gdal(gdal_in) returns (gdal_out) {}
|
|
230
|
+
rpc ClearTiles(clear_tiles_in) returns (clear_tiles_out) {}
|
|
231
|
+
rpc RenderStatus(empty) returns (statusInfo) {}
|
|
232
|
+
rpc PrintMap(printMapIn) returns (printMapOut) {}
|
|
233
|
+
rpc Log(log_in) returns (log_out) {}
|
|
234
|
+
rpc SqlToShp(sqlToShpIn) returns (shapeOut) {}
|
|
235
|
+
rpc uploadFile(fileIn) returns (fileManagerOut) {}
|
|
236
|
+
rpc deleteFiles(deleteFileIn) returns (deleteOut) {}
|
|
237
|
+
rpc checkFiles(checkFilesDir) returns (filesStatus) {}
|
|
238
|
+
rpc fileList(fileListIn) returns (fileInfo) {}
|
|
239
|
+
rpc readDir(readDirIn) returns (readDirOut) {}
|
|
240
|
+
rpc downloadFile(downloadFileIn) returns (stream downloadFileOut) {}
|
|
241
|
+
}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
import { getSelectVal, getSelect } from '@opengis/fastify-table/utils.js';
|
|
1
|
+
import { getSelectVal, getSelect, getTemplates } from '@opengis/fastify-table/utils.js';
|
|
2
2
|
|
|
3
|
-
export async function attachClassifiers(rowOrRows, classifiers
|
|
3
|
+
export async function attachClassifiers(rowOrRows, classifiers, table) {
|
|
4
4
|
const rows = Array.isArray(rowOrRows) ? rowOrRows : [rowOrRows];
|
|
5
5
|
|
|
6
|
+
const list = getTemplates(['cls', 'select']);
|
|
7
|
+
|
|
8
|
+
if (table) {
|
|
9
|
+
await Promise.all(rows.map(async row => {
|
|
10
|
+
await Promise.all(Object.keys(row).filter(key => list.map(el => el[0]).includes(`${table}.${key}`)).map(async key => {
|
|
11
|
+
const arr = await getSelectVal({ name: `${table}.${key}`, values: [row[key]], ar: true });
|
|
12
|
+
const val = arr?.find?.(el => el.id === row[key]);
|
|
13
|
+
if (val?.text) { row[`${key}_data`] = val; }
|
|
14
|
+
row[key] = val?.text || val || row[key]; // for frontend
|
|
15
|
+
row[`${key}_text`] = val?.text || val || row[key]; // legacy?
|
|
16
|
+
}));
|
|
17
|
+
}));
|
|
18
|
+
return rowOrRows;
|
|
19
|
+
}
|
|
20
|
+
|
|
6
21
|
await Promise.all(rows.map(async row => {
|
|
7
|
-
classifiers.filter(item => item.classifier && item.name && row[item.name]).map(async ({ name, classifier }) => {
|
|
22
|
+
(classifiers || []).filter(item => item.classifier && item.name && row[item.name]).map(async ({ name, classifier }) => {
|
|
8
23
|
const arr = await getSelectVal({ name: classifier, values: [row[name]], ar: true });
|
|
9
24
|
const val = arr?.find?.(el => el.id === row[name]);
|
|
10
25
|
if (val?.text) { row[`${name}_data`] = val; }
|
|
@@ -49,10 +49,12 @@ export async function handleRegistryRequest({ settings, query, object_id, offset
|
|
|
49
49
|
//if (!row) return reply.code(404).send({ message: 'Object not found', status: 404 });
|
|
50
50
|
if (!row) throw new Error('Object not found');
|
|
51
51
|
|
|
52
|
-
await attachClassifiers(row, classifiers);
|
|
52
|
+
await attachClassifiers(row, classifiers, table_name);
|
|
53
53
|
|
|
54
54
|
return {
|
|
55
55
|
row,
|
|
56
|
+
card,
|
|
57
|
+
d: 1,
|
|
56
58
|
columns: visibleColumns,
|
|
57
59
|
register_id,
|
|
58
60
|
name,
|
|
@@ -86,7 +88,7 @@ export async function handleRegistryRequest({ settings, query, object_id, offset
|
|
|
86
88
|
pg.query(totalQuery),
|
|
87
89
|
]);
|
|
88
90
|
|
|
89
|
-
const rows = await attachClassifiers(dataRes.rows, classifiers);
|
|
91
|
+
const rows = await attachClassifiers(dataRes.rows, classifiers, table_name);
|
|
90
92
|
const total = parseInt(countRes.rows[0]?.count || 0, 10);
|
|
91
93
|
|
|
92
94
|
const listConfig = {};
|