dmx-admin-ui 1.2.116 → 1.2.118

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.
@@ -0,0 +1,397 @@
1
+ import { defineComponent as W, ref as h, watch as L, onMounted as z, onUnmounted as D, resolveDirective as E, openBlock as S, createElementBlock as k, withDirectives as M, unref as w, renderSlot as R, createCommentVNode as T, createElementVNode as B } from "vue";
2
+ import * as m 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
+ }, b = {};
150
+ function N(t, o = 0.5) {
151
+ if (t.startsWith("rgba"))
152
+ return t.replace(/[\d\.]+\)$/g, `${o})`);
153
+ if (t.startsWith("rgb"))
154
+ return t.replace("rgb", "rgba").replace(")", `, ${o})`);
155
+ if (t.startsWith("#")) {
156
+ if (t.length === 4) {
157
+ const i = parseInt(t[1] + t[1], 16), n = parseInt(t[2] + t[2], 16), l = parseInt(t[3] + t[3], 16);
158
+ return `rgba(${i}, ${n}, ${l}, ${o})`;
159
+ }
160
+ if (t.length === 7) {
161
+ const i = parseInt(t.slice(1, 3), 16), n = parseInt(t.slice(3, 5), 16), l = parseInt(t.slice(5, 7), 16);
162
+ return `rgba(${i}, ${n}, ${l}, ${o})`;
163
+ }
164
+ if (t.length === 9) {
165
+ const i = parseInt(t.slice(1, 3), 16), n = parseInt(t.slice(3, 5), 16), l = parseInt(t.slice(5, 7), 16), p = parseInt(t.slice(7, 9), 16) / 255;
166
+ return `rgba(${i}, ${n}, ${l}, ${p * o})`;
167
+ }
168
+ }
169
+ return t.startsWith("hsl") ? t.startsWith("hsla") ? t.replace(/[\d\.]+\)$/g, `${o})`) : t.replace("hsl", "hsla").replace(")", `, ${o})`) : t.startsWith("hsla") ? t.replace(/[\d\.]+\)$/g, `${o})`) : t;
170
+ }
171
+ const d = (t = ["#eee", "#999"]) => (t = Array.isArray(t) ? t : [N(t, 0.7), t], {
172
+ type: "linear",
173
+ x: 0,
174
+ x2: 0,
175
+ y: 0,
176
+ y2: 1,
177
+ colorStops: [
178
+ {
179
+ offset: 0,
180
+ color: t[0]
181
+ },
182
+ {
183
+ offset: 1,
184
+ color: t[1]
185
+ }
186
+ ]
187
+ }), q = (t = -1) => {
188
+ const o = $store.theme + $store.dark;
189
+ if (!b[o]) {
190
+ const i = $store.theme, n = {
191
+ yellow: "#f59e0b",
192
+ green: "#22c55e",
193
+ purple: "#f43f5e",
194
+ blue: "#3b82f6",
195
+ red: "#f2140d"
196
+ }, l = {
197
+ yellow: "#eedd78",
198
+ green: "#91ca8c",
199
+ purple: "#e69d87",
200
+ blue: "#73b9bc",
201
+ red: "#dd6b66"
202
+ };
203
+ delete l[i], delete n[i];
204
+ const p = [d($theme("primary"))];
205
+ if ($store.dark) {
206
+ for (const f in l)
207
+ p.push(d(l[f]));
208
+ for (const f in n)
209
+ p.push(d(n[f]));
210
+ } else {
211
+ for (const f in n)
212
+ p.push(d(n[f]));
213
+ for (const f in l)
214
+ p.push(d(l[f]));
215
+ }
216
+ b[o] = p;
217
+ }
218
+ return t > -1 ? b[o][t] : b[o];
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(t) {
236
+ const o = t, i = h(null), n = h(!0), l = h(null), p = () => {
237
+ const r = $store.dark ? P : {};
238
+ return r.color = q(), r;
239
+ }, f = {
240
+ type: "bar",
241
+ yAxisIndex: 0,
242
+ itemStyle: {
243
+ borderRadius: [4, 4, 0, 0]
244
+ }
245
+ }, C = {
246
+ yAxisIndex: 0,
247
+ type: "line",
248
+ smooth: !1
249
+ }, g = h({}), _ = (r, s) => {
250
+ s?.[0] && typeof s?.[0] == "object" && !Array.isArray(s[0]) && (r = { ...r, ...s[0] });
251
+ const { type: c = "line" } = r;
252
+ let e = r || {};
253
+ if (e.tooltip === void 0 && (e.tooltip = { trigger: "axis" }), e.mini)
254
+ return e.grid = { left: 10, right: 10, bottom: 0, top: 10 }, e.xAxis = {
255
+ show: !1,
256
+ data: Array.isArray(s) ? s.slice(1).map((a) => a[0]) : Object.keys(s)
257
+ }, typeof e.color == "string" ? e.color = [e.color] : typeof e.color == "number" && (e.color = [p().color[e.color]]), e.yAxis = { type: "value", show: !1 }, c == "line" ? e.series = {
258
+ type: "line",
259
+ areaStyle: {},
260
+ smooth: !0
261
+ } : e.series = {
262
+ type: "bar"
263
+ }, delete e.mini, e.series.data = Array.isArray(s) ? s.slice(1).map((a) => a[1]) : Object.values(s), e;
264
+ if (e.grid === void 0 && (e.grid = { top: 0, left: 0, right: 0, bottom: 80 }), e.legend === void 0 && (e.legend = {}), e.xAxis === void 0 && (e.xAxis = { type: "category" }), e.yAxis === void 0 && (e.yAxis = {}), e.series === void 0) {
265
+ const a = [];
266
+ s[0].forEach((y, u) => {
267
+ if (u > 0) {
268
+ const O = (typeof y == "object" ? y.type : Array.isArray(c) ? c[u - 1] : c) === "bar" ? f : C;
269
+ y?.yAxisIndex && (e.yAxis = [{}, {}]), a.push({ ...O, ...typeof y == "object" ? y : {} });
270
+ }
271
+ }), e.series = a;
272
+ }
273
+ return typeof s == "object" && (s[0] = s[0].map((a) => typeof a == "object" ? a.name : a), e.dataset = {
274
+ source: s
275
+ }), console.log("series", e), e;
276
+ }, v = (r) => {
277
+ o.init.type == "pie" ? x(r) : o.init.type == "map" ? j(r) : I(r);
278
+ }, x = (r) => {
279
+ let s = o.init;
280
+ delete s.type, r?.[0] && typeof r?.[0] == "object" && !Array.isArray(r[0]) && (s = { ...o.init, ...r[0] }), s.tooltip === void 0 && (s.tooltip = {});
281
+ const c = s.legend ? "60%" : "80%";
282
+ if (r) {
283
+ if (s.series = {
284
+ type: "pie",
285
+ radius: c,
286
+ // radius: ['40%', '70%'],
287
+ // center: ['50%', '70%'],
288
+ // startAngle: -180,
289
+ // endAngle: 0,
290
+ // label:false,
291
+ // label: {
292
+ // alignTo: 'edge',
293
+ // formatter: '{b}\n{c}',
294
+ // minMargin: 5,
295
+ // edgeDistance: 10,
296
+ // lineHeight: 15
297
+ // },
298
+ // labelLine: {
299
+ // length: 15,
300
+ // length2: 0,
301
+ // maxSurfaceAngle: 80
302
+ // },
303
+ // labelLayout: (params) => {
304
+ // const isLeft = params.labelRect.x < client.value?.getWidth() / 2;
305
+ // const points = params.labelLinePoints;
306
+ // points[2][0] = isLeft
307
+ // ? params.labelRect.x
308
+ // : params.labelRect.x + params.labelRect.width;
309
+ // return {
310
+ // labelLinePoints: points
311
+ // };
312
+ // },
313
+ data: [],
314
+ ...s.series
315
+ }, !s.series.data.length && Array.isArray(r))
316
+ s.series.data = r.filter((e) => Array.isArray(e)).map((e) => ({ name: e[0], value: e[1] }));
317
+ else if (!s.series.data.length && typeof r == "object") {
318
+ for (const e in r)
319
+ if (Object.prototype.hasOwnProperty.call(r, e)) {
320
+ const a = r[e];
321
+ s.series.data.push({ value: a, name: e });
322
+ }
323
+ }
324
+ }
325
+ g.value = s, A();
326
+ }, j = async (r) => {
327
+ let s = 0;
328
+ r && (s = r[0].value);
329
+ let c = o.init, e = c.adcode || 1e5, a = { 1e5: "china" }[e] || "map";
330
+ const y = await $req.query(
331
+ `https://geo.datav.aliyun.com/areas_v3/bound/${e}_full.json`
332
+ ), u = m.init(l.value);
333
+ c.visualMap = {
334
+ text: ["高", "低"],
335
+ min: 0,
336
+ max: s,
337
+ calculable: !0,
338
+ orient: "horizontal",
339
+ bottom: 20,
340
+ inRange: {
341
+ color: ["#ebf5ff", "#409eff"]
342
+ }
343
+ }, c.series = {
344
+ type: "map",
345
+ map: a,
346
+ label: {
347
+ show: !0,
348
+ color: "#999",
349
+ fontSize: 10
350
+ },
351
+ itemStyle: {
352
+ areaColor: "#ecf5ff",
353
+ borderColor: "#dddddd"
354
+ }
355
+ }, c.series.data = r, m.registerMap(a, y), u.setOption(c), i.value = u, n.value = !1;
356
+ }, I = (r) => {
357
+ if (r[0] === "pie" || r?.[0]?.type === "pie")
358
+ return x(r);
359
+ g.value = o.type === "native" ? o.init : _(o.init, r);
360
+ try {
361
+ A();
362
+ } catch {
363
+ }
364
+ }, A = () => {
365
+ const r = m.init(l.value, p(), { renderer: "svg" });
366
+ r.setOption(g.value), i.value = r, n.value = !1;
367
+ };
368
+ L(() => [$store.dark, $store.theme], () => {
369
+ i.value && i.value.setTheme(p());
370
+ }), z(() => {
371
+ o.asyncData && typeof o.asyncData == "function" ? o.asyncData(v) : v(o.data);
372
+ }), D(() => {
373
+ i.value && i.value.dispose(), window.removeEventListener("resize", $);
374
+ });
375
+ const $ = () => {
376
+ i.value && i.value.resize();
377
+ };
378
+ return window.addEventListener("resize", $), (r, s) => {
379
+ const c = E("loading");
380
+ return S(), k("div", V, [
381
+ M((S(), k("div", F, [
382
+ w(n) ? T("", !0) : R(r.$slots, "default", { key: 0 })
383
+ ])), [
384
+ [c, w(n)]
385
+ ]),
386
+ B("div", {
387
+ class: "chart-box",
388
+ ref_key: "echartsRef",
389
+ ref: l
390
+ }, null, 512)
391
+ ]);
392
+ };
393
+ }
394
+ });
395
+ export {
396
+ Z as default
397
+ };
@@ -1,9 +1,9 @@
1
- import { resolveComponent as f, openBlock as n, createElementBlock as o, createElementVNode as l, Fragment as a, renderList as m, normalizeStyle as w, createTextVNode as C, toDisplayString as c, createBlock as p, withCtx as g, createCommentVNode as y, resolveDynamicComponent as _, mergeProps as j, normalizeClass as z, defineAsyncComponent as v } from "vue";
2
- import { _ as O } from "./index-BBpn6jAS.js";
1
+ import { resolveComponent as f, openBlock as n, createElementBlock as r, createElementVNode as l, Fragment as a, renderList as c, normalizeStyle as w, createTextVNode as C, toDisplayString as h, createBlock as p, withCtx as g, createCommentVNode as y, resolveDynamicComponent as v, mergeProps as _, normalizeClass as j, defineAsyncComponent as z } from "vue";
2
+ import { _ as O } from "./index-BcV35P1v.js";
3
3
  const T = {
4
4
  name: "form-group",
5
5
  components: {
6
- inputItem: v(() => import("./index-BBpn6jAS.js").then((r) => r.c))
6
+ inputItem: z(() => import("./index-BcV35P1v.js").then((s) => s.c))
7
7
  },
8
8
  emits: ["change", "update:modelValue"],
9
9
  props: {
@@ -25,10 +25,8 @@ const T = {
25
25
  },
26
26
  created() {
27
27
  this.cols = this.init.cols;
28
- const r = this.cols.filter((e) => !e.width).length;
29
- console.log(r);
30
- const t = `calc(${(100 / r).toFixed(1) + "%"} - ${(80 / r).toFixed(1) + "px"})`;
31
- console.log(t), this.init.size && this.cols.forEach((e) => {
28
+ const s = this.cols.filter((e) => !e.width).length, t = `calc(${(100 / s).toFixed(1) + "%"} - ${(80 / s).toFixed(1) + "px"})`;
29
+ this.init.size && this.cols.forEach((e) => {
32
30
  e.size = this.init.size, e.width || (e.width = t);
33
31
  }), this.init.limit > 1 && (this.limit = this.init.limit), this.modelValue && this.modelValue.constructor.name === "Object" ? (this.dataType = "Object", this.list = [this.modelValue]) : this.modelValue && this.modelValue.constructor.name === "Array" ? this.list = this.modelValue : this.limit === 1 && (this.dataType = "Object"), this.$watch(
34
32
  "list",
@@ -44,34 +42,37 @@ const T = {
44
42
  change() {
45
43
  this.key++;
46
44
  },
47
- del(r) {
48
- this.list.splice(r, 1), this.key++;
45
+ change2(s, t, e) {
46
+ e.field ? this.list[t][e.field] = s : this.list[t] = s;
47
+ },
48
+ del(s) {
49
+ this.list.splice(s, 1), this.key++;
49
50
  },
50
51
  add() {
51
52
  this.list.push({});
52
53
  }
53
54
  }
54
55
  }, A = { class: "input-group-table" }, I = { align: "left" }, B = { style: { "line-height": "1.2" } }, E = ["onClick"], F = { class: "text-3 op-70 pl-sm" };
55
- function N(r, t, e, b, i, u) {
56
- const V = f("el-tooltip"), x = f("inputItem");
57
- return n(), o("div", A, [
56
+ function N(s, t, e, b, i, u) {
57
+ const V = f("el-tooltip"), k = f("inputItem");
58
+ return n(), r("div", A, [
58
59
  l("table", null, [
59
60
  l("colgroup", null, [
60
61
  t[1] || (t[1] = l("col", { width: 40 }, null, -1)),
61
- (n(!0), o(a, null, m(i.cols, (s) => (n(), o("col", {
62
- style: w({ width: s.width })
62
+ (n(!0), r(a, null, c(i.cols, (o) => (n(), r("col", {
63
+ style: w({ width: o.width })
63
64
  }, null, 4))), 256)),
64
65
  t[2] || (t[2] = l("col", { width: 40 }, null, -1))
65
66
  ]),
66
67
  l("thead", null, [
67
68
  l("tr", null, [
68
69
  t[4] || (t[4] = l("th", null, null, -1)),
69
- (n(!0), o(a, null, m(i.cols, (s) => (n(), o("th", I, [
70
+ (n(!0), r(a, null, c(i.cols, (o) => (n(), r("th", I, [
70
71
  l("div", B, [
71
- C(c(s.title) + " ", 1),
72
- s.info ? (n(), p(V, {
72
+ C(h(o.title) + " ", 1),
73
+ o.info ? (n(), p(V, {
73
74
  key: 0,
74
- content: s.info,
75
+ content: o.info,
75
76
  placement: "bottom",
76
77
  effect: "light"
77
78
  }, {
@@ -85,9 +86,9 @@ function N(r, t, e, b, i, u) {
85
86
  t[5] || (t[5] = l("th", { align: "right" }, null, -1))
86
87
  ])
87
88
  ]),
88
- (n(), p(_(i.limit > 1 ? "a-draggable" : "span"), j({ tag: "tbody" }, i.limit > 1 ? { filter: ".del", handle: ".sort", list: i.list, onChange: u.change } : {}), {
89
+ (n(), p(v(i.limit > 1 ? "a-draggable" : "span"), _({ tag: "tbody" }, i.limit > 1 ? { filter: ".del", handle: ".sort", list: i.list, onChange: u.change } : {}), {
89
90
  default: g(() => [
90
- (n(!0), o(a, null, m(i.list, (s, h) => (n(), o("tr", null, [
91
+ (n(!0), r(a, null, c(i.list, (o, m) => (n(), r("tr", null, [
91
92
  t[7] || (t[7] = l("td", null, [
92
93
  l("div", {
93
94
  class: "sort op-70",
@@ -96,22 +97,22 @@ function N(r, t, e, b, i, u) {
96
97
  l("i", { class: "i-ri-menu-line" })
97
98
  ])
98
99
  ], -1)),
99
- (n(!0), o(a, null, m(i.cols, (d) => (n(), o("td", null, [
100
- (n(), p(x, {
100
+ (n(!0), r(a, null, c(i.cols, (d) => (n(), r("td", null, [
101
+ (n(), p(k, {
101
102
  clearable: d.clearable ?? e.init.clearable ?? !1,
102
103
  cols: i.cols,
103
- index: h,
104
+ index: m,
104
105
  key: i.key,
105
106
  prop: d,
106
- modelValue: s[d.field],
107
- "onUpdate:modelValue": (k) => s[d.field] = k
108
- }, null, 8, ["clearable", "cols", "index", "prop", "modelValue", "onUpdate:modelValue"]))
107
+ "onUpdate:modelValue": (x) => u.change2(x, m, d),
108
+ "model-value": d.field ? o[d.field] : o
109
+ }, null, 8, ["clearable", "cols", "index", "prop", "onUpdate:modelValue", "model-value"]))
109
110
  ]))), 256)),
110
111
  l("td", null, [
111
112
  l("div", {
112
113
  title: "删除",
113
114
  class: "del op-70 flex",
114
- onClick: (d) => u.del(h)
115
+ onClick: (d) => u.del(m)
115
116
  }, [...t[6] || (t[6] = [
116
117
  l("i", { class: "i-ri-delete-bin-line" }, null, -1)
117
118
  ])], 8, E)
@@ -121,18 +122,18 @@ function N(r, t, e, b, i, u) {
121
122
  _: 1
122
123
  }, 16))
123
124
  ]),
124
- i.list.length < i.limit ? (n(), o("div", {
125
+ i.list.length < i.limit ? (n(), r("div", {
125
126
  key: 0,
126
- class: z(["add flex justify-center items-center info-hide", { "add-small": e.init.size === "small" }]),
127
- onClick: t[0] || (t[0] = (...s) => u.add && u.add(...s))
127
+ class: j(["add flex justify-center items-center info-hide", { "add-small": e.init.size === "small" }]),
128
+ onClick: t[0] || (t[0] = (...o) => u.add && u.add(...o))
128
129
  }, [
129
130
  t[8] || (t[8] = l("i", { class: "i-ri-add-line font-xl" }, null, -1)),
130
131
  t[9] || (t[9] = l("span", null, "添加数据", -1)),
131
- l("span", F, "(" + c(i.list.length) + "/" + c(i.limit) + ")", 1)
132
+ l("span", F, "(" + h(i.list.length) + "/" + h(i.limit) + ")", 1)
132
133
  ], 2)) : y("", !0)
133
134
  ]);
134
135
  }
135
- const U = /* @__PURE__ */ O(T, [["render", N], ["__scopeId", "data-v-5b3688e9"]]);
136
+ const U = /* @__PURE__ */ O(T, [["render", N], ["__scopeId", "data-v-ffa2bfb0"]]);
136
137
  export {
137
138
  U as default
138
139
  };