hs-admin-ui 17.0.3 → 17.0.5

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,991 @@
1
+ import { defineComponent as x, ref as U, resolveComponent as b, createElementBlock as T, openBlock as c, createElementVNode as v, createTextVNode as w, toDisplayString as S, createVNode as N, withCtx as k, inject as A, onBeforeUnmount as fe, Fragment as L, createBlock as I, createCommentVNode as E, Teleport as me, unref as i, normalizeStyle as ve, renderList as R, nextTick as ye, mergeModels as ne, useModel as oe, computed as ae, TransitionGroup as ge, withModifiers as P, normalizeClass as be, provide as le, reactive as he } from "vue";
2
+ import { S as D, F as V, P as f, a as Q, b as q, c as G, d as F, e as Z, N as z, f as O, t as ke, g as H, v as Y } from "./index-B8REha8K.js";
3
+ import { a3 as M, an as J, H as o, aj as Te, S as W } from "./bcVisual.vue_vue_type_style_index_0_scoped_a917535e_lang-BcYE-BQ8.js";
4
+ const Ne = { class: "update-name" }, Ce = { class: "content" }, Ie = { class: "item" }, Ee = { class: "item" }, Se = { class: "item" }, we = { class: "footer" }, $e = /* @__PURE__ */ x({
5
+ __name: "popup",
6
+ props: {
7
+ row: {
8
+ type: Object
9
+ },
10
+ close: {
11
+ type: Function
12
+ }
13
+ },
14
+ setup(r) {
15
+ var m;
16
+ const n = r, _ = U((m = n.row) == null ? void 0 : m.show_name);
17
+ function p() {
18
+ n.close(_.value);
19
+ }
20
+ return (y, u) => {
21
+ const s = b("el-input"), a = b("el-button"), t = b("bc-button");
22
+ return c(), T("div", Ne, [
23
+ v("div", Ce, [
24
+ v("div", Ie, [
25
+ u[2] || (u[2] = v("span", { class: "show-name" }, "字段名称:", -1)),
26
+ w(S(r.row.name), 1)
27
+ ]),
28
+ v("div", Ee, [
29
+ u[3] || (u[3] = v("span", { class: "show-name" }, "字段键值:", -1)),
30
+ w(S(r.row.field), 1)
31
+ ]),
32
+ v("div", Se, [
33
+ u[4] || (u[4] = v("span", { class: "show-name" }, "显示名称:", -1)),
34
+ N(s, {
35
+ modelValue: _.value,
36
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => _.value = l),
37
+ clearable: "",
38
+ placeholder: "请输入",
39
+ size: "default"
40
+ }, null, 8, ["modelValue"])
41
+ ])
42
+ ]),
43
+ v("footer", we, [
44
+ N(a, {
45
+ size: "default",
46
+ onClick: u[1] || (u[1] = (l) => r.close("cancel"))
47
+ }, {
48
+ default: k(() => [...u[5] || (u[5] = [
49
+ w("关闭", -1)
50
+ ])]),
51
+ _: 1
52
+ }),
53
+ N(t, {
54
+ type: "primary",
55
+ size: "default",
56
+ onClick: p
57
+ }, {
58
+ default: k(() => [...u[6] || (u[6] = [
59
+ w("确定", -1)
60
+ ])]),
61
+ _: 1
62
+ })
63
+ ])
64
+ ]);
65
+ };
66
+ }
67
+ }), Oe = /* @__PURE__ */ M($e, [["__scopeId", "data-v-c8fbb8a5"]]);
68
+ function Ve(r) {
69
+ return new Promise((n) => {
70
+ J(
71
+ Oe,
72
+ { row: r },
73
+ {
74
+ title: "修改显示名称",
75
+ width: 500,
76
+ height: 350,
77
+ zIndex: 99999,
78
+ className: "context-wrap__content",
79
+ success: ({ data: _ }) => n(_),
80
+ showFooter: !1
81
+ }
82
+ );
83
+ });
84
+ }
85
+ const De = {
86
+ [O.TEXT]: "string",
87
+ [O.NUMBER]: "number",
88
+ [O.DATE]: "date",
89
+ [O.SELECT_R]: "radio_▼",
90
+ [O.SELECT_M]: "multiple_▼",
91
+ [O.SELECT_T]: "tree_▼"
92
+ };
93
+ function de(r) {
94
+ return De[r];
95
+ }
96
+ const B = U(""), Le = [
97
+ { label: "列配置", value: D.COLUMN },
98
+ { label: "检索配置", value: D.FILTER }
99
+ ], se = [
100
+ { label: "无", value: V.NONE },
101
+ { label: "求和", value: V.SUM },
102
+ { label: "平均", value: V.AVERAGE },
103
+ { label: "最大值", value: V.MAX },
104
+ { label: "最小值", value: V.MIN },
105
+ { label: "计数", value: V.COUNT },
106
+ { label: "去重计数", value: V.COUNTDISTINCT }
107
+ ], ie = [
108
+ { label: "无", value: Q.NONE },
109
+ { label: "占比", value: Q.RATE }
110
+ ], K = [
111
+ { label: "无", value: q.NONE },
112
+ { label: "升序", value: q.ASC },
113
+ { label: "降序", value: q.DESC }
114
+ ], ee = [
115
+ { label: "无", value: G.NONE },
116
+ { label: "合计", value: G.SUM }
117
+ ], te = [
118
+ { label: "隐藏", value: F.HIDE },
119
+ { label: "显示", value: F.SHOW }
120
+ ], re = [
121
+ { label: "不统计", value: Z.NONE },
122
+ { label: "统计", value: Z.STATISTICS }
123
+ ], ue = [
124
+ { label: "AND", value: z.AND },
125
+ { label: "OR", value: z.OR }
126
+ ], xe = [
127
+ {
128
+ label: "排序方式",
129
+ value: f.SORT,
130
+ children: K
131
+ },
132
+ {
133
+ label: "显示名称",
134
+ value: f.EDIT_NAME
135
+ },
136
+ {
137
+ label: "是否隐藏",
138
+ value: f.SHOW,
139
+ children: te
140
+ },
141
+ {
142
+ label: "分组统计",
143
+ value: f.STATISTICS,
144
+ children: re
145
+ },
146
+ {
147
+ label: "底部合计",
148
+ value: f.SUM,
149
+ children: ee
150
+ },
151
+ {
152
+ label: "小数位数",
153
+ value: f.POINT
154
+ }
155
+ ], Me = [
156
+ {
157
+ label: "显示名称",
158
+ value: f.EDIT_NAME
159
+ }
160
+ ], Ae = [
161
+ {
162
+ label: "汇总方式",
163
+ value: f.COLLECT,
164
+ children: se
165
+ },
166
+ {
167
+ label: "占比计算",
168
+ value: f.CALC,
169
+ children: ie
170
+ },
171
+ {
172
+ label: "排序方式",
173
+ value: f.SORT,
174
+ children: K
175
+ },
176
+ {
177
+ label: "显示名称",
178
+ value: f.EDIT_NAME
179
+ },
180
+ {
181
+ label: "小数位数",
182
+ value: f.POINT
183
+ },
184
+ {
185
+ label: "底部合计",
186
+ value: f.SUM,
187
+ children: ee
188
+ },
189
+ {
190
+ label: "是否隐藏",
191
+ value: f.SHOW,
192
+ children: te
193
+ }
194
+ ], Ue = { class: "extend-content__text" }, Re = { key: 0 }, Fe = ["onClick"], ze = /* @__PURE__ */ x({
195
+ __name: "extendItem",
196
+ props: ["data", "size"],
197
+ emits: ["click"],
198
+ setup(r) {
199
+ const n = r, _ = U(n.size.right), p = U(n.size.top), m = A("stateSetting", {});
200
+ fe(() => {
201
+ B.value = "";
202
+ });
203
+ function y(t) {
204
+ var d, e;
205
+ _.value = ((e = (d = document.querySelector(".context-box")) == null ? void 0 : d.getBoundingClientRect()) == null ? void 0 : e.right) || n.size.right;
206
+ const l = t.target;
207
+ p.value = n.size.top + l.offsetTop, n.data.children && n.data.children.length ? B.value = n.data.label : B.value = "";
208
+ }
209
+ function u(t) {
210
+ const l = {
211
+ [f.COLLECT]: () => o.set(
212
+ o.find(m.indicator, {
213
+ field_key: n.data.data.field_key
214
+ }),
215
+ "field_way",
216
+ t.value
217
+ ),
218
+ [f.CALC]: () => o.set(
219
+ o.find(m.indicator, {
220
+ field_key: n.data.data.field_key
221
+ }),
222
+ "field_proportion",
223
+ t.value
224
+ ),
225
+ [f.SORT]: () => {
226
+ o.set(o.find(m.columns, { field_key: n.data.data.field_key }), "report_field_sort", t.value), o.set(
227
+ o.find(m.indicator, {
228
+ field_key: n.data.data.field_key
229
+ }),
230
+ "report_field_sort",
231
+ t.value
232
+ );
233
+ },
234
+ [f.STATISTICS]: () => o.set(o.find(m.columns, { field_key: n.data.data.field_key }), "report_field_group", t.value),
235
+ [f.SUM]: () => {
236
+ o.set(o.find(m.columns, { field_key: n.data.data.field_key }), "report_field_sum", t.value), o.set(
237
+ o.find(m.indicator, {
238
+ field_key: n.data.data.field_key
239
+ }),
240
+ "report_field_sum",
241
+ t.value
242
+ );
243
+ },
244
+ [f.SHOW]: () => {
245
+ o.set(o.find(m.columns, { field_key: n.data.data.field_key }), "report_field_show", t.value), o.set(
246
+ o.find(m.indicator, {
247
+ field_key: n.data.data.field_key
248
+ }),
249
+ "report_field_show",
250
+ t.value
251
+ );
252
+ }
253
+ };
254
+ o.get(l, n.data.value) && (o.get(l, n.data.value)(), ye(() => {
255
+ var d, e;
256
+ _.value = ((e = (d = document.querySelector(".context-box")) == null ? void 0 : d.getBoundingClientRect()) == null ? void 0 : e.right) || n.size.right;
257
+ }));
258
+ }
259
+ function s(t) {
260
+ switch (n.data.value) {
261
+ case f.COLLECT:
262
+ return n.data.data.field_way === t.value;
263
+ case f.CALC:
264
+ return n.data.data.field_proportion === t.value;
265
+ case f.SORT:
266
+ return n.data.data.report_field_sort === t.value;
267
+ case f.SUM:
268
+ return n.data.data.report_field_sum === t.value;
269
+ case f.SHOW:
270
+ return n.data.data.report_field_show === t.value;
271
+ case f.STATISTICS:
272
+ return n.data.data.report_field_group === t.value;
273
+ }
274
+ }
275
+ function a() {
276
+ var t, l, d, e, h, C;
277
+ switch (n.data.value) {
278
+ case f.COLLECT:
279
+ return ((t = o.find(se, { value: n.data.data.field_way })) == null ? void 0 : t.label) || "";
280
+ case f.CALC:
281
+ return ((l = o.find(ie, { value: n.data.data.field_proportion })) == null ? void 0 : l.label) || "";
282
+ case f.SORT:
283
+ return ((d = o.find(K, { value: n.data.data.report_field_sort })) == null ? void 0 : d.label) || "";
284
+ case f.POINT:
285
+ return n.data.data.report_field_point || "";
286
+ case f.SUM:
287
+ return ((e = o.find(ee, { value: n.data.data.report_field_sum })) == null ? void 0 : e.label) || "";
288
+ case f.SHOW:
289
+ return ((h = o.find(te, { value: n.data.data.report_field_show })) == null ? void 0 : h.label) || "";
290
+ case f.STATISTICS:
291
+ return ((C = o.find(re, { value: n.data.data.report_field_group })) == null ? void 0 : C.label) || "";
292
+ default:
293
+ return "";
294
+ }
295
+ }
296
+ return (t, l) => {
297
+ const d = b("bc-icon");
298
+ return c(), T(L, null, [
299
+ v("div", {
300
+ class: "extend-content",
301
+ onMouseenter: y,
302
+ onClick: l[0] || (l[0] = (e) => t.$emit("click"))
303
+ }, [
304
+ v("span", Ue, [
305
+ w(S(r.data.label) + " ", 1),
306
+ a() ? (c(), T("span", Re, "(" + S(a()) + ")", 1)) : E("", !0)
307
+ ]),
308
+ r.data.children && r.data.children.length ? (c(), I(d, {
309
+ key: 0,
310
+ name: "ele-ArrowRight"
311
+ })) : E("", !0)
312
+ ], 32),
313
+ (c(), I(me, { to: "body" }, [
314
+ i(B) === r.data.label ? (c(), T("div", {
315
+ key: 0,
316
+ class: "context-wrap__content",
317
+ style: ve({ left: `${_.value}px`, top: `${p.value}px` })
318
+ }, [
319
+ (c(!0), T(L, null, R(r.data.children, (e, h) => (c(), T("div", {
320
+ class: "content__item",
321
+ key: h,
322
+ onClick: (C) => u(e)
323
+ }, [
324
+ v("span", null, S(e.label), 1),
325
+ s(e) ? (c(), I(d, {
326
+ key: 0,
327
+ name: "ele-Check",
328
+ color: "#409eff"
329
+ })) : E("", !0)
330
+ ], 8, Fe))), 128))
331
+ ], 4)) : E("", !0)
332
+ ]))
333
+ ], 64);
334
+ };
335
+ }
336
+ }), Pe = /* @__PURE__ */ M(ze, [["__scopeId", "data-v-22544e98"]]), qe = { class: "source-column-cell" }, He = { class: "column-title" }, We = ["data-column"], Be = { class: "tip-icon" }, je = ["onClick"], Ge = /* @__PURE__ */ x({
337
+ __name: "dragItem",
338
+ props: /* @__PURE__ */ ne({
339
+ tip: {
340
+ type: String,
341
+ default: "标题"
342
+ },
343
+ title: {
344
+ type: String,
345
+ default: "field_name"
346
+ },
347
+ field: {
348
+ type: String,
349
+ default: "field_key"
350
+ },
351
+ type: {
352
+ type: String,
353
+ default: "columns"
354
+ }
355
+ }, {
356
+ modelValue: { default: [] },
357
+ modelModifiers: {}
358
+ }),
359
+ emits: ["update:modelValue"],
360
+ setup(r) {
361
+ const n = r, _ = oe(r, "modelValue"), p = ae({
362
+ get: () => _.value,
363
+ set(s) {
364
+ _.value = s.map((a, t) => ({ ...a, data_sort: t }));
365
+ }
366
+ });
367
+ function m(s) {
368
+ const a = _.value.findIndex((t) => o.get(t, n.field) === s);
369
+ _.value.splice(a, 1);
370
+ }
371
+ function y(s, a) {
372
+ var t;
373
+ s.value === f.EDIT_NAME && Ve({
374
+ name: o.get(s, `data.${n.title}`),
375
+ field: o.get(s, `data.${n.field}`),
376
+ show_name: o.get(s, "data.show_name", "")
377
+ }).then((l) => {
378
+ l !== "cancel" && (o.set(o.find(_.value, { field_key: s.data.field_key }), "show_name", l), a());
379
+ }), s.value === f.POINT && Te.prompt("请填写小数位数", "提示", {
380
+ confirmButtonText: "确定",
381
+ cancelButtonText: "取消",
382
+ inputPattern: /^\d+$/,
383
+ inputErrorMessage: "请输入数字",
384
+ draggable: !0,
385
+ inputValue: (t = o.find(_.value, { field_key: s.data.field_key })) == null ? void 0 : t.report_field_point,
386
+ customClass: "context-wrap__content"
387
+ }).then(({ value: l }) => {
388
+ o.set(o.find(_.value, { field_key: s.data.field_key }), "report_field_point", l);
389
+ });
390
+ }
391
+ function u(s) {
392
+ const a = {
393
+ columns: xe,
394
+ querys: Me,
395
+ indicator: Ae
396
+ };
397
+ return n.type === "columns" && s.query_type !== O.NUMBER ? o.get(a, n.type, []).filter((t) => t.value !== f.POINT).map((t) => Object.assign(t, { data: s })) : o.get(a, n.type, []).map((t) => Object.assign(t, { data: s }));
398
+ }
399
+ return (s, a) => {
400
+ const t = b("el-empty"), l = b("bc-icon"), d = b("bc-context-box");
401
+ return c(), T("div", qe, [
402
+ v("p", He, S(r.tip), 1),
403
+ v("div", {
404
+ class: "column-cell",
405
+ "data-column": r.type
406
+ }, [
407
+ p.value.length ? E("", !0) : (c(), I(t, {
408
+ key: 0,
409
+ "image-size": 50
410
+ })),
411
+ N(i(ke), {
412
+ modelValue: p.value,
413
+ "onUpdate:modelValue": a[0] || (a[0] = (e) => p.value = e),
414
+ animation: 300,
415
+ class: "field-column-wrap"
416
+ }, {
417
+ default: k(() => [
418
+ N(ge, {
419
+ type: "transition",
420
+ name: "fade"
421
+ }, {
422
+ default: k(() => [
423
+ (c(!0), T(L, null, R(p.value, (e) => (c(), I(d, {
424
+ getMenu: () => u(e),
425
+ key: i(o).get(e, n.field),
426
+ trigger: "click",
427
+ class: "field-column-item"
428
+ }, {
429
+ content: k(({ data: h, size: C, close: $ }) => [
430
+ N(Pe, {
431
+ data: h,
432
+ size: C,
433
+ onClick: (X) => y(h, $)
434
+ }, null, 8, ["data", "size", "onClick"])
435
+ ]),
436
+ default: k(() => [
437
+ v("span", Be, S(i(de)(e.query_type)), 1),
438
+ v("span", null, S(i(o).get(e, "show_name") || i(o).get(e, n.title)), 1),
439
+ v("div", {
440
+ class: "icon-delete",
441
+ onClick: P((h) => m(i(o).get(e, n.field)), ["stop"])
442
+ }, [
443
+ N(l, { name: "ele-Delete" })
444
+ ], 8, je)
445
+ ]),
446
+ _: 2
447
+ }, 1032, ["getMenu"]))), 128))
448
+ ]),
449
+ _: 1
450
+ })
451
+ ]),
452
+ _: 1
453
+ }, 8, ["modelValue"])
454
+ ], 8, We)
455
+ ]);
456
+ };
457
+ }
458
+ }), j = /* @__PURE__ */ M(Ge, [["__scopeId", "data-v-1d3a2b44"]]);
459
+ function Ye() {
460
+ const r = A("stateSetting"), n = U("");
461
+ function _(s) {
462
+ const a = s.target;
463
+ n.value = (a == null ? void 0 : a.getAttribute("data-field")) || "";
464
+ }
465
+ function p(s) {
466
+ const a = s.target.closest(".column-cell");
467
+ a && setTimeout(() => {
468
+ a.classList.add("drag-enter");
469
+ });
470
+ }
471
+ function m(s) {
472
+ const a = s.target.closest(".column-cell");
473
+ a && a.classList.remove("drag-enter");
474
+ }
475
+ function y(s) {
476
+ s.preventDefault();
477
+ }
478
+ function u(s) {
479
+ var d, e;
480
+ if (!n.value) return;
481
+ const a = s.target.closest(".column-cell");
482
+ if (!a) return;
483
+ a.classList.remove("drag-enter");
484
+ const t = a.getAttribute("data-column"), l = o.cloneDeep(o.find(r.sourceFields, { field_key: n.value }));
485
+ if (o.find(o.get(r, t), { id: l.id }))
486
+ return W.warning("该字段已存在");
487
+ if (t === "columns" && o.find(o.get(r, "indicator"), { id: l.id }))
488
+ return W.warning("列字段/指标已存在该字段");
489
+ if (t === "indicator" && o.find(o.get(r, "columns"), { id: l.id }))
490
+ return W.warning("列字段/维度已存在该字段");
491
+ if (t === "indicator" && l.query_type !== O.NUMBER)
492
+ return W.warning("只有数值型字段允许拖入指标列中!");
493
+ t === "columns" && (l.field_data_type = H.WEI_DU, l.report_field_sort = q.NONE, l.report_field_show = F.SHOW, l.report_field_group = Z.NONE, l.query_type === O.NUMBER && (l.report_field_point = 2), l.report_field_sum = G.NONE), t === "indicator" && (l.field_way = V.NONE, l.field_data_type = H.ZHI_BIAO, l.field_proportion = Q.NONE, l.report_field_sort = q.NONE, l.report_field_point = 2, l.report_field_sum = G.NONE, l.report_field_show = F.SHOW), t === "drills" && (l.field_data_type = H.Z_WEI_DU, l.report_field_show = F.SHOW), t === "querys" && (l.field_data_type = H.SHAI_XUAN, l.report_field_show = F.SHOW), (d = o.get(r, t)) == null || d.push(l), (e = o.get(r, t)) == null || e.forEach((h, C) => {
494
+ h.data_sort = C;
495
+ }), n.value = "";
496
+ }
497
+ return {
498
+ fieldItem: n,
499
+ onDragstart: _,
500
+ onDragenter: p,
501
+ onDragleave: m,
502
+ onDragover: y,
503
+ onDrop: u
504
+ };
505
+ }
506
+ const Xe = { class: "node-tree" }, Qe = { class: "node" }, Ze = {
507
+ key: 0,
508
+ class: "text"
509
+ }, Je = {
510
+ key: 1,
511
+ class: "btns-setting"
512
+ }, Ke = /* @__PURE__ */ x({
513
+ __name: "nodeTree",
514
+ props: /* @__PURE__ */ ne({
515
+ parent: {
516
+ type: Object,
517
+ default: () => ({})
518
+ }
519
+ }, {
520
+ modelValue: {
521
+ default: () => []
522
+ },
523
+ modelModifiers: {}
524
+ }),
525
+ emits: ["update:modelValue"],
526
+ setup(r) {
527
+ const n = oe(r, "modelValue"), _ = A("addNode"), p = A("addCondition");
528
+ return (m, y) => {
529
+ const u = b("el-dropdown-item"), s = b("el-dropdown-menu"), a = b("el-dropdown"), t = b("hs-button");
530
+ return c(), T("div", Xe, [
531
+ (c(!0), T(L, null, R(n.value, (l, d) => (c(), T("div", {
532
+ key: d,
533
+ class: "node-tree-content"
534
+ }, [
535
+ v("div", {
536
+ class: be(["node-tree-item", `level-${l.level}`, { add: l.type !== "add" }])
537
+ }, [
538
+ l.type === "add" ? (c(), I(a, { key: 0 }, {
539
+ dropdown: k(() => [
540
+ N(s, null, {
541
+ default: k(() => [
542
+ (c(!0), T(L, null, R(i(ue), (e) => (c(), I(u, {
543
+ key: e.value,
544
+ onClick: P((h) => l.relation = e.value, ["stop"])
545
+ }, {
546
+ default: k(() => [
547
+ w(S(e.label), 1)
548
+ ]),
549
+ _: 2
550
+ }, 1032, ["onClick"]))), 128))
551
+ ]),
552
+ _: 2
553
+ }, 1024)
554
+ ]),
555
+ default: k(() => [
556
+ v("span", Qe, S(l.relation), 1)
557
+ ]),
558
+ _: 2
559
+ }, 1024)) : E("", !0)
560
+ ], 2),
561
+ l.type === "add" ? (c(), T("span", Ze, S(l.nodeName), 1)) : E("", !0),
562
+ l.children && l.children.length == 0 ? (c(), T("div", Je, [
563
+ l.btnType.includes("addCondition") ? (c(), I(t, {
564
+ key: 0,
565
+ plain: "",
566
+ type: "primary",
567
+ size: "small",
568
+ onClick: P((e) => i(p)(l), ["stop"])
569
+ }, {
570
+ default: k(() => [...y[1] || (y[1] = [
571
+ w("添加条件", -1)
572
+ ])]),
573
+ _: 1
574
+ }, 8, ["onClick"])) : E("", !0),
575
+ l.btnType.includes("addNode") ? (c(), I(t, {
576
+ key: 1,
577
+ plain: "",
578
+ type: "primary",
579
+ size: "small",
580
+ onClick: y[0] || (y[0] = P((e) => i(_)(r.parent), ["stop"]))
581
+ }, {
582
+ default: k(() => [...y[2] || (y[2] = [
583
+ w("添加关系", -1)
584
+ ])]),
585
+ _: 1
586
+ })) : E("", !0)
587
+ ])) : E("", !0),
588
+ i(o).isEmpty(l.children) ? E("", !0) : (c(), I(ce, {
589
+ key: 2,
590
+ class: "node-tree-children",
591
+ modelValue: l.children,
592
+ "onUpdate:modelValue": (e) => l.children = e,
593
+ parent: l
594
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "parent"]))
595
+ ]))), 128))
596
+ ]);
597
+ };
598
+ }
599
+ }), ce = /* @__PURE__ */ M(Ke, [["__scopeId", "data-v-44c01cd5"]]), et = /* @__PURE__ */ x({
600
+ __name: "index",
601
+ props: {
602
+ modelValue: {
603
+ type: Array,
604
+ default: () => []
605
+ }
606
+ },
607
+ emits: ["update:modelValue"],
608
+ setup(r, { emit: n }) {
609
+ const _ = r, p = n, m = ae({
610
+ get: () => y(_.modelValue),
611
+ set: (t) => {
612
+ p("update:modelValue", t);
613
+ }
614
+ });
615
+ function y(t) {
616
+ const l = (d, e = 1) => {
617
+ for (let h of d)
618
+ h.level = e, h.children && h.children.length && l(h.children, e + 1);
619
+ };
620
+ return l(t), t;
621
+ }
622
+ function u(t) {
623
+ const l = [];
624
+ function d(e, h = []) {
625
+ return e.reduce((C, $) => (C.push($), $ != null && $.children && $.children.length && C.push(...d($.children)), C), h);
626
+ }
627
+ return d(t, l), l;
628
+ }
629
+ function s(t) {
630
+ const d = u(m.value).find(($) => $.nodeId == t.nodeId);
631
+ if (!d) return;
632
+ const e = d.children.length, h = Y(), C = o.cloneDeep(d.children);
633
+ C.splice(e - 1, 0, {
634
+ nodeName: "",
635
+ pId: d.nodeId,
636
+ nodeId: h,
637
+ type: "add",
638
+ btnType: ["addCondition", "addNode"],
639
+ relation: z.AND,
640
+ children: [
641
+ {
642
+ nodeName: "",
643
+ pId: h,
644
+ nodeId: Y(),
645
+ btnType: ["addCondition", "addNode"],
646
+ relation: z.AND,
647
+ children: []
648
+ }
649
+ ]
650
+ }), C.length > 1 && o.get(C, "0.children.0.btnType") && o.set(C, "0.children.0.btnType", ["addCondition"]), d.children = C;
651
+ }
652
+ function a(t) {
653
+ const d = u(m.value).find((e) => e.nodeId == t.pId);
654
+ vt(t).then((e) => {
655
+ d != null && d.children && (d == null ? void 0 : d.children.length) === 1 ? Object.assign(d, e, {
656
+ btnType: [],
657
+ type: "add",
658
+ children: []
659
+ }) : Object.assign(t, e, {
660
+ btnType: [],
661
+ type: "add",
662
+ children: []
663
+ });
664
+ });
665
+ }
666
+ return le("addNode", s), le("addCondition", a), (t, l) => (c(), I(ce, {
667
+ modelValue: m.value,
668
+ "onUpdate:modelValue": l[0] || (l[0] = (d) => m.value = d)
669
+ }, null, 8, ["modelValue"]));
670
+ }
671
+ }), tt = /* @__PURE__ */ M(et, [["__scopeId", "data-v-140b89c8"]]), lt = { class: "sql-wraper" }, nt = { class: "content" }, ot = { class: "footer" }, at = /* @__PURE__ */ x({
672
+ __name: "popup",
673
+ props: {
674
+ sql: {
675
+ type: String
676
+ },
677
+ close: {
678
+ type: Function
679
+ }
680
+ },
681
+ setup(r) {
682
+ const n = r, _ = Y(), p = U([
683
+ {
684
+ nodeName: "",
685
+ pId: "",
686
+ nodeId: _,
687
+ type: "add",
688
+ relation: z.AND,
689
+ btnType: ["addCondition", "addNode"],
690
+ children: [
691
+ {
692
+ nodeName: "",
693
+ pId: _,
694
+ nodeId: Y(),
695
+ relation: z.AND,
696
+ btnType: ["addCondition", "addNode"],
697
+ children: []
698
+ }
699
+ ]
700
+ }
701
+ ]);
702
+ function m() {
703
+ let y = "";
704
+ const u = (s) => {
705
+ for (let a of s)
706
+ a.type === "add" && a.nodeName && (y += `${a.relation} ${a.nodeName} `), a.children && a.children.length && u(a.children);
707
+ };
708
+ u(p.value), n.close(y);
709
+ }
710
+ return (y, u) => {
711
+ const s = b("el-button"), a = b("bc-button");
712
+ return c(), T("div", lt, [
713
+ v("div", nt, [
714
+ N(i(tt), {
715
+ modelValue: p.value,
716
+ "onUpdate:modelValue": u[0] || (u[0] = (t) => p.value = t)
717
+ }, null, 8, ["modelValue"])
718
+ ]),
719
+ v("footer", ot, [
720
+ N(s, {
721
+ size: "default",
722
+ onClick: u[1] || (u[1] = (t) => r.close("cancel"))
723
+ }, {
724
+ default: k(() => [...u[2] || (u[2] = [
725
+ w("关闭", -1)
726
+ ])]),
727
+ _: 1
728
+ }),
729
+ N(a, {
730
+ type: "primary",
731
+ size: "default",
732
+ onClick: m
733
+ }, {
734
+ default: k(() => [...u[3] || (u[3] = [
735
+ w("确定", -1)
736
+ ])]),
737
+ _: 1
738
+ })
739
+ ])
740
+ ]);
741
+ };
742
+ }
743
+ }), dt = /* @__PURE__ */ M(at, [["__scopeId", "data-v-519bd5a5"]]), st = { class: "sql-wraper" }, it = { class: "content" }, rt = { class: "item" }, ut = { class: "node" }, ct = { class: "param-item" }, _t = { class: "footer" }, pt = /* @__PURE__ */ x({
744
+ __name: "addCondition",
745
+ props: {
746
+ condition: {
747
+ type: Object,
748
+ default: () => ({})
749
+ },
750
+ close: {
751
+ type: Function
752
+ }
753
+ },
754
+ setup(r) {
755
+ const n = r, _ = U(n.condition);
756
+ function p() {
757
+ n.close(_.value);
758
+ }
759
+ return (m, y) => {
760
+ const u = b("el-dropdown-item"), s = b("el-dropdown-menu"), a = b("el-dropdown"), t = b("el-input"), l = b("el-button"), d = b("bc-button");
761
+ return c(), T("div", st, [
762
+ v("div", it, [
763
+ v("div", rt, [
764
+ N(a, null, {
765
+ dropdown: k(() => [
766
+ N(s, null, {
767
+ default: k(() => [
768
+ (c(!0), T(L, null, R(i(ue), (e) => (c(), I(u, {
769
+ key: e.value,
770
+ onClick: P((h) => _.value.relation = e.value, ["stop"])
771
+ }, {
772
+ default: k(() => [
773
+ w(S(e.label), 1)
774
+ ]),
775
+ _: 2
776
+ }, 1032, ["onClick"]))), 128))
777
+ ]),
778
+ _: 1
779
+ })
780
+ ]),
781
+ default: k(() => [
782
+ v("span", ut, S(_.value.relation), 1)
783
+ ]),
784
+ _: 1
785
+ }),
786
+ v("div", ct, [
787
+ y[2] || (y[2] = v("span", { class: "show-name" }, "固定值", -1)),
788
+ N(t, {
789
+ modelValue: _.value.nodeName,
790
+ "onUpdate:modelValue": y[0] || (y[0] = (e) => _.value.nodeName = e),
791
+ size: "default",
792
+ clearable: "",
793
+ placeholder: "请输入"
794
+ }, null, 8, ["modelValue"])
795
+ ])
796
+ ])
797
+ ]),
798
+ v("footer", _t, [
799
+ N(l, {
800
+ size: "default",
801
+ onClick: y[1] || (y[1] = (e) => r.close("cancel"))
802
+ }, {
803
+ default: k(() => [...y[3] || (y[3] = [
804
+ w("关闭", -1)
805
+ ])]),
806
+ _: 1
807
+ }),
808
+ N(d, {
809
+ type: "primary",
810
+ size: "default",
811
+ onClick: p
812
+ }, {
813
+ default: k(() => [...y[4] || (y[4] = [
814
+ w("确定", -1)
815
+ ])]),
816
+ _: 1
817
+ })
818
+ ])
819
+ ]);
820
+ };
821
+ }
822
+ }), ft = /* @__PURE__ */ M(pt, [["__scopeId", "data-v-dc17852a"]]);
823
+ function mt(r) {
824
+ return new Promise((n) => {
825
+ J(
826
+ dt,
827
+ { sql: r },
828
+ {
829
+ title: "添加过滤",
830
+ success: ({ data: _ }) => n(_),
831
+ showFooter: !1
832
+ }
833
+ );
834
+ });
835
+ }
836
+ function vt(r) {
837
+ return new Promise((n) => {
838
+ J(
839
+ ft,
840
+ { condition: r },
841
+ {
842
+ title: "添加条件",
843
+ width: 500,
844
+ height: 300,
845
+ success: ({ data: _ }) => n(_),
846
+ showFooter: !1
847
+ }
848
+ );
849
+ });
850
+ }
851
+ const yt = { class: "source-wraper__left" }, gt = ["data-field"], bt = { class: "tip-icon" }, ht = { class: "source-wraper__right" }, kt = {
852
+ key: 4,
853
+ class: "filtrate-cell"
854
+ }, Tt = { class: "source-btn" }, Nt = /* @__PURE__ */ x({
855
+ __name: "setting",
856
+ setup(r) {
857
+ const n = A("refreshTable"), _ = A("getReportFields"), p = A("stateSetting", {}), m = he({
858
+ value: D.COLUMN,
859
+ list: Le
860
+ }), { onDragstart: y, onDragenter: u, onDragleave: s, onDragover: a, onDrop: t } = Ye();
861
+ function l() {
862
+ mt().then((d) => {
863
+ d !== "cancel" && (p.sql = d);
864
+ });
865
+ }
866
+ return (d, e) => {
867
+ const h = b("el-option"), C = b("el-select"), $ = b("el-empty"), X = b("el-scrollbar"), _e = b("el-segmented"), pe = b("bc-button");
868
+ return c(), T("div", {
869
+ class: "source-wraper",
870
+ onDragstart: e[6] || (e[6] = //@ts-ignore
871
+ (...g) => i(y) && i(y)(...g)),
872
+ onDragover: e[7] || (e[7] = //@ts-ignore
873
+ (...g) => i(a) && i(a)(...g)),
874
+ onDragenter: e[8] || (e[8] = //@ts-ignore
875
+ (...g) => i(u) && i(u)(...g)),
876
+ onDragleave: e[9] || (e[9] = //@ts-ignore
877
+ (...g) => i(s) && i(s)(...g)),
878
+ onDrop: e[10] || (e[10] = //@ts-ignore
879
+ (...g) => i(t) && i(t)(...g))
880
+ }, [
881
+ v("div", yt, [
882
+ N(C, {
883
+ modelValue: i(p).sourceData,
884
+ "onUpdate:modelValue": e[0] || (e[0] = (g) => i(p).sourceData = g),
885
+ filterable: "",
886
+ placeholder: "请选择数据集",
887
+ size: "default",
888
+ onChange: i(_)
889
+ }, {
890
+ default: k(() => [
891
+ (c(!0), T(L, null, R(i(p).sourceList, (g) => (c(), I(h, {
892
+ key: g.field_key,
893
+ label: g.field_name,
894
+ value: g.field_key
895
+ }, null, 8, ["label", "value"]))), 128))
896
+ ]),
897
+ _: 1
898
+ }, 8, ["modelValue", "onChange"]),
899
+ N(X, { class: "flex-1" }, {
900
+ default: k(() => [
901
+ i(p).sourceFields.length ? E("", !0) : (c(), I($, { key: 0 })),
902
+ (c(!0), T(L, null, R(i(p).sourceFields, (g) => (c(), T("div", {
903
+ key: g.field_key,
904
+ "data-field": g.field_key,
905
+ draggable: "true",
906
+ class: "field-item"
907
+ }, [
908
+ v("span", bt, S(i(de)(g.query_type)), 1),
909
+ v("span", null, S(g.field_name), 1)
910
+ ], 8, gt))), 128))
911
+ ]),
912
+ _: 1
913
+ })
914
+ ]),
915
+ v("div", ht, [
916
+ N(_e, {
917
+ modelValue: m.value,
918
+ "onUpdate:modelValue": e[1] || (e[1] = (g) => m.value = g),
919
+ options: m.list,
920
+ size: "default"
921
+ }, null, 8, ["modelValue", "options"]),
922
+ N(X, { class: "source-section" }, {
923
+ default: k(() => [
924
+ m.value === i(D).COLUMN ? (c(), I(j, {
925
+ key: 0,
926
+ tip: "列字段 / 维度",
927
+ title: "field_name",
928
+ field: "field_key",
929
+ type: "columns",
930
+ modelValue: i(p).columns,
931
+ "onUpdate:modelValue": e[2] || (e[2] = (g) => i(p).columns = g)
932
+ }, null, 8, ["modelValue"])) : E("", !0),
933
+ m.value === i(D).COLUMN ? (c(), I(j, {
934
+ key: 1,
935
+ tip: "列字段 / 指标",
936
+ title: "field_name",
937
+ field: "field_key",
938
+ type: "indicator",
939
+ modelValue: i(p).indicator,
940
+ "onUpdate:modelValue": e[3] || (e[3] = (g) => i(p).indicator = g)
941
+ }, null, 8, ["modelValue"])) : E("", !0),
942
+ m.value === i(D).FILTER ? (c(), I(j, {
943
+ key: 2,
944
+ tip: "列字段 / 检索",
945
+ title: "field_name",
946
+ field: "field_key",
947
+ type: "querys",
948
+ modelValue: i(p).querys,
949
+ "onUpdate:modelValue": e[4] || (e[4] = (g) => i(p).querys = g)
950
+ }, null, 8, ["modelValue"])) : E("", !0),
951
+ m.value === i(D).FILTER ? (c(), I(j, {
952
+ key: 3,
953
+ tip: "列字段 / 钻取",
954
+ title: "field_name",
955
+ field: "field_key",
956
+ type: "drills",
957
+ modelValue: i(p).drills,
958
+ "onUpdate:modelValue": e[5] || (e[5] = (g) => i(p).drills = g)
959
+ }, null, 8, ["modelValue"])) : E("", !0),
960
+ m.value === i(D).FILTER ? (c(), T("div", kt, [
961
+ e[11] || (e[11] = v("p", { class: "filtrate-cell__title" }, "筛选配置", -1)),
962
+ v("div", { class: "filtrate-cell__content" }, [
963
+ v("div", {
964
+ class: "filtrate-cell__content--item",
965
+ onClick: l
966
+ }, "自定义筛选配置")
967
+ ])
968
+ ])) : E("", !0)
969
+ ]),
970
+ _: 1
971
+ }),
972
+ v("div", Tt, [
973
+ N(pe, {
974
+ type: "primary",
975
+ size: "default",
976
+ onClick: i(n)
977
+ }, {
978
+ default: k(() => [...e[12] || (e[12] = [
979
+ w("保存配置", -1)
980
+ ])]),
981
+ _: 1
982
+ }, 8, ["onClick"])
983
+ ])
984
+ ])
985
+ ], 32);
986
+ };
987
+ }
988
+ }), St = /* @__PURE__ */ M(Nt, [["__scopeId", "data-v-4457f1dd"]]);
989
+ export {
990
+ St as default
991
+ };