g-ui-web 1.1.25 → 1.1.26

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.
package/lib/g-ui-web.js CHANGED
@@ -48722,7 +48722,7 @@ class K3 {
48722
48722
  R0(this, "events");
48723
48723
  if (this.events = {}, !t)
48724
48724
  throw console.error("dataUrl is undefined or null"), new Error("Invalid dataUrl");
48725
- if (typeof t == "string" || typeof t == "number" || typeof t == "object" && t !== null && !t.path)
48725
+ if (!(t != null && t.path) && !["string", "number"].includes(typeof t) && !Array.isArray(t) || Array.isArray(t) && !t.some((r) => r.path))
48726
48726
  this.loadStaticData(t);
48727
48727
  else if (Array.isArray(t)) {
48728
48728
  if (!t.some((r) => r && r.path))
@@ -95500,87 +95500,130 @@ const Clt = (e, t) => {
95500
95500
  let i = z(0);
95501
95501
  const s = z(!1), l = z(), u = z(null), c = z({});
95502
95502
  let d = null, f = z(!1);
95503
- const p = async (v) => {
95504
- if (ya(v)) {
95503
+ const p = async (g) => {
95504
+ if (ya(g)) {
95505
95505
  s.value = !0;
95506
95506
  return;
95507
95507
  } else
95508
95508
  s.value = !1;
95509
- const g = Zd(o.dbOptions.xAxisField);
95510
- f.value = !1;
95511
- let m = z([]), _ = zp(o.options), b = [], w = [], C = {
95509
+ const m = Zd(o.dbOptions.xAxisField), { newDbO: _, newData: b } = h(o.dbOptions, g);
95510
+ console.log(_, b), g = b, f.value = !1;
95511
+ let w = z([]), C = zp(o.options), x = [], S = [], E = {
95512
95512
  xAxis: [],
95513
95513
  series: []
95514
95514
  };
95515
- if (d = v, m.value = v, f.value = !0, m.value && o.dbOptions) {
95516
- m.value.map((S) => {
95517
- w.push(
95518
- g == "function" ? o.dbOptions.xAxisField(S) : S[o.dbOptions.xAxisField]
95515
+ if (d = g, w.value = g, f.value = !0, w.value && _) {
95516
+ w.value.map((A) => {
95517
+ S.push(
95518
+ m == "function" ? _.xAxisField(A) : A[_.xAxisField]
95519
95519
  );
95520
95520
  });
95521
- let x = [];
95522
- if (o.dbOptions.yAxis && o.dbOptions.yAxis.yAxisFields ? x = o.dbOptions.columns.map((S) => {
95523
- const E = o.dbOptions.yAxis.yAxisFields.find((T) => T.field === S.field);
95524
- return E ? { ...S, ...E } : S;
95521
+ let T = [];
95522
+ if (_.yAxis && _.yAxis.yAxisFields ? T = _.columns.map((A) => {
95523
+ const M = _.yAxis.yAxisFields.find((k) => k.field === A.field);
95524
+ return M ? { ...A, ...M } : A;
95525
95525
  }).concat(
95526
- o.dbOptions.yAxis.yAxisFields.filter(
95527
- (S) => !o.dbOptions.columns.some((E) => E.field === S.field)
95526
+ _.yAxis.yAxisFields.filter(
95527
+ (A) => !_.columns.some((M) => M.field === A.field)
95528
95528
  )
95529
- ) : x = o.dbOptions.columns, x.map((S) => {
95530
- let E = {
95529
+ ) : T = _.columns, T.map((A) => {
95530
+ let M = {
95531
95531
  name: "",
95532
- type: S.type || "line",
95533
- yAxisIndex: S.yAxisIndex,
95534
- stack: S.stack,
95532
+ type: A.type || "line",
95533
+ yAxisIndex: A.yAxisIndex,
95534
+ stack: A.stack,
95535
95535
  data: [],
95536
- lineStyle: S.lineStyle,
95537
- areaStyle: S.areaStyle
95536
+ lineStyle: A.lineStyle,
95537
+ areaStyle: A.areaStyle
95538
95538
  };
95539
- m.value.map((T) => {
95540
- E.name = T[S.title] || S.title, E.data.push(T[S.field]);
95541
- }), b.push(E);
95542
- }), _) {
95543
- if (_.xAxis ? _.xAxis[0].data = w : _.xAxis = [{ data: w }], _.series ? _.series = An({}, _.series, b) : _.series = b, o.dbOptions && o.dbOptions.yAxis && o.dbOptions.yAxis.yAxises) {
95544
- let S = [];
95545
- o.dbOptions.yAxis.yAxises.map((E) => {
95546
- let T = {
95547
- name: E.name,
95539
+ w.value.map((k) => {
95540
+ M.name = k[A.title] || A.title, M.data.push(k[A.field]);
95541
+ }), x.push(M);
95542
+ }), C) {
95543
+ if (C.xAxis ? C.xAxis[0].data = S : C.xAxis = [{ data: S }], C.series ? C.series = An({}, C.series, x) : C.series = x, _ && _.yAxis && _.yAxis.yAxises) {
95544
+ let A = [];
95545
+ _.yAxis.yAxises.map((M) => {
95546
+ let k = {
95547
+ name: M.name,
95548
95548
  type: "value",
95549
- position: E.position,
95550
- alignTicks: E.alignTicks,
95551
- offset: E.offset
95549
+ position: M.position,
95550
+ alignTicks: M.alignTicks,
95551
+ offset: M.offset
95552
95552
  };
95553
- S.push(T);
95554
- }), _.yAxis = An({}, _.yAxis, S);
95553
+ A.push(k);
95554
+ }), C.yAxis = An({}, C.yAxis, A);
95555
95555
  }
95556
95556
  } else
95557
- C.xAxis = [{ data: w }], C.series = b;
95558
- }
95559
- _ ? l.value = UB(_, o.dbOptions.columns) : l.value = UB(C, o.dbOptions.columns);
95557
+ E.xAxis = [{ data: S }], E.series = x;
95558
+ }
95559
+ C ? l.value = UB(C, _.columns) : l.value = UB(E, _.columns);
95560
+ }, h = (g, m) => {
95561
+ if (g.groupField) {
95562
+ const _ = g.groupField, b = g.xAxisField, w = g.columns && g.columns[0].field, C = m, x = [...new Set(C.map((A) => A[_]))], S = [];
95563
+ x.forEach((A, M) => {
95564
+ C.filter((O) => O[_] === A).forEach((O) => {
95565
+ const V = S.find((L) => L[b] === O[b]);
95566
+ if (V)
95567
+ V[`${_}${M + 1}`] = A, V[`${w}${M + 1}`] = O.contractAmount;
95568
+ else {
95569
+ const L = {
95570
+ [b]: O[b],
95571
+ [`${_}${M + 1}`]: A,
95572
+ [`${w}${M + 1}`]: O.contractAmount
95573
+ };
95574
+ for (let P = 0; P < x.length; P++)
95575
+ P !== M && (L[`${_}${P + 1}`] = "", L[`${w}${P + 1}`] = 0);
95576
+ S.push(L);
95577
+ }
95578
+ });
95579
+ });
95580
+ const E = [];
95581
+ return x.forEach((A, M) => {
95582
+ g.columns.forEach((k, O) => {
95583
+ E.push({
95584
+ // ...column,
95585
+ title: A,
95586
+ field: `${k.field}${M + 1}`
95587
+ });
95588
+ });
95589
+ }), {
95590
+ newDbO: {
95591
+ xAxisField: g.xAxisField,
95592
+ groupField: g.groupField,
95593
+ columns: E,
95594
+ data: S
95595
+ },
95596
+ newData: S
95597
+ };
95598
+ } else
95599
+ return {
95600
+ newDbO: g,
95601
+ newData: m
95602
+ };
95560
95603
  };
95561
95604
  ke(
95562
95605
  () => o.dbOptions.data,
95563
- (v) => {
95564
- c.value = Kt(v);
95565
- const g = ["http://", "https://", void 0];
95566
- v ? (typeof v == "object" && !v.path && !v.dsKey && !c.value.dataUrl && !(typeof v == "string" && g.some((m) => v.includes(m))) && c.value.loadStaticData(v), (typeof v == "string" || typeof v == "object") && (v.path || v.data && typeof v.data == "string") && c.value.reload(v.data || v)) : console.warn("props.dbOptions.data is undefined");
95606
+ (g) => {
95607
+ c.value = Kt(g);
95608
+ const m = ["http://", "https://", void 0];
95609
+ g ? (typeof g == "object" && !g.path && !g.dsKey && !c.value.dataUrl && !(typeof g == "string" && m.some((_) => g.includes(_))) && c.value.loadStaticData(g), (typeof g == "string" || typeof g == "object") && (g.path || g.data && typeof g.data == "string") && c.value.reload(g.data || g)) : console.warn("props.dbOptions.data is undefined");
95567
95610
  },
95568
95611
  {
95569
95612
  deep: !0
95570
95613
  }
95571
95614
  ), ke(
95572
95615
  () => n["gui-theme"],
95573
- async (v) => {
95616
+ async (g) => {
95574
95617
  c.value = null, xe(async () => {
95575
- i++, c.value = Kt(o.dbOptions.data), p(c.value.data), c.value.on("load", (g) => {
95576
- p(g);
95618
+ i++, c.value = Kt(o.dbOptions.data), p(c.value.data), c.value.on("load", (m) => {
95619
+ p(m);
95577
95620
  });
95578
95621
  });
95579
95622
  },
95580
95623
  { deep: !0 }
95581
95624
  ), xe(async () => {
95582
- c.value = Kt(o.dbOptions.data), c.value.on("load", (v) => {
95583
- p(v);
95625
+ c.value = Kt(o.dbOptions.data), c.value.on("load", (g) => {
95626
+ p(g);
95584
95627
  });
95585
95628
  }), t({
95586
95629
  props: o,
@@ -95592,24 +95635,24 @@ const Clt = (e, t) => {
95592
95635
  return f.value;
95593
95636
  }
95594
95637
  });
95595
- const h = (v) => {
95596
- a("chart-click", v);
95638
+ const v = (g) => {
95639
+ a("chart-click", g);
95597
95640
  };
95598
- return (v, g) => {
95599
- const m = vt("g-chart");
95641
+ return (g, m) => {
95642
+ const _ = vt("g-chart");
95600
95643
  return D(), $("div", Blt, [
95601
- (D(), Se(m, Pt({ options: l.value }, v.$attrs, {
95644
+ (D(), Se(_, Pt({ options: l.value }, g.$attrs, {
95602
95645
  ref_key: "lineRef",
95603
95646
  ref: u,
95604
95647
  isEmpty: s.value,
95605
95648
  description: e.description,
95606
- onClick: h,
95649
+ onClick: v,
95607
95650
  key: y(i)
95608
95651
  }), null, 16, ["options", "isEmpty", "description"]))
95609
95652
  ]);
95610
95653
  };
95611
95654
  }
95612
- }), Wlt = /* @__PURE__ */ Qn(Hlt, [["__scopeId", "data-v-1cd424a9"]]), Glt = rr(Wlt), wm = Tr(), Gf = document.documentElement, Ult = (e) => e || "-", Klt = (e) => e || "", Ylt = (e, t) => {
95655
+ }), Wlt = /* @__PURE__ */ Qn(Hlt, [["__scopeId", "data-v-7bf18ebb"]]), Glt = rr(Wlt), wm = Tr(), Gf = document.documentElement, Ult = (e) => e || "-", Klt = (e) => e || "", Ylt = (e, t) => {
95613
95656
  let r = [];
95614
95657
  for (let n = 0; n <= e; n++)
95615
95658
  r.push({
Binary file