@opengis/bi 1.1.1 → 1.1.2
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/config.js +12 -12
- package/dist/bi.js +1 -1
- package/dist/bi.umd.cjs +104 -104
- package/dist/{import-file-ZfIxjCYO.js → import-file-XFI3CaVb.js} +10185 -10409
- package/dist/vs-donut-al85JwBt.js +148 -0
- package/dist/{vs-funnel-bar-BNzjr6Wy.js → vs-funnel-bar-mWZ8lvEq.js} +5 -5
- package/dist/{vs-list-B2mp3dCt.js → vs-list-1QDnN3pH.js} +1532 -1535
- package/dist/{vs-map-C_48NvNE.js → vs-map-CwR6ZYur.js} +110 -119
- package/dist/{vs-map-cluster-Xj2mZ5dv.js → vs-map-cluster-YdXTBIVf.js} +71 -72
- package/dist/{vs-number-CA07snAP.js → vs-number-CRUhHKym.js} +3 -3
- package/dist/{vs-table-CDujqyoC.js → vs-table-OddIdr1s.js} +6 -6
- package/dist/{vs-text-BlAqTDjw.js → vs-text-CQ9vn0qO.js} +4 -4
- package/package.json +7 -12
- package/server/plugins/vite.js +69 -69
- package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
- package/server/routes/dataset/controllers/createDatasetPost.js +1 -2
- package/server/routes/dataset/utils/convertJSONToXls.js +1 -3
- package/server/routes/map/controllers/cluster.js +125 -125
- package/server/routes/map/controllers/clusterVtile.js +166 -166
- package/server/routes/map/controllers/geojson.js +127 -127
- package/server/routes/map/controllers/map.js +69 -69
- package/server/routes/map/controllers/utils/downloadClusterData.js +44 -44
- package/server/routes/map/controllers/vtile.js +183 -183
- package/utils.js +12 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as V,
|
|
3
|
-
import {
|
|
1
|
+
import { c as G, l as A, p as R, b as P, V as Z, a as q, d as D, e as K, m as H } from "./vs-list-1QDnN3pH.js";
|
|
2
|
+
import { _ as V, V as W, c as J, e as Q, I as U, g as X } from "./import-file-XFI3CaVb.js";
|
|
3
|
+
import { createElementBlock as m, createCommentVNode as S, openBlock as p, createElementVNode as l, normalizeClass as I, Fragment as N, renderList as O, toDisplayString as F, normalizeStyle as Y, resolveComponent as g, withDirectives as z, createBlock as M, resolveDynamicComponent as j, createVNode as w, vShow as C } from "vue";
|
|
4
4
|
const $ = {
|
|
5
|
-
components: { legendIcon:
|
|
5
|
+
components: { legendIcon: A, closeIcon: G },
|
|
6
6
|
props: {
|
|
7
7
|
mapId: { type: String },
|
|
8
8
|
colors: { type: Array },
|
|
@@ -29,8 +29,8 @@ const $ = {
|
|
|
29
29
|
return [...this.sizes].sort((t, s) => t - s);
|
|
30
30
|
},
|
|
31
31
|
maxWidht() {
|
|
32
|
-
var
|
|
33
|
-
const t = ((
|
|
32
|
+
var n;
|
|
33
|
+
const t = ((n = this.sizes) == null ? void 0 : n.length) - 1;
|
|
34
34
|
return this.calcSize(t);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -49,33 +49,33 @@ const $ = {
|
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "absolute flex items-end w-fit bottom-[10px] max-w-[80%] left-[50%] translate-x-[-50%] bg-[rgba(255,255,255,0.7)] p-[10px] rounded"
|
|
51
51
|
}, te = { class: "w-[80px] mr-[10px]" }, se = ["title"], oe = { class: "text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]" };
|
|
52
|
-
function re(t, s,
|
|
52
|
+
function re(t, s, n, a, e, o) {
|
|
53
53
|
var d;
|
|
54
|
-
return (d =
|
|
55
|
-
|
|
56
|
-
s[0] || (s[0] =
|
|
57
|
-
|
|
58
|
-
class: I([
|
|
54
|
+
return (d = n.sizes) != null && d.length ? (p(), m("div", ee, [
|
|
55
|
+
l("div", te, [
|
|
56
|
+
s[0] || (s[0] = l("p", { class: "text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]" }, " Дані відсутні ", -1)),
|
|
57
|
+
l("div", {
|
|
58
|
+
class: I([o.sizeClass(t.index), "w-full border border-gray-500"])
|
|
59
59
|
}, null, 2)
|
|
60
60
|
]),
|
|
61
|
-
|
|
61
|
+
o.sortedSizes.length ? (p(!0), m(N, { key: 0 }, O(o.sortedSizes, (c, i) => {
|
|
62
62
|
var h, u, _, y, f, b, v, x;
|
|
63
63
|
return p(), m("div", {
|
|
64
64
|
class: "w-[80px]",
|
|
65
|
-
title: i === ((h =
|
|
65
|
+
title: i === ((h = o.sortedSizes) == null ? void 0 : h.length) - 1 ? ">" + c : i == ((u = o.sortedSizes) == null ? void 0 : u.length) - 1 ? ">" + o.sortedSizes[((_ = o.sortedSizes) == null ? void 0 : _.length) - 1] : c + "-" + o.sortedSizes[i + 1]
|
|
66
66
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class: I([
|
|
67
|
+
l("p", oe, F(i === ((y = o.sortedSizes) == null ? void 0 : y.length) - 1 ? ">" + parseInt(c) : i == ((f = o.sortedSizes) == null ? void 0 : f.length) - 1 ? ">" + parseInt(o.sortedSizes[((b = o.sortedSizes) == null ? void 0 : b.length) - 1]) : parseInt(c) + "-" + parseInt(o.sortedSizes[i + 1])), 1),
|
|
68
|
+
l("div", {
|
|
69
|
+
class: I([o.sizeClass(i), "w-full border border-r-0 border-gray-500"]),
|
|
70
70
|
style: Y({
|
|
71
|
-
backgroundColor: ((x = (v = e.palette) == null ? void 0 : v[
|
|
71
|
+
backgroundColor: ((x = (v = e.palette) == null ? void 0 : v[n.color]) == null ? void 0 : x[i]) || n.color
|
|
72
72
|
})
|
|
73
73
|
}, null, 6)
|
|
74
74
|
], 8, se);
|
|
75
75
|
}), 256)) : S("", !0)
|
|
76
76
|
])) : S("", !0);
|
|
77
77
|
}
|
|
78
|
-
const ae = /* @__PURE__ */ V($, [["render", re]]),
|
|
78
|
+
const ae = /* @__PURE__ */ V($, [["render", re]]), ne = {}, le = {
|
|
79
79
|
xmlns: "http://www.w3.org/2000/svg",
|
|
80
80
|
width: "24",
|
|
81
81
|
height: "24",
|
|
@@ -88,27 +88,27 @@ const ae = /* @__PURE__ */ V($, [["render", re]]), le = {}, ne = {
|
|
|
88
88
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map"
|
|
89
89
|
};
|
|
90
90
|
function ie(t, s) {
|
|
91
|
-
return p(), m("svg",
|
|
92
|
-
|
|
91
|
+
return p(), m("svg", le, s[0] || (s[0] = [
|
|
92
|
+
l("path", {
|
|
93
93
|
stroke: "none",
|
|
94
94
|
d: "M0 0h24v24H0z",
|
|
95
95
|
fill: "none"
|
|
96
96
|
}, null, -1),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
l("path", { d: "M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13" }, null, -1),
|
|
98
|
+
l("path", { d: "M9 4v13" }, null, -1),
|
|
99
|
+
l("path", { d: "M15 7v13" }, null, -1)
|
|
100
100
|
]));
|
|
101
101
|
}
|
|
102
|
-
const pe = /* @__PURE__ */ V(
|
|
103
|
-
mixins: [
|
|
102
|
+
const pe = /* @__PURE__ */ V(ne, [["render", ie]]), ce = {
|
|
103
|
+
mixins: [J, K],
|
|
104
104
|
components: {
|
|
105
|
-
VsMapSetting:
|
|
105
|
+
VsMapSetting: D,
|
|
106
106
|
VsClusterLegend: ae,
|
|
107
107
|
VsMapGoHome: q,
|
|
108
|
-
VsList:
|
|
109
|
-
VsMapSlotLayers:
|
|
108
|
+
VsList: Z,
|
|
109
|
+
VsMapSlotLayers: P,
|
|
110
110
|
// VsListbar,
|
|
111
|
-
VsBar:
|
|
111
|
+
VsBar: W
|
|
112
112
|
},
|
|
113
113
|
data() {
|
|
114
114
|
return {
|
|
@@ -116,8 +116,8 @@ const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
|
|
|
116
116
|
kattotg: "",
|
|
117
117
|
options: [
|
|
118
118
|
{ id: "map", text: "Карта", component: pe },
|
|
119
|
-
{ id: "table", text: "Таблиця", component:
|
|
120
|
-
{ id: "chart", text: "Віджет", component:
|
|
119
|
+
{ id: "table", text: "Таблиця", component: U },
|
|
120
|
+
{ id: "chart", text: "Віджет", component: X }
|
|
121
121
|
],
|
|
122
122
|
activeTab: "map",
|
|
123
123
|
mapId: `map-${Math.floor(Math.random() * 1e3)}`,
|
|
@@ -142,7 +142,7 @@ const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
|
|
|
142
142
|
},
|
|
143
143
|
methods: {
|
|
144
144
|
async getMapData() {
|
|
145
|
-
const t = await
|
|
145
|
+
const t = await Q.get(
|
|
146
146
|
`/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`
|
|
147
147
|
);
|
|
148
148
|
this.data = t.data, this.$emit("update:widgetData", this.data), setTimeout(() => {
|
|
@@ -151,10 +151,10 @@ const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
|
|
|
151
151
|
});
|
|
152
152
|
},
|
|
153
153
|
async loadHandler() {
|
|
154
|
-
var
|
|
155
|
-
this.baseColor = ((
|
|
154
|
+
var a, e, o, d;
|
|
155
|
+
this.baseColor = ((a = this.data.style) == null ? void 0 : a.color) || "blue";
|
|
156
156
|
const t = ["case"];
|
|
157
|
-
(d = (
|
|
157
|
+
(d = (o = (e = this.data) == null ? void 0 : e.sizes) == null ? void 0 : o.toReversed()) == null || d.forEach((c, i) => {
|
|
158
158
|
var h, u;
|
|
159
159
|
t.push([">", ["get", "metric"], c]), t.push((u = (h = R[this.baseColor]) == null ? void 0 : h.toReversed()) == null ? void 0 : u[i]), i++;
|
|
160
160
|
}), t.push("gray");
|
|
@@ -168,23 +168,22 @@ const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
|
|
|
168
168
|
url: `${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,
|
|
169
169
|
style: s
|
|
170
170
|
}), this.map.getLayer("highlighted") && this.map.removeLayer("highlighted"), this.map.getSource("highlighted") && this.map.removeSource("highlighted");
|
|
171
|
-
const
|
|
172
|
-
this.kattotg &&
|
|
171
|
+
const n = ["case"];
|
|
172
|
+
this.kattotg && n.push(
|
|
173
173
|
["==", ["to-string", ["get", "name"]], String(this.kattotg)],
|
|
174
174
|
"red"
|
|
175
|
-
),
|
|
175
|
+
), n.push("transparent"), this.map.addLayer({
|
|
176
176
|
id: "highlighted",
|
|
177
177
|
type: "fill",
|
|
178
178
|
source: "bi",
|
|
179
179
|
"source-layer": "bi",
|
|
180
180
|
paint: {
|
|
181
|
-
"fill-color":
|
|
181
|
+
"fill-color": n,
|
|
182
182
|
"fill-opacity": 0.6
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
},
|
|
186
186
|
async createMap() {
|
|
187
|
-
var s, r;
|
|
188
187
|
const t = {
|
|
189
188
|
version: 8,
|
|
190
189
|
glyphs: "https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",
|
|
@@ -195,7 +194,7 @@ const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
|
|
|
195
194
|
container: this.mapId,
|
|
196
195
|
style: t,
|
|
197
196
|
center: [31, 48.5],
|
|
198
|
-
zoom:
|
|
197
|
+
zoom: 5,
|
|
199
198
|
minZoom: 3,
|
|
200
199
|
maxZoom: 20,
|
|
201
200
|
attributionControl: !1
|
|
@@ -205,72 +204,72 @@ const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
|
|
|
205
204
|
})
|
|
206
205
|
), this.map.on("load", () => {
|
|
207
206
|
this.loadHandler();
|
|
208
|
-
}), this.map.on("mousemove", (
|
|
209
|
-
this.moveMouseHadler(
|
|
207
|
+
}), this.map.on("mousemove", (s) => {
|
|
208
|
+
this.moveMouseHadler(s);
|
|
210
209
|
}), this.map.on("mouseout", () => {
|
|
211
|
-
var
|
|
212
|
-
this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (
|
|
210
|
+
var s;
|
|
211
|
+
this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (s = this.popup) == null || s.remove();
|
|
213
212
|
});
|
|
214
213
|
},
|
|
215
214
|
moveMouseHadler(t) {
|
|
216
215
|
var s;
|
|
217
216
|
try {
|
|
218
|
-
const
|
|
219
|
-
if (!
|
|
217
|
+
const n = this.map.queryRenderedFeatures(t.point), a = ((s = n[0]) == null ? void 0 : s.properties) || {};
|
|
218
|
+
if (!n.length) {
|
|
220
219
|
this.map.getCanvas().style.cursor = "", this.popupElement && this.popupElement.remove();
|
|
221
220
|
return;
|
|
222
221
|
}
|
|
223
222
|
this.map.getCanvas().style.cursor = "pointer", this.popupElement && this.popupElement.remove(), this.popupElement = document.createElement("div"), this.popupElement.className = "absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28", this.popupElement.style.backgroundColor = "rgba(255, 255, 255, 0.7)", this.popupElement.innerHTML = `<div class="px-2 py-1 text-sm font-semibold text-gray-800 border-b border-gray-200 border-solid rounded-t-lg">
|
|
224
|
-
${(
|
|
223
|
+
${(a == null ? void 0 : a.x) || (a == null ? void 0 : a.title) || (a == null ? void 0 : a.name) || ""}
|
|
225
224
|
</div>
|
|
226
225
|
|
|
227
226
|
<div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 ">
|
|
228
227
|
<span class="flex items-center">
|
|
229
228
|
<span class="font-medium mr-[6px]">Значення</span>
|
|
230
229
|
</span>
|
|
231
|
-
<span>${(
|
|
230
|
+
<span>${(a == null ? void 0 : a.metric) || 0}</span>
|
|
232
231
|
</div>`;
|
|
233
232
|
const e = this.map.project(t.lngLat);
|
|
234
233
|
this.popupElement.style.left = `${e.x}px`, this.popupElement.style.top = `${e.y - 60}px`, this.map.getContainer().appendChild(this.popupElement);
|
|
235
|
-
} catch (
|
|
236
|
-
console.error(
|
|
234
|
+
} catch (n) {
|
|
235
|
+
console.error(n);
|
|
237
236
|
}
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
239
|
}, de = { class: "h-full" }, he = { class: "flex items-start justify-between mb-[6px] w-full" }, ue = { class: "text-gray-800 font-[600]" }, me = { class: "flex gap-2" }, ge = ["onClick"], ye = ["id"], fe = ["id"], be = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" }, ve = { class: "h-[calc(250px)]" };
|
|
241
|
-
function xe(t, s,
|
|
240
|
+
function xe(t, s, n, a, e, o) {
|
|
242
241
|
var y, f, b, v, x, k, L, E, B, T;
|
|
243
242
|
const d = g("VsMapSetting"), c = g("VsMapSlotLayers"), i = g("VsMapGoHome"), h = g("VsClusterLegend"), u = g("VsList"), _ = g("VsBar");
|
|
244
243
|
return p(), m("div", de, [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
(p(!0), m(N, null, O(e.options, (
|
|
249
|
-
class: I(["p-1 text-gray-700 border rounded", [e.activeTab === (
|
|
250
|
-
onClick: (_e) => e.activeTab =
|
|
244
|
+
l("div", he, [
|
|
245
|
+
l("h3", ue, F(t.title), 1),
|
|
246
|
+
l("div", me, [
|
|
247
|
+
(p(!0), m(N, null, O(e.options, (r) => (p(), m("button", {
|
|
248
|
+
class: I(["p-1 text-gray-700 border rounded", [e.activeTab === (r == null ? void 0 : r.id) ? "ring-2 ring-blue-500" : ""]]),
|
|
249
|
+
onClick: (_e) => e.activeTab = r == null ? void 0 : r.id
|
|
251
250
|
}, [
|
|
252
|
-
(p(),
|
|
251
|
+
(p(), M(j(r == null ? void 0 : r.component), {
|
|
253
252
|
height: "16",
|
|
254
253
|
width: "16"
|
|
255
254
|
}))
|
|
256
255
|
], 10, ge))), 256))
|
|
257
256
|
])
|
|
258
257
|
]),
|
|
259
|
-
|
|
258
|
+
z(l("div", {
|
|
260
259
|
class: "relative w-full h-[calc(100%-40px)]",
|
|
261
260
|
id: `wrapper-${e.mapId}`
|
|
262
261
|
}, [
|
|
263
|
-
|
|
262
|
+
l("div", {
|
|
264
263
|
id: e.mapId,
|
|
265
|
-
class: "h-
|
|
264
|
+
class: "h-[calc(100%-40px)] w-full flex items-end min-h-[250px]"
|
|
266
265
|
}, null, 8, fe),
|
|
267
|
-
e.showSetting ? (p(),
|
|
266
|
+
e.showSetting ? (p(), M(d, {
|
|
268
267
|
key: 0,
|
|
269
268
|
map: e.map,
|
|
270
269
|
coordinates: e.coordinatesByMouse
|
|
271
270
|
}, null, 8, ["map", "coordinates"])) : S("", !0),
|
|
272
271
|
w(c, { map: e.map }, null, 8, ["map"]),
|
|
273
|
-
|
|
272
|
+
l("div", be, [
|
|
274
273
|
w(i, {
|
|
275
274
|
map: e.map,
|
|
276
275
|
bbox: (y = e.data) == null ? void 0 : y.bounds
|
|
@@ -287,21 +286,21 @@ function xe(t, s, r, o, e, a) {
|
|
|
287
286
|
], 8, ye), [
|
|
288
287
|
[C, e.activeTab == "map"]
|
|
289
288
|
]),
|
|
290
|
-
|
|
289
|
+
z(w(u, {
|
|
291
290
|
mapId: e.mapId,
|
|
292
291
|
source: (v = e.data) == null ? void 0 : v.rows,
|
|
293
292
|
total: ((x = e.data) == null ? void 0 : x.total) || 0,
|
|
294
293
|
count: ((k = e.data) == null ? void 0 : k.count) || 0,
|
|
295
|
-
onKattotg: s[0] || (s[0] = (
|
|
294
|
+
onKattotg: s[0] || (s[0] = (r) => e.kattotg = r)
|
|
296
295
|
}, null, 8, ["mapId", "source", "total", "count"]), [
|
|
297
296
|
[C, e.activeTab == "table"]
|
|
298
297
|
]),
|
|
299
|
-
|
|
300
|
-
(E = (L = e.data) == null ? void 0 : L.rows) != null && E.length ? (p(),
|
|
298
|
+
z(l("div", ve, [
|
|
299
|
+
(E = (L = e.data) == null ? void 0 : L.rows) != null && E.length ? (p(), M(_, {
|
|
301
300
|
key: 0,
|
|
302
|
-
source: (T = (B = e.data) == null ? void 0 : B.rows) == null ? void 0 : T.map((
|
|
303
|
-
title:
|
|
304
|
-
metric:
|
|
301
|
+
source: (T = (B = e.data) == null ? void 0 : B.rows) == null ? void 0 : T.map((r) => ({
|
|
302
|
+
title: r == null ? void 0 : r.title,
|
|
303
|
+
metric: r == null ? void 0 : r.metric
|
|
305
304
|
}))
|
|
306
305
|
}, null, 8, ["source"])) : S("", !0)
|
|
307
306
|
], 512), [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as c, c as o, f as n } from "./import-file-
|
|
2
|
-
import {
|
|
1
|
+
import { _ as c, c as o, f as n } from "./import-file-XFI3CaVb.js";
|
|
2
|
+
import { createElementBlock as i, openBlock as m, toDisplayString as s } from "vue";
|
|
3
3
|
const u = {
|
|
4
4
|
name: "VsNumber",
|
|
5
5
|
mixins: [o],
|
|
@@ -47,7 +47,7 @@ const u = {
|
|
|
47
47
|
}
|
|
48
48
|
}, h = { class: "text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center" };
|
|
49
49
|
function x(e, t, r, f, l, a) {
|
|
50
|
-
return
|
|
50
|
+
return m(), i("div", h, s(a.prefix) + s(a.formattedNumber), 1);
|
|
51
51
|
}
|
|
52
52
|
const b = /* @__PURE__ */ c(u, [["render", x]]);
|
|
53
53
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as m, c as f,
|
|
2
|
-
import {
|
|
1
|
+
import { _ as m, c as f, d as _, a as b } from "./import-file-XFI3CaVb.js";
|
|
2
|
+
import { createElementBlock as a, openBlock as r, createElementVNode as s, Fragment as n, renderList as c, toDisplayString as d } from "vue";
|
|
3
3
|
const x = {
|
|
4
4
|
name: "VsTable",
|
|
5
5
|
mixins: [f],
|
|
@@ -39,20 +39,20 @@ const x = {
|
|
|
39
39
|
class: "xl:min-w-[120px] min-w-48"
|
|
40
40
|
}, F = { class: "flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1" }, T = { class: "divide-y divide-gray-200" }, B = { class: "text-gray-600" };
|
|
41
41
|
function E(t, e, o, l, N, S) {
|
|
42
|
-
return
|
|
42
|
+
return r(), a("div", y, [
|
|
43
43
|
s("div", g, [
|
|
44
44
|
s("div", w, [
|
|
45
45
|
s("table", k, [
|
|
46
46
|
s("thead", v, [
|
|
47
47
|
s("tr", D, [
|
|
48
|
-
(
|
|
48
|
+
(r(!0), a(n, null, c(t.dimensions, (i) => (r(), a("th", $, [
|
|
49
49
|
s("div", F, d(i), 1)
|
|
50
50
|
]))), 256))
|
|
51
51
|
])
|
|
52
52
|
]),
|
|
53
53
|
s("tbody", T, [
|
|
54
|
-
(
|
|
55
|
-
(
|
|
54
|
+
(r(!0), a(n, null, c(t.sourceData, (i, p) => (r(), a("tr", { key: p }, [
|
|
55
|
+
(r(!0), a(n, null, c(t.dimensions, (u, h) => (r(), a("td", {
|
|
56
56
|
key: h,
|
|
57
57
|
class: "py-3 whitespace-nowrap"
|
|
58
58
|
}, [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as o, c as s, m as i } from "./import-file-
|
|
2
|
-
import {
|
|
1
|
+
import { _ as o, c as s, m as i } from "./import-file-XFI3CaVb.js";
|
|
2
|
+
import { createElementBlock as r, openBlock as n, createCommentVNode as a } from "vue";
|
|
3
3
|
const c = {
|
|
4
4
|
name: "VsText",
|
|
5
5
|
mixins: [s],
|
|
@@ -24,11 +24,11 @@ const c = {
|
|
|
24
24
|
}
|
|
25
25
|
}, u = ["id"], d = ["innerHTML"];
|
|
26
26
|
function l(t, m, x, h, e, _) {
|
|
27
|
-
return
|
|
27
|
+
return n(), r("div", {
|
|
28
28
|
id: e.uniqueID,
|
|
29
29
|
class: "relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"
|
|
30
30
|
}, [
|
|
31
|
-
e.markedText ? (
|
|
31
|
+
e.markedText ? (n(), r("div", {
|
|
32
32
|
key: 0,
|
|
33
33
|
innerHTML: e.markedText
|
|
34
34
|
}, null, 8, d)) : a("", !0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/bi",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "BI data visualization module",
|
|
5
5
|
"main": "dist/bi.js",
|
|
6
6
|
"browser": "dist/bi.umd.cjs",
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
"test21": "node --test ./test/plugins/*",
|
|
25
25
|
"start": "node server.js",
|
|
26
26
|
"prod": "cross-env NODE_ENV=production npm run start",
|
|
27
|
-
"docs:
|
|
28
|
-
"docs:
|
|
29
|
-
"docs:
|
|
27
|
+
"docs:i": "npm install --prefix ./docs",
|
|
28
|
+
"docs:dev": "npm run --prefix ./docs docs:dev",
|
|
29
|
+
"docs:build": "npm run --prefix ./docs docs:build",
|
|
30
|
+
"docs:preview": "npm run --prefix ./docs docs:preview",
|
|
30
31
|
"adduser": "node script/adduser.js"
|
|
31
32
|
},
|
|
32
33
|
"keywords": [
|
|
@@ -44,8 +45,7 @@
|
|
|
44
45
|
"@jspreadsheet-ce/vue": "^5.0.0",
|
|
45
46
|
"@mapbox/sphericalmercator": "^1.2.0",
|
|
46
47
|
"@opengis/fastify-auth": "1.1.0",
|
|
47
|
-
"@opengis/fastify-
|
|
48
|
-
"@opengis/fastify-table": "1.4.1",
|
|
48
|
+
"@opengis/fastify-table": "1.4.9",
|
|
49
49
|
"@opengis/v3-core": "^0.3.93",
|
|
50
50
|
"@opengis/v3-filter": "^0.0.71",
|
|
51
51
|
"@turf/turf": "^7.1.0",
|
|
@@ -77,13 +77,8 @@
|
|
|
77
77
|
"eslint-plugin-vue": "^9.29.0",
|
|
78
78
|
"globals": "^15.10.0",
|
|
79
79
|
"prettier": "^3.3.3",
|
|
80
|
-
"sass": "^1.77.0",
|
|
81
80
|
"typescript": "^5.4.5",
|
|
82
81
|
"typescript-eslint": "~8.8.1",
|
|
83
|
-
"vitepress": "^1.6.3",
|
|
84
|
-
"vitepress-plugin-mermaid": "^2.0.16",
|
|
85
|
-
"vitepress-plugin-tabs": "^0.5.0",
|
|
86
|
-
"vitepress-sidebar": "1.30.2",
|
|
87
82
|
"vue-tsc": "^2.1.6"
|
|
88
83
|
}
|
|
89
|
-
}
|
|
84
|
+
}
|
package/server/plugins/vite.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import config from '../../config.js';
|
|
4
|
-
|
|
5
|
-
const { disableAuth } = config;
|
|
6
|
-
const isProduction = process.env.NODE_ENV === 'production';
|
|
7
|
-
|
|
8
|
-
async function plugin(fastify) {
|
|
9
|
-
// vite server
|
|
10
|
-
if (!isProduction) {
|
|
11
|
-
const vite = await import('vite');
|
|
12
|
-
|
|
13
|
-
const viteServer = await vite.createServer({
|
|
14
|
-
server: {
|
|
15
|
-
middlewareMode: true,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
// hot reload
|
|
19
|
-
viteServer.watcher.on('all', (d, t) => {
|
|
20
|
-
if (!t.includes('module') && !t.includes('templates')) return;
|
|
21
|
-
// console.log(d, t);
|
|
22
|
-
viteServer.ws.send({ type: 'full-reload' });
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// this is middleware for vite's dev servert
|
|
26
|
-
fastify.addHook('onRequest', async (req, reply) => {
|
|
27
|
-
// const { user } = req.session?.passport || {};
|
|
28
|
-
const next = () => new Promise((resolve) => {
|
|
29
|
-
viteServer.middlewares(req.raw, reply.raw, () => resolve());
|
|
30
|
-
});
|
|
31
|
-
await next();
|
|
32
|
-
});
|
|
33
|
-
fastify.get('*', async () => {});
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// From Build
|
|
38
|
-
fastify.get('*', async (req, reply) => {
|
|
39
|
-
// console.log(disableAuth)
|
|
40
|
-
if (!req.user && !disableAuth) return reply.redirect('/login');
|
|
41
|
-
const stream = fs.createReadStream('dist/index.html');
|
|
42
|
-
return reply
|
|
43
|
-
.headers({ 'Cache-Control': 'public, no-cache' })
|
|
44
|
-
.type('text/html')
|
|
45
|
-
.send(stream);
|
|
46
|
-
});
|
|
47
|
-
fastify.get('/assets/:file', async (req, reply) => {
|
|
48
|
-
const stream = fs.createReadStream(`dist/assets/${req.params.file}`);
|
|
49
|
-
const ext = path.extname(req.params.file);
|
|
50
|
-
const mime = {
|
|
51
|
-
'.js': 'text/javascript',
|
|
52
|
-
'.css': 'text/css',
|
|
53
|
-
'.woff2': 'application/font-woff',
|
|
54
|
-
'.png': 'image/png',
|
|
55
|
-
}[ext];
|
|
56
|
-
// reply.cacheControl('max-age', '1d');
|
|
57
|
-
return mime
|
|
58
|
-
? reply
|
|
59
|
-
.headers({
|
|
60
|
-
'Cache-Control': 'public, max-age=3600',
|
|
61
|
-
'Content-Encoding': 'identity',
|
|
62
|
-
})
|
|
63
|
-
.type(mime)
|
|
64
|
-
.send(stream)
|
|
65
|
-
: stream;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default plugin;
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import config from '../../config.js';
|
|
4
|
+
|
|
5
|
+
const { disableAuth } = config;
|
|
6
|
+
const isProduction = process.env.NODE_ENV === 'production';
|
|
7
|
+
|
|
8
|
+
async function plugin(fastify) {
|
|
9
|
+
// vite server
|
|
10
|
+
if (!isProduction) {
|
|
11
|
+
const vite = await import('vite');
|
|
12
|
+
|
|
13
|
+
const viteServer = await vite.createServer({
|
|
14
|
+
server: {
|
|
15
|
+
middlewareMode: true,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
// hot reload
|
|
19
|
+
viteServer.watcher.on('all', (d, t) => {
|
|
20
|
+
if (!t.includes('module') && !t.includes('templates')) return;
|
|
21
|
+
// console.log(d, t);
|
|
22
|
+
viteServer.ws.send({ type: 'full-reload' });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// this is middleware for vite's dev servert
|
|
26
|
+
fastify.addHook('onRequest', async (req, reply) => {
|
|
27
|
+
// const { user } = req.session?.passport || {};
|
|
28
|
+
const next = () => new Promise((resolve) => {
|
|
29
|
+
viteServer.middlewares(req.raw, reply.raw, () => resolve());
|
|
30
|
+
});
|
|
31
|
+
await next();
|
|
32
|
+
});
|
|
33
|
+
fastify.get('*', async () => {});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// From Build
|
|
38
|
+
fastify.get('*', async (req, reply) => {
|
|
39
|
+
// console.log(disableAuth)
|
|
40
|
+
if (!req.user && !disableAuth) return reply.redirect('/login');
|
|
41
|
+
const stream = fs.createReadStream('dist/index.html');
|
|
42
|
+
return reply
|
|
43
|
+
.headers({ 'Cache-Control': 'public, no-cache' })
|
|
44
|
+
.type('text/html')
|
|
45
|
+
.send(stream);
|
|
46
|
+
});
|
|
47
|
+
fastify.get('/assets/:file', async (req, reply) => {
|
|
48
|
+
const stream = fs.createReadStream(`dist/assets/${req.params.file}`);
|
|
49
|
+
const ext = path.extname(req.params.file);
|
|
50
|
+
const mime = {
|
|
51
|
+
'.js': 'text/javascript',
|
|
52
|
+
'.css': 'text/css',
|
|
53
|
+
'.woff2': 'application/font-woff',
|
|
54
|
+
'.png': 'image/png',
|
|
55
|
+
}[ext];
|
|
56
|
+
// reply.cacheControl('max-age', '1d');
|
|
57
|
+
return mime
|
|
58
|
+
? reply
|
|
59
|
+
.headers({
|
|
60
|
+
'Cache-Control': 'public, max-age=3600',
|
|
61
|
+
'Content-Encoding': 'identity',
|
|
62
|
+
})
|
|
63
|
+
.type(mime)
|
|
64
|
+
.send(stream)
|
|
65
|
+
: stream;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default plugin;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import yaml from 'js-yaml';
|
|
2
|
-
|
|
3
|
-
yaml.loadSafe = (yml) => {
|
|
4
|
-
try {
|
|
5
|
-
return yaml.load(yml);
|
|
6
|
-
} catch (err) {
|
|
7
|
-
return { error: err.toString() };
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default yaml;
|
|
1
|
+
import yaml from 'js-yaml';
|
|
2
|
+
|
|
3
|
+
yaml.loadSafe = (yml) => {
|
|
4
|
+
try {
|
|
5
|
+
return yaml.load(yml);
|
|
6
|
+
} catch (err) {
|
|
7
|
+
return { error: err.toString() };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default yaml;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
|
|
4
|
-
import { config, pgClients, getFolder } from '@opengis/fastify-table/utils.js';
|
|
5
|
-
import { file2json } from '@opengis/fastify-file/utils.js';
|
|
4
|
+
import { config, pgClients, getFolder, file2json } from '@opengis/fastify-table/utils.js';
|
|
6
5
|
|
|
7
6
|
import createTableQuery from '../utils/createTableQuery.js';
|
|
8
7
|
import executeQuery from '../utils/executeQuery.js';
|
|
@@ -3,9 +3,7 @@ import {
|
|
|
3
3
|
mkdir, readFile, writeFile,
|
|
4
4
|
} from 'fs/promises';
|
|
5
5
|
|
|
6
|
-
import { logger } from '@opengis/fastify-table/utils.js';
|
|
7
|
-
|
|
8
|
-
import { grpc } from '@opengis/fastify-file/utils.js';
|
|
6
|
+
import { logger, grpc } from '@opengis/fastify-table/utils.js';
|
|
9
7
|
|
|
10
8
|
const { jsonToXls } = grpc();
|
|
11
9
|
|