@ecan-bi/indicator-library 1.1.36 → 1.1.37

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,846 @@
1
+ /*! @ecan-bi/indicator-library@1.1.37 */
2
+ import { defineComponent as W, inject as F, unref as u, computed as Q, ref as R, reactive as K, onMounted as ee, resolveComponent as I, openBlock as c, createElementBlock as _, createVNode as A, withCtx as G, createElementVNode as v, createTextVNode as Y, toDisplayString as D, watch as Ae, onUnmounted as we, nextTick as Pe, normalizeClass as X, Fragment as M, renderList as x, createBlock as $, createCommentVNode as O, normalizeStyle as fe, provide as $e } from "vue";
3
+ import { Spin as ye, TreeSelect as Fe, Tooltip as ve, InputSearch as ke, Pagination as Re } from "ant-design-vue";
4
+ import { R as te, I as ne, G as De, U as Ne, D as Be, a as J, _ as Z, m as Le, b as Ie, g as be, c as Se, d as Ce, S as Ve, e as Te } from "./index-ac168659.mjs";
5
+ import ae from "vuedraggable";
6
+ import { debounce as Ge } from "lodash-es";
7
+ import { A as se } from "./AntdIcon-7ebd41b4.mjs";
8
+ import "dayjs";
9
+ import "echarts";
10
+ const Ue = W({
11
+ name: "DataViewList",
12
+ components: {
13
+ ASpin: ye,
14
+ ATreeSelect: Fe,
15
+ Draggable: ae
16
+ },
17
+ setup() {
18
+ var S;
19
+ const e = F(te), a = u(F(ne)), l = F(De), h = F(Ne), m = Q(() => {
20
+ var g;
21
+ return ((g = u(l)) == null ? void 0 : g.dataViewId) || null;
22
+ }), N = R(!1), y = R([]), f = (S = window == null ? void 0 : window.config) == null ? void 0 : S.pageId, b = K({
23
+ title: "已选",
24
+ value: "YXJG",
25
+ id: "YXJG",
26
+ pId: "0",
27
+ disabled: !0,
28
+ selectable: !1,
29
+ isLeaf: !0
30
+ }), p = async () => {
31
+ var T, r;
32
+ const g = m.value;
33
+ N.value = !0;
34
+ try {
35
+ const { data: s } = await e.post(
36
+ `${J}/diagram/sourceList`,
37
+ {
38
+ source: "SQL_VIEW",
39
+ dataViewId: g,
40
+ pageId: f,
41
+ pageFlag: !0
42
+ },
43
+ {
44
+ headers: {
45
+ Authentication: a,
46
+ operateContext: "ygt"
47
+ }
48
+ }
49
+ );
50
+ N.value = !1, s.success && ((T = y.value) == null || T.push(b), y.value = (r = y.value) == null ? void 0 : r.concat(
51
+ E([s.data.rows[0]], "YXJG")
52
+ ));
53
+ } catch {
54
+ N.value = !1;
55
+ }
56
+ }, E = (g = [], T) => {
57
+ const r = [];
58
+ return g.forEach((s) => {
59
+ r.push({
60
+ id: s.id,
61
+ pId: T ?? s.parentId,
62
+ value: s.id,
63
+ title: s.name,
64
+ isLeaf: s.leaf || !1,
65
+ nature: s.nature,
66
+ selectable: s.leaf || !1
67
+ });
68
+ }), r;
69
+ }, w = async (g, T) => {
70
+ var n;
71
+ let r = 0;
72
+ if (g) {
73
+ const { value: o } = g.dataRef;
74
+ r = o;
75
+ }
76
+ const { data: s } = await e.post(
77
+ `${J}/dataview/treetable`,
78
+ {
79
+ pageFlag: !0,
80
+ pageId: f,
81
+ parentId: r
82
+ },
83
+ {
84
+ headers: {
85
+ Authentication: a,
86
+ operateContext: "ygt"
87
+ }
88
+ }
89
+ );
90
+ s.success && (y.value = (n = u(y)) == null ? void 0 : n.concat(
91
+ E(s.data)
92
+ ), T && u(m) && await p());
93
+ }, P = (g) => {
94
+ L(g), h({
95
+ dataViewId: g,
96
+ // 重制数据
97
+ classificationList: [],
98
+ seriesList: [],
99
+ leftAxisList: [],
100
+ rightAxisList: [],
101
+ indicators: [],
102
+ controlList: []
103
+ });
104
+ }, { setDataList: B } = F(Be, {
105
+ // eslint-disable-next-line
106
+ setDataList: (g) => g
107
+ }), t = R(!1), i = R([]), L = async (g) => {
108
+ if (g) {
109
+ i.value = [], t.value = !0;
110
+ try {
111
+ const T = await e.post(
112
+ `${J}/diagram/sourceList`,
113
+ {
114
+ source: "SQL_VIEW",
115
+ dataViewId: g,
116
+ pageId: f,
117
+ pageFlag: !0
118
+ },
119
+ {
120
+ headers: {
121
+ Authentication: a,
122
+ operateContext: "ygt"
123
+ }
124
+ }
125
+ ), { success: r, data: s = {} } = T.data;
126
+ if (t.value = !1, r) {
127
+ const { rows: n = [] } = s;
128
+ n == null || n.forEach((o) => {
129
+ var C;
130
+ const d = ((C = o == null ? void 0 : o.dataViewColumns) == null ? void 0 : C.map((U) => ({
131
+ ...U,
132
+ // 复选框
133
+ show: !0
134
+ }))) || [];
135
+ i.value = [...u(i), ...d];
136
+ }), B(u(i));
137
+ }
138
+ } catch {
139
+ t.value = !1;
140
+ }
141
+ }
142
+ }, k = (g) => ({
143
+ TEXT: "字符",
144
+ NUMBER: "数字",
145
+ DATE: "时间"
146
+ })[g], z = (g, T, r) => {
147
+ const s = r || T[g.oldIndex];
148
+ if (s) {
149
+ const n = {
150
+ ...s,
151
+ label: s.name,
152
+ name: s.label
153
+ };
154
+ sessionStorage.setItem("indicator-list-item", JSON.stringify(n));
155
+ }
156
+ };
157
+ return ee(async () => {
158
+ await w(void 0, !0), L(u(m));
159
+ }), {
160
+ dataViewId: m,
161
+ handleLoadData: w,
162
+ treeSelectData: y,
163
+ treeSelectLoading: N,
164
+ dataViewList: i,
165
+ dataViewLoading: t,
166
+ onDataViewIdChange: P,
167
+ mapGenericType: k,
168
+ onDragStart: z
169
+ };
170
+ }
171
+ });
172
+ const ze = { class: "data-view-list" }, je = { class: "columns" }, qe = { class: "column-item" }, He = { class: "column-item-name" };
173
+ function Je(e, a, l, h, m, N) {
174
+ const y = I("a-tree-select"), f = I("a-spin"), b = I("draggable");
175
+ return c(), _("div", ze, [
176
+ A(f, {
177
+ "wrapper-class-name": "tree-spin",
178
+ spinning: e.treeSelectLoading,
179
+ tip: "视图加载中..."
180
+ }, {
181
+ default: G(() => [
182
+ A(y, {
183
+ value: e.dataViewId,
184
+ style: { width: "100%" },
185
+ placeholder: "请选择视图",
186
+ "dropdown-style": { maxHeight: "400px", overflow: "auto" },
187
+ "tree-data": e.treeSelectData,
188
+ "load-data": e.handleLoadData,
189
+ "tree-data-simple-mode": "",
190
+ onChange: e.onDataViewIdChange
191
+ }, null, 8, ["value", "tree-data", "load-data", "onChange"])
192
+ ]),
193
+ _: 1
194
+ }, 8, ["spinning"]),
195
+ v("div", je, [
196
+ A(f, {
197
+ spinning: e.dataViewLoading,
198
+ tip: "数据加载中..."
199
+ }, {
200
+ default: G(() => [
201
+ A(b, {
202
+ modelValue: e.dataViewList,
203
+ "onUpdate:modelValue": a[0] || (a[0] = (p) => e.dataViewList = p),
204
+ group: {
205
+ name: "cardItem",
206
+ pull: "clone",
207
+ put: !1
208
+ },
209
+ "item-key": "id",
210
+ sort: !1,
211
+ onStart: a[1] || (a[1] = (p) => e.onDragStart(p, e.dataViewList))
212
+ }, {
213
+ item: G(({ element: p }) => [
214
+ v("div", qe, [
215
+ Y(" 【" + D(e.mapGenericType(p.genericType)) + "】 ", 1),
216
+ v("span", He, D(p.name), 1)
217
+ ])
218
+ ]),
219
+ _: 1
220
+ }, 8, ["modelValue"])
221
+ ]),
222
+ _: 1
223
+ }, 8, ["spinning"])
224
+ ])
225
+ ]);
226
+ }
227
+ const Me = /* @__PURE__ */ Z(Ue, [["render", Je], ["__scopeId", "data-v-9047cda3"]]);
228
+ var Qe = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, name: "caret-down", theme: "outlined" };
229
+ const Xe = Qe;
230
+ function he(e) {
231
+ for (var a = 1; a < arguments.length; a++) {
232
+ var l = arguments[a] != null ? Object(arguments[a]) : {}, h = Object.keys(l);
233
+ typeof Object.getOwnPropertySymbols == "function" && (h = h.concat(Object.getOwnPropertySymbols(l).filter(function(m) {
234
+ return Object.getOwnPropertyDescriptor(l, m).enumerable;
235
+ }))), h.forEach(function(m) {
236
+ Ye(e, m, l[m]);
237
+ });
238
+ }
239
+ return e;
240
+ }
241
+ function Ye(e, a, l) {
242
+ return a in e ? Object.defineProperty(e, a, { value: l, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = l, e;
243
+ }
244
+ var oe = function(a, l) {
245
+ var h = he({}, a, l.attrs);
246
+ return A(se, he({}, h, {
247
+ icon: Xe
248
+ }), null);
249
+ };
250
+ oe.displayName = "CaretDownOutlined";
251
+ oe.inheritAttrs = !1;
252
+ const Ee = oe;
253
+ var We = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z" } }] }, name: "caret-right", theme: "outlined" };
254
+ const Ze = We;
255
+ function me(e) {
256
+ for (var a = 1; a < arguments.length; a++) {
257
+ var l = arguments[a] != null ? Object(arguments[a]) : {}, h = Object.keys(l);
258
+ typeof Object.getOwnPropertySymbols == "function" && (h = h.concat(Object.getOwnPropertySymbols(l).filter(function(m) {
259
+ return Object.getOwnPropertyDescriptor(l, m).enumerable;
260
+ }))), h.forEach(function(m) {
261
+ xe(e, m, l[m]);
262
+ });
263
+ }
264
+ return e;
265
+ }
266
+ function xe(e, a, l) {
267
+ return a in e ? Object.defineProperty(e, a, { value: l, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = l, e;
268
+ }
269
+ var ie = function(a, l) {
270
+ var h = me({}, a, l.attrs);
271
+ return A(se, me({}, h, {
272
+ icon: Ze
273
+ }), null);
274
+ };
275
+ ie.displayName = "CaretRightOutlined";
276
+ ie.inheritAttrs = !1;
277
+ const Oe = ie;
278
+ var Ke = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, name: "loading", theme: "outlined" };
279
+ const et = Ke;
280
+ function _e(e) {
281
+ for (var a = 1; a < arguments.length; a++) {
282
+ var l = arguments[a] != null ? Object(arguments[a]) : {}, h = Object.keys(l);
283
+ typeof Object.getOwnPropertySymbols == "function" && (h = h.concat(Object.getOwnPropertySymbols(l).filter(function(m) {
284
+ return Object.getOwnPropertyDescriptor(l, m).enumerable;
285
+ }))), h.forEach(function(m) {
286
+ tt(e, m, l[m]);
287
+ });
288
+ }
289
+ return e;
290
+ }
291
+ function tt(e, a, l) {
292
+ return a in e ? Object.defineProperty(e, a, { value: l, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = l, e;
293
+ }
294
+ var re = function(a, l) {
295
+ var h = _e({}, a, l.attrs);
296
+ return A(se, _e({}, h, {
297
+ icon: et
298
+ }), null);
299
+ };
300
+ re.displayName = "LoadingOutlined";
301
+ re.inheritAttrs = !1;
302
+ const nt = re, at = W({
303
+ name: "IndSourceList",
304
+ components: {
305
+ CaretRightOutlined: Oe,
306
+ CaretDownOutlined: Ee,
307
+ LoadingOutlined: nt,
308
+ Draggable: ae,
309
+ ATooltip: ve
310
+ },
311
+ props: {
312
+ data: {
313
+ type: Array,
314
+ default: () => []
315
+ },
316
+ source: {
317
+ type: String,
318
+ default: ""
319
+ },
320
+ isSub: {
321
+ type: Boolean,
322
+ default: !1
323
+ },
324
+ hasChildren: {
325
+ type: Boolean,
326
+ default: !1
327
+ },
328
+ total: {
329
+ type: Number,
330
+ default: 0
331
+ },
332
+ graphicConfig: {
333
+ type: Object,
334
+ default: () => ({})
335
+ }
336
+ },
337
+ setup(e, { emit: a, expose: l }) {
338
+ var s;
339
+ const h = (s = window == null ? void 0 : window.config) == null ? void 0 : s.pageId, m = F(te), N = u(F(ne)), y = F("setItemDisabled", (n) => !1), f = R([]), b = R(), p = K({
340
+ pageSize: 20,
341
+ currentPage: 1,
342
+ totalResult: 0
343
+ }), E = R(!1), w = R(""), P = R(!1);
344
+ Ae(() => e.data, (n) => {
345
+ e.isSub && (n == null || n.forEach((o) => {
346
+ var d;
347
+ o != null && o.isLeaf || (d = o.dataViewColumns) == null || d.forEach((C) => {
348
+ var U;
349
+ C.show === void 0 && (C.show = !0), C.edit = !1, C.title && (C.label = C.title), (U = C == null ? void 0 : C.extPropertyList) != null && U.length && C.extPropertyList.forEach((q) => {
350
+ q.show = !0, q.edit = !1;
351
+ });
352
+ });
353
+ }), f.value = n);
354
+ }, {
355
+ deep: !0,
356
+ immediate: !0
357
+ });
358
+ const B = () => {
359
+ var n;
360
+ e.isSub || (n = u(b)) == null || n.removeEventListener("scroll", S);
361
+ }, t = async (n) => {
362
+ var C;
363
+ if (u(E))
364
+ return;
365
+ const o = e.graphicConfig ? e.graphicConfig.dataSourceId : "";
366
+ E.value = !0;
367
+ const d = {
368
+ source: e.source,
369
+ pageId: h,
370
+ dataSourceId: o,
371
+ indexName: w.value
372
+ };
373
+ n ? (n.loading = !0, d.indexTypeGuid = n.indexTypeGuid, d.isLeaf = n.isLeaf) : p && (d.queryRequest = {
374
+ pageSize: p.pageSize,
375
+ pageNum: p.currentPage
376
+ });
377
+ try {
378
+ const U = await m.post(
379
+ `${J}/diagram/sourceList`,
380
+ d,
381
+ {
382
+ headers: {
383
+ Authentication: N,
384
+ operateContext: "ygt"
385
+ }
386
+ }
387
+ ), { success: q, data: H = {} } = U.data;
388
+ if (q) {
389
+ const { rows: j = [], total: le = 0 } = H;
390
+ j == null || j.forEach((ce) => {
391
+ var ue;
392
+ (n == null ? void 0 : n.isLeaf) === "1" || e.graphicConfig.dataSourceId ? (ue = ce.dataViewColumns) == null || ue.forEach((V) => {
393
+ var de, pe;
394
+ V.show = !((de = V == null ? void 0 : V.extPropertyList) != null && de.length), V.edit = !1, V.title && (V.label = V.title), (pe = V == null ? void 0 : V.extPropertyList) != null && pe.length && V.extPropertyList.forEach((ge) => {
395
+ ge.show = !0, ge.edit = !1;
396
+ });
397
+ }) : ce.show = !1;
398
+ }), n ? (n.children = j, n.show = !0, j != null && j.length || (n.noData = !0)) : (f.value = u(f).concat(j), p.totalResult = +le, ((C = u(f)) == null ? void 0 : C.length) >= le && B());
399
+ }
400
+ n && (n.loading = !1), E.value = !1;
401
+ } catch {
402
+ n && (n.loading = !1), E.value = !1;
403
+ }
404
+ }, i = async (n) => {
405
+ const o = f.value[n], { children: d = [] } = o;
406
+ d != null && d.length ? o.show = !o.show : !o.noData && o.isLeaf ? t(o) : o.noData && (o.show = !o.show);
407
+ }, L = (n, o, d) => {
408
+ a("onDragStart", n, o, d);
409
+ }, k = (n, o, d) => {
410
+ a("onDragStart", n, o, d.extPropertyList[n.oldIndex]);
411
+ }, z = (n) => {
412
+ n.show = !n.show;
413
+ }, S = (n) => {
414
+ n.target.scrollTop + n.target.clientHeight + 20 >= n.target.scrollHeight && (p.currentPage++, t());
415
+ }, g = async () => {
416
+ await t(), Pe(async () => {
417
+ u(b).scrollHeight === u(b).clientHeight && p.totalResult > u(f).length && (p.currentPage++, g());
418
+ });
419
+ }, T = async (n) => {
420
+ var o;
421
+ B(), P.value = !0, p.currentPage = 1, p.totalResult = 0, f.value = [], w.value = n, await g(), P.value = !1, (o = u(b)) == null || o.addEventListener("scroll", S);
422
+ }, r = (n) => n.find((o) => {
423
+ var d;
424
+ return (d = o == null ? void 0 : o.extPropertyList) == null ? void 0 : d.length;
425
+ });
426
+ return ee(async () => {
427
+ var n;
428
+ e.isSub || (g(), (n = u(b)) == null || n.addEventListener("scroll", S));
429
+ }), we(() => {
430
+ B();
431
+ }), l({
432
+ handleSearch: T
433
+ }), {
434
+ columnRef: b,
435
+ sourceList: f,
436
+ searchLoading: P,
437
+ onToggleGroup: i,
438
+ onToggleSource: z,
439
+ setItemDisabled: y,
440
+ onDragStart: L,
441
+ onDragExtStart: k,
442
+ mapDataSetScope: Le,
443
+ mapScope: Ie,
444
+ getLoadType: be,
445
+ getUseType: Se,
446
+ getSourceType: Ce,
447
+ hasExtProp: r
448
+ };
449
+ }
450
+ });
451
+ const st = {
452
+ key: 0,
453
+ class: "no-data"
454
+ }, ot = { class: "column-item" }, it = ["onClick"], rt = {
455
+ key: 3,
456
+ class: "item-name"
457
+ }, lt = { key: 0 }, ct = { class: "column-item" }, ut = { key: 0 }, dt = { key: 1 }, pt = { key: 2 }, gt = { key: 3 }, ft = ["onClick"], ht = ["onClick"], mt = { class: "field" }, _t = { class: "column-child-item-name" }, yt = { class: "column-child-item" }, vt = { class: "field" }, Dt = { class: "column-child-item-name" };
458
+ function Lt(e, a, l, h, m, N) {
459
+ const y = I("loading-outlined"), f = I("caret-down-outlined"), b = I("caret-right-outlined"), p = I("ind-source-list", !0), E = I("a-tooltip"), w = I("draggable"), P = I("a-spin");
460
+ return c(), _("div", {
461
+ class: X(["columns", e.isSub ? "sub-columns" : ""]),
462
+ ref: "columnRef"
463
+ }, [
464
+ A(P, {
465
+ spinning: e.searchLoading,
466
+ tip: "数据源加载中..."
467
+ }, {
468
+ default: G(() => {
469
+ var B;
470
+ return [
471
+ !((B = e.sourceList) != null && B.length) && !e.searchLoading ? (c(), _("div", st, "暂无数据")) : e.hasChildren ? (c(!0), _(M, { key: 1 }, x(e.sourceList, (t, i) => (c(), _("div", {
472
+ key: t.indexTypeGuid || t.id
473
+ }, [
474
+ v("div", ot, [
475
+ v("span", {
476
+ style: { cursor: "pointer" },
477
+ onClick: (L) => e.onToggleGroup(i)
478
+ }, [
479
+ t.loading ? (c(), $(y, { key: 0 })) : t.show ? (c(), $(f, { key: 1 })) : (c(), $(b, { key: 2 })),
480
+ t.isLeaf ? (c(), _("span", rt, D(t.indexTypeCode + "." + t.indexTypeName), 1)) : O("", !0)
481
+ ], 8, it)
482
+ ]),
483
+ t.show ? (c(), _("div", lt, [
484
+ A(p, {
485
+ data: t.children,
486
+ isSub: !0,
487
+ hasChildren: t.isLeaf === "0",
488
+ graphicConfig: e.graphicConfig,
489
+ source: "INDICATOR_LIB",
490
+ onOnDragStart: e.onDragStart
491
+ }, null, 8, ["data", "hasChildren", "graphicConfig", "onOnDragStart"])
492
+ ])) : O("", !0)
493
+ ]))), 128)) : (c(!0), _(M, { key: 2 }, x(e.sourceList, (t) => (c(), _("div", {
494
+ key: t.id,
495
+ class: X(e.setItemDisabled(t.dataViewColumns) ? "column-disabled" : "")
496
+ }, [
497
+ v("div", ct, [
498
+ A(E, { overlayClassName: "ind-source-list-tooltip" }, {
499
+ title: G(() => [
500
+ v("div", null, "加载类型:" + D(e.getLoadType(t.loadType)), 1),
501
+ t.useType ? (c(), _("div", ut, "数据使用系统:" + D(e.getUseType(t.useType)), 1)) : O("", !0),
502
+ t.systemSource ? (c(), _("div", dt, "制度出处:" + D(t.systemSource), 1)) : O("", !0),
503
+ t.dataTo ? (c(), _("div", pt, "数据来源:" + D(e.getSourceType(t.dataTo)), 1)) : O("", !0),
504
+ t.meaning ? (c(), _("div", gt, "指标含义:" + D(t.meaning), 1)) : O("", !0)
505
+ ]),
506
+ default: G(() => [
507
+ v("span", {
508
+ style: { cursor: "pointer" },
509
+ onClick: (i) => e.onToggleSource(t)
510
+ }, [
511
+ t.show ? (c(), $(f, { key: 0 })) : (c(), $(b, { key: 1 })),
512
+ Y(" " + D((t.indexCode ? t.indexCode : "") + " " + t.name), 1)
513
+ ], 8, ft)
514
+ ]),
515
+ _: 2
516
+ }, 1024)
517
+ ]),
518
+ t.show ? (c(), $(w, {
519
+ key: 0,
520
+ style: fe({ marginLeft: e.hasExtProp(t.dataViewColumns) ? "15px" : "" }),
521
+ modelValue: t.dataViewColumns,
522
+ "onUpdate:modelValue": (i) => t.dataViewColumns = i,
523
+ group: {
524
+ name: "cardItem",
525
+ pull: "clone",
526
+ put: !1
527
+ },
528
+ "item-key": "id",
529
+ sort: !1,
530
+ disabled: e.setItemDisabled(t.dataViewColumns),
531
+ filter: ".no-drag",
532
+ preventOnFilter: !1,
533
+ onStart: (i) => e.onDragStart(i, t)
534
+ }, {
535
+ item: G(({ element: i }) => {
536
+ var L, k, z;
537
+ return [
538
+ v("div", {
539
+ class: X({ "no-drag": !!((L = i == null ? void 0 : i.extPropertyList) != null && L.length) })
540
+ }, [
541
+ v("div", {
542
+ class: "column-child-item",
543
+ onClick: (S) => {
544
+ var g;
545
+ return (g = i == null ? void 0 : i.extPropertyList) != null && g.length ? e.onToggleSource(i) : "";
546
+ }
547
+ }, [
548
+ e.hasExtProp(t.dataViewColumns) ? (c(), _("div", {
549
+ key: 0,
550
+ style: fe({ visibility: (k = i == null ? void 0 : i.extPropertyList) != null && k.length ? "visible" : "hidden" })
551
+ }, [
552
+ i.show ? (c(), $(f, { key: 0 })) : (c(), $(b, { key: 1 }))
553
+ ], 4)) : O("", !0),
554
+ v("span", mt, " 【" + D(i.scope === "FIELD" ? e.mapDataSetScope(i.genericType) : e.mapScope(i.scope)) + "】 ", 1),
555
+ v("span", _t, D(i.label), 1)
556
+ ], 8, ht),
557
+ (z = i == null ? void 0 : i.extPropertyList) != null && z.length && i.show ? (c(), $(w, {
558
+ key: 0,
559
+ style: { "margin-left": "35px" },
560
+ modelValue: i.extPropertyList,
561
+ "onUpdate:modelValue": (S) => i.extPropertyList = S,
562
+ group: {
563
+ name: "cardItem",
564
+ pull: "clone",
565
+ put: !1
566
+ },
567
+ "item-key": "typeGuid",
568
+ sort: !1,
569
+ onStart: (S) => e.onDragExtStart(S, t, i)
570
+ }, {
571
+ item: G(({ element: S }) => [
572
+ v("div", yt, [
573
+ v("span", vt, " 【" + D(S.scope === "FIELD" ? e.mapDataSetScope(S.genericType) : e.mapScope(S.scope)) + "】 ", 1),
574
+ v("span", Dt, D(S.label), 1)
575
+ ])
576
+ ]),
577
+ _: 2
578
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onStart"])) : O("", !0)
579
+ ], 2)
580
+ ];
581
+ }),
582
+ _: 2
583
+ }, 1032, ["style", "modelValue", "onUpdate:modelValue", "disabled", "filter", "onStart"])) : O("", !0)
584
+ ], 2))), 128))
585
+ ];
586
+ }),
587
+ _: 1
588
+ }, 8, ["spinning"])
589
+ ], 2);
590
+ }
591
+ const It = /* @__PURE__ */ Z(at, [["render", Lt], ["__scopeId", "data-v-ca01e6a9"]]), bt = W({
592
+ name: "DataSourceList",
593
+ components: {
594
+ CaretRightOutlined: Oe,
595
+ CaretDownOutlined: Ee,
596
+ IndSourceList: It,
597
+ AInputSearch: ke,
598
+ ASpin: ye,
599
+ APagination: Re,
600
+ Draggable: ae,
601
+ ATooltip: ve
602
+ },
603
+ setup() {
604
+ var T;
605
+ const e = (T = window == null ? void 0 : window.config) == null ? void 0 : T.pageId, a = F(te), l = u(F(ne)), h = F(Ve), m = Q(
606
+ () => {
607
+ var r;
608
+ return (r = u(h)) == null ? void 0 : r.graphicConfig;
609
+ }
610
+ ), N = Q(() => {
611
+ var r;
612
+ return (r = u(m)) == null ? void 0 : r.dataSourceId;
613
+ }), y = R([]), f = R(!1), b = R(), p = K({
614
+ pageSize: 20,
615
+ currentPage: 1,
616
+ totalResult: 0
617
+ }), E = F(Te), w = R(""), P = async () => {
618
+ if (u(k).source === "INDICATOR_LIB")
619
+ return;
620
+ f.value = !0;
621
+ const r = {
622
+ source: u(E),
623
+ indexName: u(w),
624
+ pageId: e,
625
+ dataSourceId: u(N),
626
+ queryRequest: {
627
+ pageSize: p.pageSize,
628
+ pageNum: p.currentPage
629
+ }
630
+ };
631
+ r.source === "EDV_DATA_SET" && (r.edvDataSetName = r.indexName, delete r.indexName);
632
+ try {
633
+ const s = await a.post(
634
+ `${J}/diagram/sourceList`,
635
+ r,
636
+ {
637
+ headers: {
638
+ Authentication: l,
639
+ operateContext: "ygt"
640
+ }
641
+ }
642
+ );
643
+ f.value = !1;
644
+ const { success: n, data: o = {} } = s.data;
645
+ if (n) {
646
+ const { rows: d = [], total: C = 0 } = o;
647
+ d == null || d.forEach((U) => {
648
+ var q;
649
+ U.show = !1, (q = U.dataViewColumns) == null || q.forEach((H) => {
650
+ H.show = !0, H.edit = !1, H.title && (H.label = H.title);
651
+ });
652
+ }), y.value = d, p.totalResult = +C;
653
+ }
654
+ } catch {
655
+ f.value = !1;
656
+ }
657
+ }, B = (r) => {
658
+ y.value[r].show = !y.value[r].show;
659
+ }, t = () => {
660
+ var r;
661
+ p.currentPage = 1, P(), u(k).source === "INDICATOR_LIB" && ((r = u(b)) == null || r.handleSearch(u(w)));
662
+ }, i = Ge(() => {
663
+ p.currentPage = 1, P();
664
+ }, 200), L = (r, s) => {
665
+ p.pageSize = s, p.currentPage = r, P();
666
+ };
667
+ ee(() => {
668
+ P();
669
+ });
670
+ const k = F(De), z = Q(() => {
671
+ const r = ["classificationList", "rowHeaderList", "dimensionList", "queryColumnList"];
672
+ let s = [];
673
+ for (const n in u(k))
674
+ if (Object.prototype.hasOwnProperty.call(u(k), n) && r.includes(n)) {
675
+ const o = u(k)[n];
676
+ Array.isArray(o) && (s = s.concat(o));
677
+ }
678
+ return s;
679
+ }), S = (r = []) => {
680
+ let s = !1;
681
+ if (u(E) === "EDV_DATA_SET") {
682
+ for (const n of u(z))
683
+ if (!r.find((d) => d.parentId === n.parentId)) {
684
+ s = !0;
685
+ break;
686
+ }
687
+ } else
688
+ for (const n of u(z))
689
+ if (!r.find((d) => n.isExtProperty || d.typeGuid === n.typeGuid)) {
690
+ s = !0;
691
+ break;
692
+ }
693
+ return s;
694
+ };
695
+ return $e("setItemDisabled", S), {
696
+ dataSourceList: y,
697
+ dataSourceLoading: f,
698
+ pagination: p,
699
+ onToggleGroup: B,
700
+ mapScope: Ie,
701
+ mapDataSetScope: Le,
702
+ onSearch: t,
703
+ onChange: i,
704
+ source: E,
705
+ onPaginationChange: L,
706
+ searchText: w,
707
+ setItemDisabled: S,
708
+ onDragStart: (r, s, n) => {
709
+ const o = n || s.dataViewColumns[r.oldIndex];
710
+ let d = {};
711
+ s.dataSetParams && (d = s.dataSetParams), o && (sessionStorage.setItem("indicator-list-item", JSON.stringify({
712
+ ...o,
713
+ dataTo: s.dataTo,
714
+ dataSetParams: d,
715
+ meaning: s.meaning,
716
+ theFormula: s.theFormula,
717
+ theUnit: s.theUnit
718
+ })), s.dataTo === "1" && (s != null && s.hrpIndexVariates) && sessionStorage.setItem("indicator-variates", JSON.stringify(s.hrpIndexVariates)), s.dataTo === "2" && (s != null && s.dataSetParams) && sessionStorage.setItem("indicator-variates", JSON.stringify(s.dataSetParams)));
719
+ },
720
+ getSourceType: Ce,
721
+ getLoadType: be,
722
+ getUseType: Se,
723
+ graphicConfig: k,
724
+ indSourceRef: b
725
+ };
726
+ }
727
+ });
728
+ const St = { class: "data-source-list" }, Ct = { class: "columns" }, Tt = { class: "column-item" }, Et = { key: 0 }, Ot = { key: 1 }, At = { key: 2 }, wt = ["onClick"], Pt = { key: 0 }, $t = { class: "column-child-item" }, Ft = { class: "column-child-item-name" };
729
+ function kt(e, a, l, h, m, N) {
730
+ const y = I("a-input-search"), f = I("ind-source-list"), b = I("caret-down-outlined"), p = I("caret-right-outlined"), E = I("a-tooltip"), w = I("draggable"), P = I("a-spin"), B = I("a-pagination");
731
+ return c(), _("div", St, [
732
+ A(y, {
733
+ value: e.searchText,
734
+ "onUpdate:value": a[0] || (a[0] = (t) => e.searchText = t),
735
+ placeholder: "请输入关键字",
736
+ style: { width: "100%" },
737
+ onChange: e.onChange,
738
+ onSearch: e.onSearch
739
+ }, null, 8, ["value", "onChange", "onSearch"]),
740
+ e.graphicConfig.source === "INDICATOR_LIB" ? (c(), $(f, {
741
+ key: 0,
742
+ ref: "indSourceRef",
743
+ data: e.dataSourceList,
744
+ hasChildren: !0,
745
+ isSub: !1,
746
+ graphicConfig: e.graphicConfig,
747
+ source: "INDICATOR_LIB",
748
+ onSetItemDisabled: e.setItemDisabled,
749
+ onOnDragStart: e.onDragStart
750
+ }, null, 8, ["data", "graphicConfig", "onSetItemDisabled", "onOnDragStart"])) : (c(), _(M, { key: 1 }, [
751
+ v("div", Ct, [
752
+ A(P, {
753
+ spinning: e.dataSourceLoading,
754
+ tip: "数据源加载中..."
755
+ }, {
756
+ default: G(() => [
757
+ (c(!0), _(M, null, x(e.dataSourceList, (t, i) => (c(), _("div", {
758
+ key: t.id,
759
+ class: X(e.setItemDisabled(t.dataViewColumns) ? "column-disabled" : "")
760
+ }, [
761
+ v("div", Tt, [
762
+ A(E, null, {
763
+ title: G(() => [
764
+ v("div", null, "加载类型:" + D(e.getLoadType(t.loadType)), 1),
765
+ t.useType ? (c(), _("div", Et, "数据使用系统:" + D(e.getUseType(t.useType)), 1)) : O("", !0),
766
+ t.systemSource ? (c(), _("div", Ot, "制度出处:" + D(t.systemSource), 1)) : O("", !0),
767
+ t.meaning ? (c(), _("div", At, "指标含义:" + D(t.meaning), 1)) : O("", !0)
768
+ ]),
769
+ default: G(() => [
770
+ v("span", {
771
+ style: { cursor: "pointer" },
772
+ onClick: (L) => e.onToggleGroup(i)
773
+ }, [
774
+ t.show ? (c(), $(b, { key: 0 })) : (c(), $(p, { key: 1 })),
775
+ Y(" " + D((t.indexCode ? t.indexCode : "") + " " + t.name) + "【" + D(e.getSourceType(t.dataTo)) + "】 ", 1)
776
+ ], 8, wt)
777
+ ]),
778
+ _: 2
779
+ }, 1024)
780
+ ]),
781
+ t.show ? (c(), _("div", Pt, [
782
+ A(w, {
783
+ modelValue: t.dataViewColumns,
784
+ "onUpdate:modelValue": (L) => t.dataViewColumns = L,
785
+ group: {
786
+ name: "cardItem",
787
+ pull: "clone",
788
+ put: !1
789
+ },
790
+ "item-key": "id",
791
+ sort: !1,
792
+ disabled: e.setItemDisabled(t.dataViewColumns),
793
+ onStart: (L) => e.onDragStart(L, t)
794
+ }, {
795
+ item: G(({ element: L }) => [
796
+ v("div", $t, [
797
+ Y(" 【" + D(L.scope === "FIELD" ? e.mapDataSetScope(L.genericType) : e.mapScope(L.scope)) + "】 ", 1),
798
+ v("span", Ft, D(L.label), 1)
799
+ ])
800
+ ]),
801
+ _: 2
802
+ }, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onStart"])
803
+ ])) : O("", !0)
804
+ ], 2))), 128))
805
+ ]),
806
+ _: 1
807
+ }, 8, ["spinning"])
808
+ ]),
809
+ A(B, {
810
+ size: "small",
811
+ "show-quick-jumper": "",
812
+ pageSize: e.pagination.pageSize,
813
+ "onUpdate:pageSize": a[1] || (a[1] = (t) => e.pagination.pageSize = t),
814
+ total: e.pagination.totalResult,
815
+ "show-total": (t) => `共 ${t} 条`,
816
+ current: e.pagination.currentPage,
817
+ "onUpdate:current": a[2] || (a[2] = (t) => e.pagination.currentPage = t),
818
+ onChange: e.onPaginationChange
819
+ }, null, 8, ["pageSize", "total", "show-total", "current", "onChange"])
820
+ ], 64))
821
+ ]);
822
+ }
823
+ const Rt = /* @__PURE__ */ Z(bt, [["render", kt], ["__scopeId", "data-v-4eec5bb9"]]), Nt = W({
824
+ name: "DataList",
825
+ components: {
826
+ DataSourceList: Rt,
827
+ DataViewList: Me
828
+ },
829
+ setup() {
830
+ return {
831
+ source: F(Te)
832
+ };
833
+ }
834
+ });
835
+ function Bt(e, a, l, h, m, N) {
836
+ const y = I("data-view-list"), f = I("data-source-list");
837
+ return c(), _(M, null, [
838
+ e.source === "SQL_VIEW" ? (c(), $(y, { key: 0 })) : O("", !0),
839
+ e.source === "INDICATOR_LIB" || e.source === "EDV_DATA_SET" ? (c(), $(f, { key: 1 })) : O("", !0)
840
+ ], 64);
841
+ }
842
+ const Mt = /* @__PURE__ */ Z(Nt, [["render", Bt]]);
843
+ export {
844
+ Mt as default
845
+ };
846
+ //# sourceMappingURL=index-2f89205a.mjs.map