hs-admin-ui 17.3.8 → 17.4.0

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.
@@ -1,1299 +0,0 @@
1
- import { defineComponent as L, ref as U, resolveComponent as y, createElementBlock as h, openBlock as r, createElementVNode as m, createTextVNode as C, toDisplayString as E, createVNode as S, withCtx as T, inject as A, onBeforeUnmount as ce, nextTick as ue, Fragment as x, createBlock as k, createCommentVNode as b, Teleport as _e, normalizeStyle as fe, renderList as P, mergeModels as te, useModel as ne, computed as oe, TransitionGroup as pe, withModifiers as q, normalizeClass as me, provide as ee, reactive as ve } from "vue";
2
- import { S as B, F as V, P as f, a as Y, b as z, c as G, d as F, e as X, f as D, N as R, t as ge, g as j, v as Q } from "./index-BXyDaZdc.js";
3
- import { H as M, ao as Z, I as i, ak as ye, T as H } from "./bcVisual.vue_vue_type_style_index_0_scoped_39bc1e22_lang-BFVb0IvA.js";
4
- const be = /* @__PURE__ */ L({
5
- __name: "popup",
6
- props: {
7
- row: {
8
- type: Object
9
- },
10
- close: {
11
- type: Function
12
- }
13
- },
14
- setup(c, { expose: t }) {
15
- var v;
16
- t();
17
- const n = c, e = U((v = n.row) == null ? void 0 : v.show_name);
18
- function g() {
19
- n.close(e.value);
20
- }
21
- const u = { props: n, showName: e, submit: g };
22
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
23
- }
24
- }), Te = { class: "update-name" }, Ne = { class: "content" }, he = { class: "item" }, Se = { class: "item" }, ke = { class: "item" }, Ee = { class: "footer" };
25
- function Ce(c, t, n, e, g, u) {
26
- const v = y("el-input"), _ = y("el-button"), s = y("bc-button");
27
- return r(), h("div", Te, [
28
- m("div", Ne, [
29
- m("div", he, [
30
- t[2] || (t[2] = m(
31
- "span",
32
- { class: "show-name" },
33
- "字段名称:",
34
- -1
35
- /* CACHED */
36
- )),
37
- C(
38
- E(n.row.name),
39
- 1
40
- /* TEXT */
41
- )
42
- ]),
43
- m("div", Se, [
44
- t[3] || (t[3] = m(
45
- "span",
46
- { class: "show-name" },
47
- "字段键值:",
48
- -1
49
- /* CACHED */
50
- )),
51
- C(
52
- E(n.row.field),
53
- 1
54
- /* TEXT */
55
- )
56
- ]),
57
- m("div", ke, [
58
- t[4] || (t[4] = m(
59
- "span",
60
- { class: "show-name" },
61
- "显示名称:",
62
- -1
63
- /* CACHED */
64
- )),
65
- S(v, {
66
- modelValue: e.showName,
67
- "onUpdate:modelValue": t[0] || (t[0] = (d) => e.showName = d),
68
- clearable: "",
69
- placeholder: "请输入",
70
- size: "default"
71
- }, null, 8, ["modelValue"])
72
- ])
73
- ]),
74
- m("footer", Ee, [
75
- S(_, {
76
- size: "default",
77
- onClick: t[1] || (t[1] = (d) => n.close("cancel"))
78
- }, {
79
- default: T(() => [...t[5] || (t[5] = [
80
- C(
81
- "关闭",
82
- -1
83
- /* CACHED */
84
- )
85
- ])]),
86
- _: 1
87
- /* STABLE */
88
- }),
89
- S(s, {
90
- type: "primary",
91
- size: "default",
92
- onClick: e.submit
93
- }, {
94
- default: T(() => [...t[6] || (t[6] = [
95
- C(
96
- "确定",
97
- -1
98
- /* CACHED */
99
- )
100
- ])]),
101
- _: 1
102
- /* STABLE */
103
- })
104
- ])
105
- ]);
106
- }
107
- const Ie = /* @__PURE__ */ M(be, [["render", Ce], ["__scopeId", "data-v-b14e7f33"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/updateName/popup.vue"]]);
108
- function we(c) {
109
- return new Promise((t) => {
110
- Z(
111
- Ie,
112
- { row: c },
113
- {
114
- title: "修改显示名称",
115
- width: 500,
116
- height: 350,
117
- zIndex: 99999,
118
- className: "context-wrap__content",
119
- success: ({ data: n }) => t(n),
120
- showFooter: !1
121
- }
122
- );
123
- });
124
- }
125
- const De = {
126
- [D.TEXT]: "string",
127
- [D.NUMBER]: "number",
128
- [D.DATE]: "date",
129
- [D.SELECT_R]: "radio_▼",
130
- [D.SELECT_M]: "multiple_▼",
131
- [D.SELECT_T]: "tree_▼"
132
- };
133
- function le(c) {
134
- return De[c];
135
- }
136
- const W = U(""), Oe = [
137
- { label: "列配置", value: B.COLUMN },
138
- { label: "检索配置", value: B.FILTER }
139
- ], ae = [
140
- { label: "无", value: V.NONE },
141
- { label: "求和", value: V.SUM },
142
- { label: "平均", value: V.AVERAGE },
143
- { label: "最大值", value: V.MAX },
144
- { label: "最小值", value: V.MIN },
145
- { label: "计数", value: V.COUNT },
146
- { label: "去重计数", value: V.COUNTDISTINCT }
147
- ], de = [
148
- { label: "无", value: Y.NONE },
149
- { label: "占比", value: Y.RATE }
150
- ], J = [
151
- { label: "无", value: z.NONE },
152
- { label: "升序", value: z.ASC },
153
- { label: "降序", value: z.DESC }
154
- ], K = [
155
- { label: "无", value: G.NONE },
156
- { label: "合计", value: G.SUM }
157
- ], $ = [
158
- { label: "隐藏", value: F.HIDE },
159
- { label: "显示", value: F.SHOW }
160
- ], ie = [
161
- { label: "不统计", value: X.NONE },
162
- { label: "统计", value: X.STATISTICS }
163
- ], se = [
164
- { label: "AND", value: R.AND },
165
- { label: "OR", value: R.OR }
166
- ], Ve = [
167
- {
168
- label: "排序方式",
169
- value: f.SORT,
170
- children: J
171
- },
172
- {
173
- label: "显示名称",
174
- value: f.EDIT_NAME
175
- },
176
- {
177
- label: "是否隐藏",
178
- value: f.SHOW,
179
- children: $
180
- },
181
- {
182
- label: "分组统计",
183
- value: f.STATISTICS,
184
- children: ie
185
- },
186
- {
187
- label: "底部合计",
188
- value: f.SUM,
189
- children: K
190
- },
191
- {
192
- label: "小数位数",
193
- value: f.POINT
194
- }
195
- ], xe = [
196
- {
197
- label: "显示名称",
198
- value: f.EDIT_NAME
199
- }
200
- ], Le = [
201
- {
202
- label: "汇总方式",
203
- value: f.COLLECT,
204
- children: ae
205
- },
206
- {
207
- label: "占比计算",
208
- value: f.CALC,
209
- children: de
210
- },
211
- {
212
- label: "排序方式",
213
- value: f.SORT,
214
- children: J
215
- },
216
- {
217
- label: "显示名称",
218
- value: f.EDIT_NAME
219
- },
220
- {
221
- label: "小数位数",
222
- value: f.POINT
223
- },
224
- {
225
- label: "底部合计",
226
- value: f.SUM,
227
- children: K
228
- },
229
- {
230
- label: "是否隐藏",
231
- value: f.SHOW,
232
- children: $
233
- }
234
- ], Me = /* @__PURE__ */ L({
235
- __name: "extendItem",
236
- props: ["data", "size"],
237
- emits: ["click"],
238
- setup(c, { expose: t }) {
239
- t();
240
- const n = c, e = U(n.size.right), g = U(n.size.top), u = A("stateSetting", {});
241
- ce(() => {
242
- W.value = "";
243
- });
244
- function v(a) {
245
- var p, N;
246
- e.value = ((N = (p = document.querySelector(".context-box")) == null ? void 0 : p.getBoundingClientRect()) == null ? void 0 : N.right) || n.size.right;
247
- const o = a.target;
248
- g.value = n.size.top + o.offsetTop, n.data.children && n.data.children.length ? W.value = n.data.label : W.value = "";
249
- }
250
- function _(a) {
251
- const o = {
252
- [f.COLLECT]: () => i.set(
253
- i.find(u.indicator, {
254
- field_key: n.data.data.field_key
255
- }),
256
- "field_way",
257
- a.value
258
- ),
259
- [f.CALC]: () => i.set(
260
- i.find(u.indicator, {
261
- field_key: n.data.data.field_key
262
- }),
263
- "field_proportion",
264
- a.value
265
- ),
266
- [f.SORT]: () => {
267
- i.set(i.find(u.columns, { field_key: n.data.data.field_key }), "report_field_sort", a.value), i.set(
268
- i.find(u.indicator, {
269
- field_key: n.data.data.field_key
270
- }),
271
- "report_field_sort",
272
- a.value
273
- );
274
- },
275
- [f.STATISTICS]: () => i.set(i.find(u.columns, { field_key: n.data.data.field_key }), "report_field_group", a.value),
276
- [f.SUM]: () => {
277
- i.set(i.find(u.columns, { field_key: n.data.data.field_key }), "report_field_sum", a.value), i.set(
278
- i.find(u.indicator, {
279
- field_key: n.data.data.field_key
280
- }),
281
- "report_field_sum",
282
- a.value
283
- );
284
- },
285
- [f.SHOW]: () => {
286
- i.set(i.find(u.columns, { field_key: n.data.data.field_key }), "report_field_show", a.value), i.set(
287
- i.find(u.indicator, {
288
- field_key: n.data.data.field_key
289
- }),
290
- "report_field_show",
291
- a.value
292
- );
293
- }
294
- };
295
- i.get(o, n.data.value) && (i.get(o, n.data.value)(), ue(() => {
296
- var p, N;
297
- e.value = ((N = (p = document.querySelector(".context-box")) == null ? void 0 : p.getBoundingClientRect()) == null ? void 0 : N.right) || n.size.right;
298
- }));
299
- }
300
- function s(a) {
301
- switch (n.data.value) {
302
- case f.COLLECT:
303
- return n.data.data.field_way === a.value;
304
- case f.CALC:
305
- return n.data.data.field_proportion === a.value;
306
- case f.SORT:
307
- return n.data.data.report_field_sort === a.value;
308
- case f.SUM:
309
- return n.data.data.report_field_sum === a.value;
310
- case f.SHOW:
311
- return n.data.data.report_field_show === a.value;
312
- case f.STATISTICS:
313
- return n.data.data.report_field_group === a.value;
314
- }
315
- }
316
- function d() {
317
- var a, o, p, N, I, w;
318
- switch (n.data.value) {
319
- case f.COLLECT:
320
- return ((a = i.find(ae, { value: n.data.data.field_way })) == null ? void 0 : a.label) || "";
321
- case f.CALC:
322
- return ((o = i.find(de, { value: n.data.data.field_proportion })) == null ? void 0 : o.label) || "";
323
- case f.SORT:
324
- return ((p = i.find(J, { value: n.data.data.report_field_sort })) == null ? void 0 : p.label) || "";
325
- case f.POINT:
326
- return n.data.data.report_field_point || "";
327
- case f.SUM:
328
- return ((N = i.find(K, { value: n.data.data.report_field_sum })) == null ? void 0 : N.label) || "";
329
- case f.SHOW:
330
- return ((I = i.find($, { value: n.data.data.report_field_show })) == null ? void 0 : I.label) || "";
331
- case f.STATISTICS:
332
- return ((w = i.find(ie, { value: n.data.data.report_field_group })) == null ? void 0 : w.label) || "";
333
- default:
334
- return "";
335
- }
336
- }
337
- const l = { props: n, offsetLeft: e, offsetTop: g, stateSetting: u, onMouseEnter: v, setItem: _, showItem: s, getDataTypeName: d, get hoverItem() {
338
- return W;
339
- } };
340
- return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
341
- }
342
- }), Ae = { class: "extend-content__text" }, Ue = { key: 0 }, Pe = ["onClick"];
343
- function Fe(c, t, n, e, g, u) {
344
- const v = y("bc-icon");
345
- return r(), h(
346
- x,
347
- null,
348
- [
349
- m(
350
- "div",
351
- {
352
- class: "extend-content",
353
- onMouseenter: e.onMouseEnter,
354
- onClick: t[0] || (t[0] = (_) => c.$emit("click"))
355
- },
356
- [
357
- m("span", Ae, [
358
- C(
359
- E(n.data.label) + " ",
360
- 1
361
- /* TEXT */
362
- ),
363
- e.getDataTypeName() ? (r(), h(
364
- "span",
365
- Ue,
366
- "(" + E(e.getDataTypeName()) + ")",
367
- 1
368
- /* TEXT */
369
- )) : b("v-if", !0)
370
- ]),
371
- n.data.children && n.data.children.length ? (r(), k(v, {
372
- key: 0,
373
- name: "ele-ArrowRight"
374
- })) : b("v-if", !0)
375
- ],
376
- 32
377
- /* NEED_HYDRATION */
378
- ),
379
- (r(), k(_e, { to: "body" }, [
380
- e.hoverItem === n.data.label ? (r(), h(
381
- "div",
382
- {
383
- key: 0,
384
- class: "context-wrap__content",
385
- style: fe({ left: `${e.offsetLeft}px`, top: `${e.offsetTop}px` })
386
- },
387
- [
388
- (r(!0), h(
389
- x,
390
- null,
391
- P(n.data.children, (_, s) => (r(), h("div", {
392
- class: "content__item",
393
- key: s,
394
- onClick: (d) => e.setItem(_)
395
- }, [
396
- m(
397
- "span",
398
- null,
399
- E(_.label),
400
- 1
401
- /* TEXT */
402
- ),
403
- e.showItem(_) ? (r(), k(v, {
404
- key: 0,
405
- name: "ele-Check",
406
- color: "#409eff"
407
- })) : b("v-if", !0)
408
- ], 8, Pe))),
409
- 128
410
- /* KEYED_FRAGMENT */
411
- ))
412
- ],
413
- 4
414
- /* STYLE */
415
- )) : b("v-if", !0)
416
- ]))
417
- ],
418
- 64
419
- /* STABLE_FRAGMENT */
420
- );
421
- }
422
- const Re = /* @__PURE__ */ M(Me, [["render", Fe], ["__scopeId", "data-v-d1a06dbd"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/setting/extendItem.vue"]]), qe = /* @__PURE__ */ L({
423
- __name: "dragItem",
424
- props: /* @__PURE__ */ te({
425
- tip: {
426
- type: String,
427
- default: "标题"
428
- },
429
- title: {
430
- type: String,
431
- default: "field_name"
432
- },
433
- field: {
434
- type: String,
435
- default: "field_key"
436
- },
437
- type: {
438
- type: String,
439
- default: "columns"
440
- }
441
- }, {
442
- modelValue: { type: Array, default: [] },
443
- modelModifiers: {}
444
- }),
445
- emits: ["update:modelValue"],
446
- setup(c, { expose: t }) {
447
- t();
448
- const n = c, e = ne(c, "modelValue"), g = oe({
449
- get: () => e.value,
450
- set(d) {
451
- e.value = d.map((l, a) => ({ ...l, data_sort: a }));
452
- }
453
- });
454
- function u(d) {
455
- const l = e.value.findIndex((a) => i.get(a, n.field) === d);
456
- e.value.splice(l, 1);
457
- }
458
- function v(d, l) {
459
- var a;
460
- d.value === f.EDIT_NAME && we({
461
- name: i.get(d, `data.${n.title}`),
462
- field: i.get(d, `data.${n.field}`),
463
- show_name: i.get(d, "data.show_name", "")
464
- }).then((o) => {
465
- o !== "cancel" && (i.set(i.find(e.value, { field_key: d.data.field_key }), "show_name", o), l());
466
- }), d.value === f.POINT && ye.prompt("请填写小数位数", "提示", {
467
- confirmButtonText: "确定",
468
- cancelButtonText: "取消",
469
- inputPattern: /^\d+$/,
470
- inputErrorMessage: "请输入数字",
471
- draggable: !0,
472
- inputValue: (a = i.find(e.value, { field_key: d.data.field_key })) == null ? void 0 : a.report_field_point,
473
- customClass: "context-wrap__content"
474
- }).then(({ value: o }) => {
475
- i.set(i.find(e.value, { field_key: d.data.field_key }), "report_field_point", o);
476
- });
477
- }
478
- function _(d) {
479
- const l = {
480
- columns: Ve,
481
- querys: xe,
482
- indicator: Le
483
- };
484
- return n.type === "columns" && d.query_type !== D.NUMBER ? i.get(l, n.type, []).filter((a) => a.value !== f.POINT).map((a) => Object.assign(a, { data: d })) : i.get(l, n.type, []).map((a) => Object.assign(a, { data: d }));
485
- }
486
- const s = { props: n, modelValue: e, columns: g, deleteItem: u, closeItem: v, getMenu: _, get VueDraggable() {
487
- return ge;
488
- }, get _() {
489
- return i;
490
- }, ExtendItem: Re, get getFieldType() {
491
- return le;
492
- } };
493
- return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
494
- }
495
- }), ze = { class: "source-column-cell" }, je = { class: "column-title" }, He = ["data-column"], We = { class: "tip-icon" }, Be = ["onClick"];
496
- function Ge(c, t, n, e, g, u) {
497
- const v = y("el-empty"), _ = y("bc-icon"), s = y("bc-context-box");
498
- return r(), h("div", ze, [
499
- m(
500
- "p",
501
- je,
502
- E(n.tip),
503
- 1
504
- /* TEXT */
505
- ),
506
- m("div", {
507
- class: "column-cell",
508
- "data-column": n.type
509
- }, [
510
- e.columns.length ? b("v-if", !0) : (r(), k(v, {
511
- key: 0,
512
- "image-size": 50
513
- })),
514
- S(e.VueDraggable, {
515
- modelValue: e.columns,
516
- "onUpdate:modelValue": t[0] || (t[0] = (d) => e.columns = d),
517
- animation: 300,
518
- class: "field-column-wrap"
519
- }, {
520
- default: T(() => [
521
- S(pe, {
522
- type: "transition",
523
- name: "fade"
524
- }, {
525
- default: T(() => [
526
- (r(!0), h(
527
- x,
528
- null,
529
- P(e.columns, (d) => (r(), k(s, {
530
- getMenu: () => e.getMenu(d),
531
- key: e._.get(d, e.props.field),
532
- trigger: "click",
533
- class: "field-column-item"
534
- }, {
535
- content: T(({ data: l, size: a, close: o }) => [
536
- S(e.ExtendItem, {
537
- data: l,
538
- size: a,
539
- onClick: (p) => e.closeItem(l, o)
540
- }, null, 8, ["data", "size", "onClick"])
541
- ]),
542
- default: T(() => [
543
- m(
544
- "span",
545
- We,
546
- E(e.getFieldType(d.query_type)),
547
- 1
548
- /* TEXT */
549
- ),
550
- m(
551
- "span",
552
- null,
553
- E(e._.get(d, "show_name") || e._.get(d, e.props.title)),
554
- 1
555
- /* TEXT */
556
- ),
557
- m("div", {
558
- class: "icon-delete",
559
- onClick: q((l) => e.deleteItem(e._.get(d, e.props.field)), ["stop"])
560
- }, [
561
- S(_, { name: "ele-Delete" })
562
- ], 8, Be)
563
- ]),
564
- _: 2
565
- /* DYNAMIC */
566
- }, 1032, ["getMenu"]))),
567
- 128
568
- /* KEYED_FRAGMENT */
569
- ))
570
- ]),
571
- _: 1
572
- /* STABLE */
573
- })
574
- ]),
575
- _: 1
576
- /* STABLE */
577
- }, 8, ["modelValue"])
578
- ], 8, He)
579
- ]);
580
- }
581
- const Qe = /* @__PURE__ */ M(qe, [["render", Ge], ["__scopeId", "data-v-4551cccf"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/setting/dragItem.vue"]]);
582
- function Ye() {
583
- const c = A("stateSetting"), t = U("");
584
- function n(_) {
585
- const s = _.target;
586
- t.value = (s == null ? void 0 : s.getAttribute("data-field")) || "";
587
- }
588
- function e(_) {
589
- const s = _.target.closest(".column-cell");
590
- s && setTimeout(() => {
591
- s.classList.add("drag-enter");
592
- });
593
- }
594
- function g(_) {
595
- const s = _.target.closest(".column-cell");
596
- s && s.classList.remove("drag-enter");
597
- }
598
- function u(_) {
599
- _.preventDefault();
600
- }
601
- function v(_) {
602
- var a, o;
603
- if (!t.value)
604
- return;
605
- const s = _.target.closest(".column-cell");
606
- if (!s)
607
- return;
608
- s.classList.remove("drag-enter");
609
- const d = s.getAttribute("data-column"), l = i.cloneDeep(i.find(c.sourceFields, { field_key: t.value }));
610
- if (i.find(i.get(c, d), { id: l.id }))
611
- return H.warning("该字段已存在");
612
- if (d === "columns" && i.find(i.get(c, "indicator"), { id: l.id }))
613
- return H.warning("列字段/指标已存在该字段");
614
- if (d === "indicator" && i.find(i.get(c, "columns"), { id: l.id }))
615
- return H.warning("列字段/维度已存在该字段");
616
- if (d === "indicator" && l.query_type !== D.NUMBER)
617
- return H.warning("只有数值型字段允许拖入指标列中!");
618
- d === "columns" && (l.field_data_type = j.WEI_DU, l.report_field_sort = z.NONE, l.report_field_show = F.SHOW, l.report_field_group = X.NONE, l.query_type === D.NUMBER && (l.report_field_point = 2), l.report_field_sum = G.NONE), d === "indicator" && (l.field_way = V.NONE, l.field_data_type = j.ZHI_BIAO, l.field_proportion = Y.NONE, l.report_field_sort = z.NONE, l.report_field_point = 2, l.report_field_sum = G.NONE, l.report_field_show = F.SHOW), d === "drills" && (l.field_data_type = j.Z_WEI_DU, l.report_field_show = F.SHOW), d === "querys" && (l.field_data_type = j.SHAI_XUAN, l.report_field_show = F.SHOW), (a = i.get(c, d)) == null || a.push(l), (o = i.get(c, d)) == null || o.forEach((p, N) => {
619
- p.data_sort = N;
620
- }), t.value = "";
621
- }
622
- return {
623
- fieldItem: t,
624
- onDragstart: n,
625
- onDragenter: e,
626
- onDragleave: g,
627
- onDragover: u,
628
- onDrop: v
629
- };
630
- }
631
- const Xe = /* @__PURE__ */ L({
632
- __name: "nodeTree",
633
- props: /* @__PURE__ */ te({
634
- parent: {
635
- type: Object,
636
- default: () => ({})
637
- }
638
- }, {
639
- modelValue: { type: Array, default: () => [] },
640
- modelModifiers: {}
641
- }),
642
- emits: ["update:modelValue"],
643
- setup(c, { expose: t }) {
644
- t();
645
- const n = ne(c, "modelValue"), e = A("addNode"), g = A("addCondition"), u = { modelValue: n, addNode: e, addCondition: g, NodeTree: re, get relationList() {
646
- return se;
647
- }, get _() {
648
- return i;
649
- } };
650
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
651
- }
652
- }), Ze = { class: "node-tree" }, Je = { class: "node" }, Ke = {
653
- key: 0,
654
- class: "text"
655
- }, $e = {
656
- key: 1,
657
- class: "btns-setting"
658
- };
659
- function et(c, t, n, e, g, u) {
660
- const v = y("el-dropdown-item"), _ = y("el-dropdown-menu"), s = y("el-dropdown"), d = y("hs-button");
661
- return r(), h("div", Ze, [
662
- (r(!0), h(
663
- x,
664
- null,
665
- P(e.modelValue, (l, a) => (r(), h("div", {
666
- key: a,
667
- class: "node-tree-content"
668
- }, [
669
- m(
670
- "div",
671
- {
672
- class: me(["node-tree-item", `level-${l.level}`, { add: l.type !== "add" }])
673
- },
674
- [
675
- l.type === "add" ? (r(), k(
676
- s,
677
- { key: 0 },
678
- {
679
- dropdown: T(() => [
680
- S(
681
- _,
682
- null,
683
- {
684
- default: T(() => [
685
- (r(!0), h(
686
- x,
687
- null,
688
- P(e.relationList, (o) => (r(), k(v, {
689
- key: o.value,
690
- onClick: q((p) => l.relation = o.value, ["stop"])
691
- }, {
692
- default: T(() => [
693
- C(
694
- E(o.label),
695
- 1
696
- /* TEXT */
697
- )
698
- ]),
699
- _: 2
700
- /* DYNAMIC */
701
- }, 1032, ["onClick"]))),
702
- 128
703
- /* KEYED_FRAGMENT */
704
- ))
705
- ]),
706
- _: 2
707
- /* DYNAMIC */
708
- },
709
- 1024
710
- /* DYNAMIC_SLOTS */
711
- )
712
- ]),
713
- default: T(() => [
714
- m(
715
- "span",
716
- Je,
717
- E(l.relation),
718
- 1
719
- /* TEXT */
720
- )
721
- ]),
722
- _: 2
723
- /* DYNAMIC */
724
- },
725
- 1024
726
- /* DYNAMIC_SLOTS */
727
- )) : b("v-if", !0)
728
- ],
729
- 2
730
- /* CLASS */
731
- ),
732
- l.type === "add" ? (r(), h(
733
- "span",
734
- Ke,
735
- E(l.nodeName),
736
- 1
737
- /* TEXT */
738
- )) : b("v-if", !0),
739
- b(" 节点操作按钮 "),
740
- l.children && l.children.length == 0 ? (r(), h("div", $e, [
741
- l.btnType.includes("addCondition") ? (r(), k(d, {
742
- key: 0,
743
- plain: "",
744
- type: "primary",
745
- size: "small",
746
- onClick: q((o) => e.addCondition(l), ["stop"])
747
- }, {
748
- default: T(() => [...t[1] || (t[1] = [
749
- C(
750
- "添加条件",
751
- -1
752
- /* CACHED */
753
- )
754
- ])]),
755
- _: 1
756
- /* STABLE */
757
- }, 8, ["onClick"])) : b("v-if", !0),
758
- l.btnType.includes("addNode") ? (r(), k(d, {
759
- key: 1,
760
- plain: "",
761
- type: "primary",
762
- size: "small",
763
- onClick: t[0] || (t[0] = q((o) => e.addNode(n.parent), ["stop"]))
764
- }, {
765
- default: T(() => [...t[2] || (t[2] = [
766
- C(
767
- "添加关系",
768
- -1
769
- /* CACHED */
770
- )
771
- ])]),
772
- _: 1
773
- /* STABLE */
774
- })) : b("v-if", !0)
775
- ])) : b("v-if", !0),
776
- b(" 递归组件自身 "),
777
- e._.isEmpty(l.children) ? b("v-if", !0) : (r(), k(e.NodeTree, {
778
- key: 2,
779
- class: "node-tree-children",
780
- modelValue: l.children,
781
- "onUpdate:modelValue": (o) => l.children = o,
782
- parent: l
783
- }, null, 8, ["modelValue", "onUpdate:modelValue", "parent"]))
784
- ]))),
785
- 128
786
- /* KEYED_FRAGMENT */
787
- ))
788
- ]);
789
- }
790
- const re = /* @__PURE__ */ M(Xe, [["render", et], ["__scopeId", "data-v-5b2ae2a2"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/updateSql/nodeTree/nodeTree.vue"]]), tt = /* @__PURE__ */ L({
791
- __name: "index",
792
- props: {
793
- modelValue: {
794
- type: Array,
795
- default: () => []
796
- }
797
- },
798
- emits: ["update:modelValue"],
799
- setup(c, { expose: t, emit: n }) {
800
- t();
801
- const e = c, g = n, u = oe({
802
- get: () => v(e.modelValue),
803
- set: (a) => {
804
- g("update:modelValue", a);
805
- }
806
- });
807
- function v(a) {
808
- const o = (p, N = 1) => {
809
- for (let I of p)
810
- I.level = N, I.children && I.children.length && o(I.children, N + 1);
811
- };
812
- return o(a), a;
813
- }
814
- function _(a) {
815
- const o = [];
816
- function p(N, I = []) {
817
- return N.reduce((w, O) => (w.push(O), O != null && O.children && O.children.length && w.push(...p(O.children)), w), I);
818
- }
819
- return p(a, o), o;
820
- }
821
- function s(a) {
822
- const p = _(u.value).find((O) => O.nodeId == a.nodeId);
823
- if (!p)
824
- return;
825
- const N = p.children.length, I = Q(), w = i.cloneDeep(p.children);
826
- w.splice(N - 1, 0, {
827
- nodeName: "",
828
- pId: p.nodeId,
829
- nodeId: I,
830
- type: "add",
831
- btnType: ["addCondition", "addNode"],
832
- relation: R.AND,
833
- children: [
834
- {
835
- nodeName: "",
836
- pId: I,
837
- nodeId: Q(),
838
- btnType: ["addCondition", "addNode"],
839
- relation: R.AND,
840
- children: []
841
- }
842
- ]
843
- }), w.length > 1 && i.get(w, "0.children.0.btnType") && i.set(w, "0.children.0.btnType", ["addCondition"]), p.children = w;
844
- }
845
- function d(a) {
846
- const p = _(u.value).find((N) => N.nodeId == a.pId);
847
- Tt(a).then((N) => {
848
- p != null && p.children && (p == null ? void 0 : p.children.length) === 1 ? Object.assign(p, N, {
849
- btnType: [],
850
- type: "add",
851
- children: []
852
- }) : Object.assign(a, N, {
853
- btnType: [],
854
- type: "add",
855
- children: []
856
- });
857
- });
858
- }
859
- ee("addNode", s), ee("addCondition", d);
860
- const l = { props: e, emit: g, treeNode: u, getTreeNode: v, treeToList: _, addNode: s, addCondition: d, NodeTree: re };
861
- return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
862
- }
863
- });
864
- function nt(c, t, n, e, g, u) {
865
- return r(), k(e.NodeTree, {
866
- modelValue: e.treeNode,
867
- "onUpdate:modelValue": t[0] || (t[0] = (v) => e.treeNode = v)
868
- }, null, 8, ["modelValue"]);
869
- }
870
- const ot = /* @__PURE__ */ M(tt, [["render", nt], ["__scopeId", "data-v-4a5d188d"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/updateSql/nodeTree/index.vue"]]), lt = /* @__PURE__ */ L({
871
- __name: "popup",
872
- props: {
873
- sql: {
874
- type: String
875
- },
876
- close: {
877
- type: Function
878
- }
879
- },
880
- setup(c, { expose: t }) {
881
- t();
882
- const n = c, e = Q(), g = U([
883
- {
884
- nodeName: "",
885
- pId: "",
886
- nodeId: e,
887
- type: "add",
888
- relation: R.AND,
889
- btnType: ["addCondition", "addNode"],
890
- children: [
891
- {
892
- nodeName: "",
893
- pId: e,
894
- nodeId: Q(),
895
- relation: R.AND,
896
- btnType: ["addCondition", "addNode"],
897
- children: []
898
- }
899
- ]
900
- }
901
- ]);
902
- function u() {
903
- let _ = "";
904
- const s = (d) => {
905
- for (let l of d)
906
- l.type === "add" && l.nodeName && (_ += `${l.relation} ${l.nodeName} `), l.children && l.children.length && s(l.children);
907
- };
908
- s(g.value), n.close(_);
909
- }
910
- const v = { props: n, nodeId: e, treeNodes: g, submit: u, get NodeTree() {
911
- return ot;
912
- } };
913
- return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
914
- }
915
- }), at = { class: "sql-wraper" }, dt = { class: "content" }, it = { class: "footer" };
916
- function st(c, t, n, e, g, u) {
917
- const v = y("el-button"), _ = y("bc-button");
918
- return r(), h("div", at, [
919
- m("div", dt, [
920
- S(e.NodeTree, {
921
- modelValue: e.treeNodes,
922
- "onUpdate:modelValue": t[0] || (t[0] = (s) => e.treeNodes = s)
923
- }, null, 8, ["modelValue"])
924
- ]),
925
- m("footer", it, [
926
- S(v, {
927
- size: "default",
928
- onClick: t[1] || (t[1] = (s) => n.close("cancel"))
929
- }, {
930
- default: T(() => [...t[2] || (t[2] = [
931
- C(
932
- "关闭",
933
- -1
934
- /* CACHED */
935
- )
936
- ])]),
937
- _: 1
938
- /* STABLE */
939
- }),
940
- S(_, {
941
- type: "primary",
942
- size: "default",
943
- onClick: e.submit
944
- }, {
945
- default: T(() => [...t[3] || (t[3] = [
946
- C(
947
- "确定",
948
- -1
949
- /* CACHED */
950
- )
951
- ])]),
952
- _: 1
953
- /* STABLE */
954
- })
955
- ])
956
- ]);
957
- }
958
- const rt = /* @__PURE__ */ M(lt, [["render", st], ["__scopeId", "data-v-4a2755c4"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/updateSql/popup.vue"]]), ct = /* @__PURE__ */ L({
959
- __name: "addCondition",
960
- props: {
961
- condition: {
962
- type: Object,
963
- default: () => ({})
964
- },
965
- close: {
966
- type: Function
967
- }
968
- },
969
- setup(c, { expose: t }) {
970
- t();
971
- const n = c, e = U(n.condition);
972
- function g() {
973
- n.close(e.value);
974
- }
975
- const u = { props: n, sqlQuery: e, submit: g, get relationList() {
976
- return se;
977
- } };
978
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
979
- }
980
- }), ut = { class: "sql-wraper" }, _t = { class: "content" }, ft = { class: "item" }, pt = { class: "node" }, mt = { class: "param-item" }, vt = { class: "footer" };
981
- function gt(c, t, n, e, g, u) {
982
- const v = y("el-dropdown-item"), _ = y("el-dropdown-menu"), s = y("el-dropdown"), d = y("el-input"), l = y("el-button"), a = y("bc-button");
983
- return r(), h("div", ut, [
984
- m("div", _t, [
985
- m("div", ft, [
986
- S(s, null, {
987
- dropdown: T(() => [
988
- S(_, null, {
989
- default: T(() => [
990
- (r(!0), h(
991
- x,
992
- null,
993
- P(e.relationList, (o) => (r(), k(v, {
994
- key: o.value,
995
- onClick: q((p) => e.sqlQuery.relation = o.value, ["stop"])
996
- }, {
997
- default: T(() => [
998
- C(
999
- E(o.label),
1000
- 1
1001
- /* TEXT */
1002
- )
1003
- ]),
1004
- _: 2
1005
- /* DYNAMIC */
1006
- }, 1032, ["onClick"]))),
1007
- 128
1008
- /* KEYED_FRAGMENT */
1009
- ))
1010
- ]),
1011
- _: 1
1012
- /* STABLE */
1013
- })
1014
- ]),
1015
- default: T(() => [
1016
- m(
1017
- "span",
1018
- pt,
1019
- E(e.sqlQuery.relation),
1020
- 1
1021
- /* TEXT */
1022
- )
1023
- ]),
1024
- _: 1
1025
- /* STABLE */
1026
- }),
1027
- m("div", mt, [
1028
- t[2] || (t[2] = m(
1029
- "span",
1030
- { class: "show-name" },
1031
- "固定值",
1032
- -1
1033
- /* CACHED */
1034
- )),
1035
- S(d, {
1036
- modelValue: e.sqlQuery.nodeName,
1037
- "onUpdate:modelValue": t[0] || (t[0] = (o) => e.sqlQuery.nodeName = o),
1038
- size: "default",
1039
- clearable: "",
1040
- placeholder: "请输入"
1041
- }, null, 8, ["modelValue"])
1042
- ])
1043
- ])
1044
- ]),
1045
- m("footer", vt, [
1046
- S(l, {
1047
- size: "default",
1048
- onClick: t[1] || (t[1] = (o) => n.close("cancel"))
1049
- }, {
1050
- default: T(() => [...t[3] || (t[3] = [
1051
- C(
1052
- "关闭",
1053
- -1
1054
- /* CACHED */
1055
- )
1056
- ])]),
1057
- _: 1
1058
- /* STABLE */
1059
- }),
1060
- S(a, {
1061
- type: "primary",
1062
- size: "default",
1063
- onClick: e.submit
1064
- }, {
1065
- default: T(() => [...t[4] || (t[4] = [
1066
- C(
1067
- "确定",
1068
- -1
1069
- /* CACHED */
1070
- )
1071
- ])]),
1072
- _: 1
1073
- /* STABLE */
1074
- })
1075
- ])
1076
- ]);
1077
- }
1078
- const yt = /* @__PURE__ */ M(ct, [["render", gt], ["__scopeId", "data-v-cec04ed3"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/updateSql/addCondition.vue"]]);
1079
- function bt(c) {
1080
- return new Promise((t) => {
1081
- Z(
1082
- rt,
1083
- { sql: c },
1084
- {
1085
- title: "添加过滤",
1086
- success: ({ data: n }) => t(n),
1087
- showFooter: !1
1088
- }
1089
- );
1090
- });
1091
- }
1092
- function Tt(c) {
1093
- return new Promise((t) => {
1094
- Z(
1095
- yt,
1096
- { condition: c },
1097
- {
1098
- title: "添加条件",
1099
- width: 500,
1100
- height: 300,
1101
- success: ({ data: n }) => t(n),
1102
- showFooter: !1
1103
- }
1104
- );
1105
- });
1106
- }
1107
- const Nt = /* @__PURE__ */ L({
1108
- __name: "setting",
1109
- setup(c, { expose: t }) {
1110
- t();
1111
- const n = A("refreshTable"), e = A("getReportFields"), g = A("stateSetting", {}), u = ve({
1112
- value: B.COLUMN,
1113
- list: Oe
1114
- }), { onDragstart: v, onDragenter: _, onDragleave: s, onDragover: d, onDrop: l } = Ye();
1115
- function a() {
1116
- bt().then((p) => {
1117
- p !== "cancel" && (g.sql = p);
1118
- });
1119
- }
1120
- const o = { refreshTable: n, getReportFields: e, stateSetting: g, segmented: u, onDragstart: v, onDragenter: _, onDragleave: s, onDragover: d, onDrop: l, showPopup: a, DragItem: Qe, get SEGMENTED() {
1121
- return B;
1122
- }, get getFieldType() {
1123
- return le;
1124
- } };
1125
- return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
1126
- }
1127
- }), ht = { class: "source-wraper__left" }, St = ["data-field"], kt = { class: "tip-icon" }, Et = { class: "source-wraper__right" }, Ct = {
1128
- key: 4,
1129
- class: "filtrate-cell"
1130
- }, It = { class: "source-btn" };
1131
- function wt(c, t, n, e, g, u) {
1132
- const v = y("el-option"), _ = y("el-select"), s = y("el-empty"), d = y("el-scrollbar"), l = y("el-segmented"), a = y("bc-button");
1133
- return r(), h(
1134
- "div",
1135
- {
1136
- class: "source-wraper",
1137
- onDragstart: t[6] || (t[6] = (...o) => e.onDragstart && e.onDragstart(...o)),
1138
- onDragover: t[7] || (t[7] = (...o) => e.onDragover && e.onDragover(...o)),
1139
- onDragenter: t[8] || (t[8] = (...o) => e.onDragenter && e.onDragenter(...o)),
1140
- onDragleave: t[9] || (t[9] = (...o) => e.onDragleave && e.onDragleave(...o)),
1141
- onDrop: t[10] || (t[10] = (...o) => e.onDrop && e.onDrop(...o))
1142
- },
1143
- [
1144
- b(" 数据集展示 "),
1145
- m("div", ht, [
1146
- S(_, {
1147
- modelValue: e.stateSetting.sourceData,
1148
- "onUpdate:modelValue": t[0] || (t[0] = (o) => e.stateSetting.sourceData = o),
1149
- filterable: "",
1150
- placeholder: "请选择数据集",
1151
- size: "default",
1152
- onChange: e.getReportFields
1153
- }, {
1154
- default: T(() => [
1155
- (r(!0), h(
1156
- x,
1157
- null,
1158
- P(e.stateSetting.sourceList, (o) => (r(), k(v, {
1159
- key: o.field_key,
1160
- label: o.field_name,
1161
- value: o.field_key
1162
- }, null, 8, ["label", "value"]))),
1163
- 128
1164
- /* KEYED_FRAGMENT */
1165
- ))
1166
- ]),
1167
- _: 1
1168
- /* STABLE */
1169
- }, 8, ["modelValue", "onChange"]),
1170
- S(d, { class: "flex-1" }, {
1171
- default: T(() => [
1172
- e.stateSetting.sourceFields.length ? b("v-if", !0) : (r(), k(s, { key: 0 })),
1173
- (r(!0), h(
1174
- x,
1175
- null,
1176
- P(e.stateSetting.sourceFields, (o) => (r(), h("div", {
1177
- key: o.field_key,
1178
- "data-field": o.field_key,
1179
- draggable: "true",
1180
- class: "field-item"
1181
- }, [
1182
- m(
1183
- "span",
1184
- kt,
1185
- E(e.getFieldType(o.query_type)),
1186
- 1
1187
- /* TEXT */
1188
- ),
1189
- m(
1190
- "span",
1191
- null,
1192
- E(o.field_name),
1193
- 1
1194
- /* TEXT */
1195
- )
1196
- ], 8, St))),
1197
- 128
1198
- /* KEYED_FRAGMENT */
1199
- ))
1200
- ]),
1201
- _: 1
1202
- /* STABLE */
1203
- })
1204
- ]),
1205
- b(" 展示列配置 "),
1206
- m("div", Et, [
1207
- S(l, {
1208
- modelValue: e.segmented.value,
1209
- "onUpdate:modelValue": t[1] || (t[1] = (o) => e.segmented.value = o),
1210
- options: e.segmented.list,
1211
- size: "default"
1212
- }, null, 8, ["modelValue", "options"]),
1213
- S(d, { class: "source-section" }, {
1214
- default: T(() => [
1215
- e.segmented.value === e.SEGMENTED.COLUMN ? (r(), k(e.DragItem, {
1216
- key: 0,
1217
- tip: "列字段 / 维度",
1218
- title: "field_name",
1219
- field: "field_key",
1220
- type: "columns",
1221
- modelValue: e.stateSetting.columns,
1222
- "onUpdate:modelValue": t[2] || (t[2] = (o) => e.stateSetting.columns = o)
1223
- }, null, 8, ["modelValue"])) : b("v-if", !0),
1224
- e.segmented.value === e.SEGMENTED.COLUMN ? (r(), k(e.DragItem, {
1225
- key: 1,
1226
- tip: "列字段 / 指标",
1227
- title: "field_name",
1228
- field: "field_key",
1229
- type: "indicator",
1230
- modelValue: e.stateSetting.indicator,
1231
- "onUpdate:modelValue": t[3] || (t[3] = (o) => e.stateSetting.indicator = o)
1232
- }, null, 8, ["modelValue"])) : b("v-if", !0),
1233
- b(" 检索配置 "),
1234
- e.segmented.value === e.SEGMENTED.FILTER ? (r(), k(e.DragItem, {
1235
- key: 2,
1236
- tip: "列字段 / 检索",
1237
- title: "field_name",
1238
- field: "field_key",
1239
- type: "querys",
1240
- modelValue: e.stateSetting.querys,
1241
- "onUpdate:modelValue": t[4] || (t[4] = (o) => e.stateSetting.querys = o)
1242
- }, null, 8, ["modelValue"])) : b("v-if", !0),
1243
- b(" 钻取列配置 "),
1244
- e.segmented.value === e.SEGMENTED.FILTER ? (r(), k(e.DragItem, {
1245
- key: 3,
1246
- tip: "列字段 / 钻取",
1247
- title: "field_name",
1248
- field: "field_key",
1249
- type: "drills",
1250
- modelValue: e.stateSetting.drills,
1251
- "onUpdate:modelValue": t[5] || (t[5] = (o) => e.stateSetting.drills = o)
1252
- }, null, 8, ["modelValue"])) : b("v-if", !0),
1253
- b(" 筛选配置 "),
1254
- e.segmented.value === e.SEGMENTED.FILTER ? (r(), h("div", Ct, [
1255
- t[11] || (t[11] = m(
1256
- "p",
1257
- { class: "filtrate-cell__title" },
1258
- "筛选配置",
1259
- -1
1260
- /* CACHED */
1261
- )),
1262
- m("div", { class: "filtrate-cell__content" }, [
1263
- m("div", {
1264
- class: "filtrate-cell__content--item",
1265
- onClick: e.showPopup
1266
- }, "自定义筛选配置")
1267
- ])
1268
- ])) : b("v-if", !0)
1269
- ]),
1270
- _: 1
1271
- /* STABLE */
1272
- }),
1273
- m("div", It, [
1274
- S(a, {
1275
- type: "primary",
1276
- size: "default",
1277
- onClick: e.refreshTable
1278
- }, {
1279
- default: T(() => [...t[12] || (t[12] = [
1280
- C(
1281
- "保存配置",
1282
- -1
1283
- /* CACHED */
1284
- )
1285
- ])]),
1286
- _: 1
1287
- /* STABLE */
1288
- }, 8, ["onClick"])
1289
- ])
1290
- ])
1291
- ],
1292
- 32
1293
- /* NEED_HYDRATION */
1294
- );
1295
- }
1296
- const xt = /* @__PURE__ */ M(Nt, [["render", wt], ["__scopeId", "data-v-7e4fb363"], ["__file", "C:/workspace/华速/xin/数据配置系统-hs-admin-ui/packages/components/src/components/business/bcVisual/components/setting/setting.vue"]]);
1297
- export {
1298
- xt as default
1299
- };