dmx-admin-ui 1.2.115 → 1.2.117

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dmx-admin-ui",
3
- "version": "1.2.115",
3
+ "version": "1.2.117",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -1,383 +0,0 @@
1
- import { defineComponent as W, ref as y, watch as j, onMounted as z, onUnmounted as D, resolveDirective as E, openBlock as $, createElementBlock as k, withDirectives as M, unref as w, renderSlot as R, createCommentVNode as T, createElementVNode as B } from "vue";
2
- import * as g from "echarts";
3
- const P = {
4
- backgroundColor: "transparent",
5
- textStyle: {},
6
- title: {
7
- textStyle: {
8
- color: "#eeeeee"
9
- },
10
- subtextStyle: {
11
- color: "#aaaaaa"
12
- }
13
- },
14
- categoryAxis: {
15
- axisLine: {
16
- lineStyle: {
17
- color: "#eeeeee"
18
- }
19
- },
20
- axisTick: {
21
- lineStyle: {
22
- color: "#eeeeee"
23
- }
24
- },
25
- axisLabel: {
26
- color: "#eeeeee"
27
- },
28
- splitLine: {
29
- lineStyle: {
30
- color: ["#aaaaaa"]
31
- }
32
- },
33
- splitArea: {
34
- show: !1,
35
- areaStyle: {
36
- color: ["#eeeeee"]
37
- }
38
- }
39
- },
40
- valueAxis: {
41
- axisLine: {
42
- show: !0,
43
- lineStyle: {
44
- color: "#eeeeee"
45
- }
46
- },
47
- axisTick: {
48
- show: !0,
49
- lineStyle: {
50
- color: "#eeeeee"
51
- }
52
- },
53
- axisLabel: {
54
- show: !0,
55
- color: "#eeeeee"
56
- },
57
- splitLine: {
58
- show: !0,
59
- lineStyle: {
60
- color: ["#aaaaaa"]
61
- }
62
- },
63
- splitArea: {
64
- show: !1,
65
- areaStyle: {
66
- color: ["#eeeeee"]
67
- }
68
- }
69
- },
70
- legend: {
71
- textStyle: {
72
- color: "#eeeeee"
73
- }
74
- },
75
- tooltip: {
76
- axisPointer: {
77
- lineStyle: {
78
- color: "#eeeeee",
79
- width: "1"
80
- },
81
- crossStyle: {
82
- color: "#eeeeee",
83
- width: "1"
84
- }
85
- }
86
- },
87
- timeline: {
88
- lineStyle: {
89
- color: "#eeeeee",
90
- width: 1
91
- },
92
- itemStyle: {
93
- color: "#dd6b66",
94
- borderWidth: 1
95
- },
96
- controlStyle: {
97
- color: "#eeeeee",
98
- borderColor: "#eeeeee",
99
- borderWidth: 0.5
100
- },
101
- checkpointStyle: {
102
- color: "#e43c59",
103
- borderColor: "#c23531"
104
- },
105
- label: {
106
- color: "#eeeeee"
107
- },
108
- emphasis: {
109
- itemStyle: {
110
- color: "#a9334c"
111
- },
112
- controlStyle: {
113
- color: "#eeeeee",
114
- borderColor: "#eeeeee",
115
- borderWidth: 0.5
116
- },
117
- label: {
118
- color: "#eeeeee"
119
- }
120
- }
121
- },
122
- visualMap: {
123
- color: [
124
- "#bf444c",
125
- "#d88273",
126
- "#f6efa6"
127
- ]
128
- },
129
- dataZoom: {
130
- backgroundColor: "rgba(47,69,84,0)",
131
- dataBackgroundColor: "rgba(255,255,255,0.3)",
132
- fillerColor: "rgba(167,183,204,0.4)",
133
- handleColor: "#a7b7cc",
134
- handleSize: "100%",
135
- textStyle: {
136
- color: "#eeeeee"
137
- }
138
- },
139
- markPoint: {
140
- label: {
141
- color: "#eeeeee"
142
- },
143
- emphasis: {
144
- label: {
145
- color: "#eeeeee"
146
- }
147
- }
148
- }
149
- }, h = {};
150
- function N(e, s = 0.5) {
151
- if (e.startsWith("rgba"))
152
- return e.replace(/[\d\.]+\)$/g, `${s})`);
153
- if (e.startsWith("rgb"))
154
- return e.replace("rgb", "rgba").replace(")", `, ${s})`);
155
- if (e.startsWith("#")) {
156
- if (e.length === 4) {
157
- const o = parseInt(e[1] + e[1], 16), n = parseInt(e[2] + e[2], 16), a = parseInt(e[3] + e[3], 16);
158
- return `rgba(${o}, ${n}, ${a}, ${s})`;
159
- }
160
- if (e.length === 7) {
161
- const o = parseInt(e.slice(1, 3), 16), n = parseInt(e.slice(3, 5), 16), a = parseInt(e.slice(5, 7), 16);
162
- return `rgba(${o}, ${n}, ${a}, ${s})`;
163
- }
164
- if (e.length === 9) {
165
- const o = parseInt(e.slice(1, 3), 16), n = parseInt(e.slice(3, 5), 16), a = parseInt(e.slice(5, 7), 16), c = parseInt(e.slice(7, 9), 16) / 255;
166
- return `rgba(${o}, ${n}, ${a}, ${c * s})`;
167
- }
168
- }
169
- return e.startsWith("hsl") ? e.startsWith("hsla") ? e.replace(/[\d\.]+\)$/g, `${s})`) : e.replace("hsl", "hsla").replace(")", `, ${s})`) : e.startsWith("hsla") ? e.replace(/[\d\.]+\)$/g, `${s})`) : e;
170
- }
171
- const u = (e = ["#eee", "#999"]) => (e = Array.isArray(e) ? e : [N(e, 0.7), e], {
172
- type: "linear",
173
- x: 0,
174
- x2: 0,
175
- y: 0,
176
- y2: 1,
177
- colorStops: [
178
- {
179
- offset: 0,
180
- color: e[0]
181
- },
182
- {
183
- offset: 1,
184
- color: e[1]
185
- }
186
- ]
187
- }), q = (e = -1) => {
188
- const s = $store.theme + $store.dark;
189
- if (!h[s]) {
190
- const o = $store.theme, n = {
191
- yellow: "#f59e0b",
192
- green: "#22c55e",
193
- purple: "#f43f5e",
194
- blue: "#3b82f6",
195
- red: "#f2140d"
196
- }, a = {
197
- yellow: "#eedd78",
198
- green: "#91ca8c",
199
- purple: "#e69d87",
200
- blue: "#73b9bc",
201
- red: "#dd6b66"
202
- };
203
- delete a[o], delete n[o];
204
- const c = [u($theme("primary"))];
205
- if ($store.dark) {
206
- for (const d in a)
207
- c.push(u(a[d]));
208
- for (const d in n)
209
- c.push(u(n[d]));
210
- } else {
211
- for (const d in n)
212
- c.push(u(n[d]));
213
- for (const d in a)
214
- c.push(u(a[d]));
215
- }
216
- h[s] = c;
217
- }
218
- return e > -1 ? h[s][e] : h[s];
219
- }, V = { class: "echarts" }, F = { class: "chart-slot" }, Z = /* @__PURE__ */ W({
220
- __name: "chart",
221
- props: {
222
- init: {
223
- type: Object,
224
- default: () => ({})
225
- },
226
- data: {
227
- type: [Boolean, Object],
228
- default: !1
229
- },
230
- type: String,
231
- asyncData: {
232
- type: [Function, String]
233
- }
234
- },
235
- setup(e) {
236
- const s = e, o = y(null), n = y(!0), a = y(null), c = () => {
237
- const t = $store.dark ? P : {};
238
- return t.color = q(), t;
239
- }, d = {
240
- type: "bar",
241
- yAxisIndex: 0,
242
- itemStyle: {
243
- borderRadius: [4, 4, 0, 0]
244
- }
245
- }, A = {
246
- yAxisIndex: 0,
247
- type: "line"
248
- }, b = y({}), C = (t, i) => {
249
- const { type: l = "line" } = t;
250
- let r = t || {};
251
- if (r.tooltip === void 0 && (r.tooltip = {}), r.mini)
252
- return r.grid = { left: 0, right: 0, bottom: 0 }, r.xAxis = {
253
- show: !1,
254
- data: Object.keys(i)
255
- }, r.yAxis = { type: "value", show: !1 }, t.type == "line" || !t.type ? r.series = {
256
- type: "line",
257
- areaStyle: {},
258
- smooth: !0
259
- } : r.series = {
260
- type: "bar"
261
- }, delete r.mini, r.series.data = Object.values(i), r;
262
- if (r.grid === void 0 && (r.grid = { top: 0, left: 0, right: 0, bottom: 80 }), r.legend === void 0 && (r.legend = {}), r.xAxis === void 0 && (r.xAxis = { type: "category" }), r.yAxis === void 0 && (r.yAxis = {}), r.series === void 0) {
263
- const p = [];
264
- i[0].forEach((S, f) => {
265
- if (f > 0) {
266
- const L = (Array.isArray(l) ? l[f - 1] : l) === "bar" ? d : A;
267
- p.push({ ...L });
268
- }
269
- }), r.series = p;
270
- }
271
- return typeof i == "object" && (r.dataset = {
272
- source: i
273
- }), r;
274
- }, m = (t) => {
275
- s.init.type == "pie" ? _(t) : s.init.type == "map" ? I(t) : O(t);
276
- }, _ = (t) => {
277
- const i = s.init;
278
- if (delete i.type, i.tooltip === void 0 && (i.tooltip = {}), i.legend === void 0 && (i.legend = {}), t) {
279
- if (i.series = [{
280
- type: "pie",
281
- // radius: ['40%', '70%'],
282
- // center: ['50%', '70%'],
283
- // startAngle: 180,
284
- // endAngle: 360,
285
- // label: {
286
- // alignTo: 'edge',
287
- // formatter: '{name}|{b}\n{time|{c}}',
288
- // minMargin: 5,
289
- // edgeDistance: 10,
290
- // lineHeight: 15
291
- // },
292
- labelLine: {
293
- length: 15,
294
- length2: 0,
295
- maxSurfaceAngle: 80
296
- },
297
- // labelLayout: (params) => {
298
- // const isLeft = params.labelRect.x < client.value?.getWidth() / 2;
299
- // const points = params.labelLinePoints;
300
- // points[2][0] = isLeft
301
- // ? params.labelRect.x
302
- // : params.labelRect.x + params.labelRect.width;
303
- // return {
304
- // labelLinePoints: points
305
- // };
306
- // },
307
- data: []
308
- }], Array.isArray(t))
309
- i.series[0].data = t;
310
- else
311
- for (const l in t)
312
- if (Object.prototype.hasOwnProperty.call(t, l)) {
313
- const r = t[l];
314
- i.series[0].data.push({ value: r, name: l });
315
- }
316
- }
317
- console.log(i), b.value = i, v();
318
- }, I = async (t) => {
319
- let i = 0;
320
- t && (i = t[0].value);
321
- let l = s.init, r = l.adcode || 1e5, p = { 1e5: "china" }[r] || "map";
322
- const S = await $req.query(
323
- `https://geo.datav.aliyun.com/areas_v3/bound/${r}_full.json`
324
- ), f = g.init(a.value);
325
- l.visualMap = {
326
- text: ["高", "低"],
327
- min: 0,
328
- max: i,
329
- calculable: !0,
330
- orient: "horizontal",
331
- bottom: 20,
332
- inRange: {
333
- color: ["#ebf5ff", "#409eff"]
334
- }
335
- }, l.series = {
336
- type: "map",
337
- map: p,
338
- label: {
339
- show: !0,
340
- color: "#999",
341
- fontSize: 10
342
- },
343
- itemStyle: {
344
- areaColor: "#ecf5ff",
345
- borderColor: "#dddddd"
346
- }
347
- }, l.series.data = t, g.registerMap(p, S), f.setOption(l), o.value = f, n.value = !1;
348
- }, O = (t) => {
349
- b.value = s.type === "native" ? s.init : C(s.init, t), v();
350
- }, v = () => {
351
- const t = g.init(a.value, c(), { renderer: "svg" });
352
- t.setOption(b.value), o.value = t, n.value = !1;
353
- };
354
- j(() => [$store.dark, $store.theme], () => {
355
- o.value && o.value.setTheme(c());
356
- }), z(() => {
357
- s.asyncData && typeof s.asyncData == "function" ? s.asyncData(m) : m(s.data);
358
- }), D(() => {
359
- o.value && o.value.dispose(), window.removeEventListener("resize", x);
360
- });
361
- const x = () => {
362
- o.value && o.value.resize();
363
- };
364
- return window.addEventListener("resize", x), (t, i) => {
365
- const l = E("loading");
366
- return $(), k("div", V, [
367
- M(($(), k("div", F, [
368
- w(n) ? T("", !0) : R(t.$slots, "default", { key: 0 })
369
- ])), [
370
- [l, w(n)]
371
- ]),
372
- B("div", {
373
- class: "chart-box",
374
- ref_key: "echartsRef",
375
- ref: a
376
- }, null, 512)
377
- ]);
378
- };
379
- }
380
- });
381
- export {
382
- Z as default
383
- };