@ecan-bi/indicator-library 1.1.36 → 1.1.38

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