super-page-runtime 2.3.7 → 2.3.9-sit1

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.
Files changed (57) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +50 -50
  2. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +102 -102
  3. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +26 -24
  4. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +59 -58
  5. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +38 -37
  6. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +28 -27
  7. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
  8. package/dist/es/components/runtime/utils/charts/chart-util.js +29 -22
  9. package/dist/es/components/runtime/utils/common-util.d.ts +4 -0
  10. package/dist/es/components/runtime/utils/common-util.js +4 -0
  11. package/dist/es/components/runtime/utils/events/event-util.js +3 -3
  12. package/dist/es/components/runtime/utils/events/print-label.js +25 -26
  13. package/dist/es/components/runtime/utils/events/standard-event.js +18 -18
  14. package/dist/es/components/runtime/utils/events/validator-util.d.ts +1 -1
  15. package/dist/es/components/runtime/utils/events/validator-util.js +122 -104
  16. package/dist/es/components/runtime/utils/page-init-util.js +24 -25
  17. package/dist/es/components/runtime/utils/page-store.js +10 -10
  18. package/dist/es/components/runtime/utils/table-utils.js +1 -1
  19. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +4 -1
  20. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +4 -4
  21. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +6 -10
  22. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +6 -8
  23. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +4 -1
  24. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +15 -15
  25. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +4 -1
  26. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +7 -7
  27. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +4 -1
  28. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +8 -8
  29. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +4 -1
  30. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +7 -7
  31. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +11 -12
  32. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +9 -11
  33. package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +0 -2
  34. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +10 -12
  35. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +19 -17
  36. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +26 -20
  37. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +10 -4
  38. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +31 -28
  39. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +32 -25
  40. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +52 -49
  41. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +33 -30
  42. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +38 -35
  43. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +18 -15
  44. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +57 -55
  45. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +3 -5
  46. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +0 -1
  47. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +46 -43
  48. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +55 -53
  49. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +63 -61
  50. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +25 -22
  51. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +16 -13
  52. package/dist/es/components/runtime/views/home-chart.vue.js +7 -7
  53. package/dist/es/components/runtime/views/super-page-dialog.vue.js +0 -1
  54. package/dist/es/components/runtime/views/super-page.vue2.js +11 -12
  55. package/dist/es/style.css +30 -0
  56. package/package.json +2 -2
  57. package/dist/es.zip +0 -0
@@ -1,39 +1,39 @@
1
1
  import { getOptionDatasSourceMap as e, getComponentOptionDatasFromPage as t, getVariableValue as n, setVariableValue as i, setValueForVariableName as o } from "../page-helper-util.js";
2
- import { getComponentRef as a, getComponentRefByCode as r } from "../global-refs.js";
3
- import s from "../eventBus.js";
2
+ import { getComponentRef as a, getComponentRefByCode as s } from "../global-refs.js";
3
+ import r from "../eventBus.js";
4
4
  import l from "agilebuilder-ui/src/utils/request";
5
5
  import { getFormData as c, getAdditionalParamMap as u, refreshPage as f } from "../events/standard-event.js";
6
- import { dynamicControlTableEdit as m, disabledAllFields as d, updateFormItemEditState as p } from "../events/validator-util.js";
7
- import { deepCopy as g, getBaseUrl as b } from "../common-util.js";
8
- import { replacePrefix as y, isMobileBrowser as h } from "agilebuilder-ui/src/utils/common-util";
6
+ import { dynamicControlTableEdit as m, disabledAllFields as p, updateFormItemEditState as d } from "../events/validator-util.js";
7
+ import { deepCopy as g, getBaseUrl as y } from "../common-util.js";
8
+ import { replacePrefix as b, isMobileBrowser as h } from "agilebuilder-ui/src/utils/common-util";
9
9
  import { getFormModelFields as E, getModelFields as P } from "../page-init-util.js";
10
10
  import { getCustomFunc as C } from "../events/event-util.js";
11
- import { isHasFieldPermissionAuth as $ } from "../table-utils.js";
12
- const k = { showElement: function(e2, t2, n2) {
11
+ import { isHasFieldPermissionAuth as k } from "../table-utils.js";
12
+ const v = { showElement: function(e2, t2, n2) {
13
13
  n2 ? A(e2, "showElement", t2) : t2.forEach((t3) => {
14
- const n3 = r(e2, t3);
15
- n3 ? n3.show() : console.error(`未找到code为${t3}的组件`);
14
+ const n3 = s(e2, t3);
15
+ n3 && n3.show();
16
16
  });
17
17
  }, hideElement: function(e2, t2, n2) {
18
18
  n2 ? A(e2, "hideElement", t2) : t2.forEach((t3) => {
19
- const n3 = r(e2, t3);
20
- n3 ? n3.hide() : console.error(`未找到code为${t3}的组件`);
19
+ const n3 = s(e2, t3);
20
+ n3 && n3.hide();
21
21
  });
22
22
  }, enableElement: function(e2, t2, n2) {
23
23
  n2 ? A(e2, "enableElement", t2) : t2.forEach((t3) => {
24
- const n3 = r(e2, t3);
24
+ const n3 = s(e2, t3);
25
25
  if (n3) {
26
26
  const e3 = n3.getConfigure();
27
27
  e3 && e3.runtime.props && (e3.runtime.props.state = "enabled");
28
- } else console.error(`未找到code为${t3}的组件`);
28
+ }
29
29
  });
30
30
  }, disableElement: function(e2, t2, n2) {
31
31
  n2 ? A(e2, "disableElement", t2) : t2.forEach((t3) => {
32
- const n3 = r(e2, t3);
32
+ const n3 = s(e2, t3);
33
33
  if (n3) {
34
34
  const e3 = n3.getConfigure();
35
35
  e3 && e3.runtime.props && (e3.runtime.props.state = "disabled");
36
- } else console.error(`未找到code为${t3}的组件`);
36
+ }
37
37
  });
38
38
  }, setEntityDataValue: function(e2, t2) {
39
39
  Object.keys(t2).forEach((n2) => {
@@ -48,55 +48,55 @@ const k = { showElement: function(e2, t2, n2) {
48
48
  o(e2.entity, i2.startsWith("${") ? i2 : "${" + t2 + "." + i2 + "}", n2[i2]);
49
49
  });
50
50
  }, dynamicControlFormEdit: function(e2, t2, n2) {
51
- n2 ? A(e2, "dynamicControlFormEdit", t2) : p(e2, t2);
51
+ n2 ? A(e2, "dynamicControlFormEdit", t2) : d(e2, t2);
52
52
  }, disabledAllFields(e2) {
53
- d(e2);
53
+ p(e2);
54
54
  }, dynamicControlTableEdit(e2, t2, n2) {
55
55
  m(e2, t2, n2);
56
56
  }, executeServiceFlow: function(e2, t2, n2) {
57
57
  const i2 = e2.code;
58
58
  n2 || (n2 = { entity: e2.entity.data, serviceVariables: {}, requestParams: u(e2), taskParamMap: e2.entity.task, dynamicDimensionValue: [], dynamicSortValue: "" }), n2.entity || (n2.entity = e2.entity.data), n2.requestParams || (n2.requestParams = u(e2)), n2.taskParamMap || (n2.taskParamMap = e2.entity.task);
59
- const o2 = e2.backendUrl, a2 = b(o2, e2.isTest);
59
+ const o2 = e2.backendUrl, a2 = y(o2, e2.isTest);
60
60
  return l.post(`${a2}/dsc/service-flow/execute/${i2}/${t2}`, n2);
61
61
  }, openPage: function(e2, t2) {
62
- s.$emit(e2.code + "_open-dialog", { pageContext: e2, eventParams: t2.eventParams, configureObj: { props: { linkPage: t2 } } });
62
+ r.$emit(e2.code + "_open-dialog", { pageContext: e2, eventParams: t2.eventParams, configureObj: { props: { linkPage: t2 } } });
63
63
  }, refreshPage: function(e2, t2) {
64
64
  f(e2, t2);
65
65
  }, refreshSubTableHandle: function(e2, t2) {
66
66
  let n2;
67
- const i2 = r(e2, t2);
67
+ const i2 = s(e2, t2);
68
68
  if (i2) {
69
69
  const e3 = i2.getConfigure();
70
70
  e3 && e3.uuid && e3.name && "table" === e3.name && (n2 = e3.uuid);
71
71
  }
72
- n2 ? s.$emit("_refreshSubTableHandle_" + n2) : console.error("tableUUid is undefined");
72
+ n2 && r.$emit("_refreshSubTableHandle_" + n2);
73
73
  }, refreshChildData(e2, t2, n2) {
74
74
  let i2;
75
- const o2 = r(e2, t2);
75
+ const o2 = s(e2, t2);
76
76
  if (o2) {
77
77
  const e3 = o2.getConfigure();
78
78
  e3 && e3.uuid && e3.name && "table" === e3.name && (i2 = e3.uuid);
79
79
  }
80
- i2 ? s.$emit("_refreshChildData_" + i2, n2) : console.error("tableUUid is undefined");
81
- }, getServerConfigValue: (e2) => window.$vueApp.config.globalProperties[e2], getBackendUrl: (e2) => b(e2.backendUrl, false), getPlateBackendUrl: () => window.$vueApp.config.globalProperties.baseAPI, getEntity: (e2) => e2.entity.data, getEntityValue: (e2, t2) => e2.entity.data ? e2.entity.data[t2] : null, getPageData: (e2) => e2.entity.page, getPageDataValue: (e2, t2) => e2.entity.page ? e2.entity.page[t2] : null, getAdditionalParams: (e2) => u(e2), getAdditionalParamValue(e2, t2) {
80
+ i2 && r.$emit("_refreshChildData_" + i2, n2);
81
+ }, getServerConfigValue: (e2) => window.$vueApp.config.globalProperties[e2], getBackendUrl: (e2) => y(e2.backendUrl, false), getPlateBackendUrl: () => window.$vueApp.config.globalProperties.baseAPI, getEntity: (e2) => e2.entity.data, getEntityValue: (e2, t2) => e2.entity.data ? e2.entity.data[t2] : null, getPageData: (e2) => e2.entity.page, getPageDataValue: (e2, t2) => e2.entity.page ? e2.entity.page[t2] : null, getAdditionalParams: (e2) => u(e2), getAdditionalParamValue(e2, t2) {
82
82
  const n2 = u(e2);
83
83
  return n2 ? n2[t2] : null;
84
- }, isMobile: () => h(), getComponentRefByProp: (e2, t2) => r(e2, t2), getComponentRefByCode: (e2, t2) => a(e2, t2), getFormViewData(o2) {
84
+ }, isMobile: () => h(), getComponentRefByProp: (e2, t2) => s(e2, t2), getComponentRefByCode: (e2, t2) => a(e2, t2), getFormViewData(o2) {
85
85
  var _a, _b, _c, _d, _e, _f, _g, _h;
86
- const r2 = o2.entity ? o2.entity : {}, s2 = g(r2), l2 = e(o2);
86
+ const s2 = o2.entity ? o2.entity : {}, r2 = g(s2), l2 = e(o2);
87
87
  for (const e2 in l2) {
88
- const r3 = t(o2, e2), l3 = a(o2, e2);
88
+ const s3 = t(o2, e2), l3 = a(o2, e2);
89
89
  if (l3) {
90
90
  const e3 = l3.getConfigure();
91
91
  if (e3 && ((_b = (_a = e3.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && ("static" === ((_d = (_c = e3.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) || "optionGroup" === ((_f = (_e = e3.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType))) if (e3.name && ("select" === e3.name && ((_h = (_g = e3.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || "checkbox" === e3.name)) {
92
- const t2 = E(o2, e3), a2 = n(s2, t2);
92
+ const t2 = E(o2, e3), a2 = n(r2, t2);
93
93
  if (a2) {
94
- const e4 = j(a2.split(","), r3);
95
- i(s2, t2, e4);
94
+ const e4 = V(a2.split(","), s3);
95
+ i(r2, t2, e4);
96
96
  }
97
97
  } else {
98
- const t2 = E(o2, e3), a2 = j(n(s2, t2), r3);
99
- i(s2, t2, a2);
98
+ const t2 = E(o2, e3), a2 = V(n(r2, t2), s3);
99
+ i(r2, t2, a2);
100
100
  }
101
101
  }
102
102
  }
@@ -106,41 +106,41 @@ const k = { showElement: function(e2, t2, n2) {
106
106
  if (e2.indexOf("__") > 0 && (t2 = e2.substring(e2.lastIndexOf("__") + 2)), t2) {
107
107
  const i2 = a(o2, t2);
108
108
  if (i2) {
109
- const t3 = i2.getConfigure(), o3 = t3.code ? t3.code : e2, a2 = P(t3, o3), r3 = n(s2, a2);
110
- v(i2.getTableSelectOptions(e2), r3);
109
+ const t3 = i2.getConfigure(), o3 = t3.code ? t3.code : e2, a2 = P(t3, o3), s3 = n(r2, a2);
110
+ j(i2.getTableSelectOptions(e2), s3);
111
111
  }
112
112
  }
113
113
  }
114
- return s2.data;
115
- }, getFormData: (e2, t2) => c(e2, t2), getCustomFunc: (e2, t2) => C(e2, t2), replaceUrlPrefix: (e2) => y(e2), isHasFieldAuthPermission: (e2) => {
114
+ return r2.data;
115
+ }, getFormData: (e2, t2) => c(e2, t2), getCustomFunc: (e2, t2) => C(e2, t2), replaceUrlPrefix: (e2) => b(e2), isHasFieldAuthPermission: (e2) => {
116
116
  var _a, _b, _c, _d;
117
117
  return !(void 0 !== ((_b = (_a = e2 == null ? void 0 : e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isHasFieldAuthPermission) && !((_d = (_c = e2 == null ? void 0 : e2.props) == null ? void 0 : _c.base) == null ? void 0 : _d.isHasFieldAuthPermission));
118
118
  }, isHasFieldAuth(e2, t2) {
119
- $(e2, null, t2);
119
+ k(e2, null, t2);
120
120
  }, isHasFieldAuthWithTable(e2, t2, n2) {
121
- $(e2, t2, n2);
121
+ k(e2, t2, n2);
122
122
  } };
123
- function v(e2, t2) {
123
+ function j(e2, t2) {
124
124
  e2 && t2 && t2.forEach((t3) => {
125
125
  Object.keys(e2).forEach((n2) => {
126
- const i2 = t3[n2], o2 = e2[n2], a2 = o2.options, r2 = o2.column;
127
- let s2;
128
- if (r2 && r2.componentType && ("multiselect" === r2.componentType || "checkbox" === r2.componentType)) {
126
+ const i2 = t3[n2], o2 = e2[n2], a2 = o2.options, s2 = o2.column;
127
+ let r2;
128
+ if (s2 && s2.componentType && ("multiselect" === s2.componentType || "checkbox" === s2.componentType)) {
129
129
  if (i2) {
130
- s2 = j(i2.split(","), a2);
130
+ r2 = V(i2.split(","), a2);
131
131
  }
132
- } else s2 = j(i2, a2);
133
- t3[n2] = s2;
132
+ } else r2 = V(i2, a2);
133
+ t3[n2] = r2;
134
134
  });
135
135
  });
136
136
  }
137
- function j(e2, t2) {
137
+ function V(e2, t2) {
138
138
  let n2;
139
139
  return null != e2 && t2 && (Array.isArray(e2) ? (n2 = "", e2.forEach((i2) => {
140
- n2 = n2 + V(e2, t2) + ",";
141
- }), n2.indexOf(",") > 0 && (n2 = n2.substring(0, n2.lastIndexOf(",")))) : (n2 = e2, n2 = V(e2, t2))), n2;
140
+ n2 = n2 + $(e2, t2) + ",";
141
+ }), n2.indexOf(",") > 0 && (n2 = n2.substring(0, n2.lastIndexOf(",")))) : (n2 = e2, n2 = $(e2, t2))), n2;
142
142
  }
143
- function V(e2, t2) {
143
+ function $(e2, t2) {
144
144
  let n2 = e2;
145
145
  if (null != e2 && t2) for (let i2 = 0; i2 < t2.length; i2++) {
146
146
  const o2 = t2[i2].value, a2 = t2[i2].label ? t2[i2].label : t2[i2].name;
@@ -155,5 +155,5 @@ function A(e2, t2, n2) {
155
155
  e2.initInfo || (e2.initInfo = {}), e2.initInfo[t2] = n2;
156
156
  }
157
157
  export {
158
- k as functions
158
+ v as functions
159
159
  };
@@ -1,140 +1,140 @@
1
- import { getValueFromSource as e, formatVariableValue as t, setValueForVariableName as i } from "../page-helper-util.js";
1
+ import { getValueFromSource as e, formatVariableValue as i, setValueForVariableName as t } from "../page-helper-util.js";
2
2
  import { deepCopy as s } from "../common-util.js";
3
- import { CommonName as o, caculateFormulaValue as a, sortDatas as l, limitDatas as n, executeChartFormula as r } from "./chart-util.js";
4
- import { handleChartEvent as u } from "../events/event-util.js";
5
- function c(c2, d, f, p) {
6
- if (!p || !p.result) return;
7
- u(c2, d, "beforeUpdateChart", f, { resultData: p });
8
- const m = p && p.result ? p.result : {};
9
- let h = p && p.groupValue ? p.groupValue : void 0;
10
- const y = d.serviceDataField;
11
- let g = null;
12
- y ? g = m[y] : m && (g = Array.isArray(m) ? m : [m]), g || (g = []), d.runtime.dataConfig.runtimeData = g;
13
- let v = d.props ? d.props.groups : null;
14
- if (v || (v = []), !h || 0 === h.length) {
15
- h = [];
16
- for (const e2 of v) h.push(e2.group);
3
+ import { setDefaultGrid as o, CommonName as a, caculateFormulaValue as l, sortDatas as n, limitDatas as r, executeChartFormula as u } from "./chart-util.js";
4
+ import { handleChartEvent as c } from "../events/event-util.js";
5
+ function d(d2, f, p, m) {
6
+ if (!m || !m.result) return;
7
+ o(p), c(d2, f, "beforeUpdateChart", p, { resultData: m });
8
+ const h = m && m.result ? m.result : {};
9
+ let y = m && m.groupValue ? m.groupValue : void 0;
10
+ const g = f.serviceDataField;
11
+ let v = null;
12
+ g ? v = h[g] : h && (v = Array.isArray(h) ? h : [h]), v || (v = []), f.runtime.dataConfig.runtimeData = v;
13
+ let F = f.props ? f.props.groups : null;
14
+ if (F || (F = []), !y || 0 === y.length) {
15
+ y = [];
16
+ for (const e2 of F) y.push(e2.group);
17
17
  }
18
- const F = {}, S = [], D = [];
19
- for (const e2 of v) F[e2.group] = e2.target, e2.target && !S.includes(e2.target) && (S.push(e2.target), h.includes(e2.group) && D.push(e2.target));
20
- let x = d.props ? d.props.mulGroupShow : "";
21
- x = "break" == x ? "\r\n" : " ";
22
- for (const t2 of g) {
23
- if (!t2) continue;
24
- const i2 = [];
25
- for (const s3 of h) {
26
- const o2 = F[s3], a2 = e(t2, o2, void 0);
27
- a2 && i2.push(a2);
18
+ const S = {}, D = [], x = [];
19
+ for (const e2 of F) S[e2.group] = e2.target, e2.target && !D.includes(e2.target) && (D.push(e2.target), y.includes(e2.group) && x.push(e2.target));
20
+ let N = f.props ? f.props.mulGroupShow : "";
21
+ N = "break" == N ? "\r\n" : " ";
22
+ for (const i2 of v) {
23
+ if (!i2) continue;
24
+ const t2 = [];
25
+ for (const s3 of y) {
26
+ const o2 = S[s3], a2 = e(i2, o2, void 0);
27
+ a2 && t2.push(a2);
28
28
  }
29
- const s2 = i2.join(x);
30
- t2[o.X_FIELD_NAME] = s2;
29
+ const s2 = t2.join(N);
30
+ i2[a.X_FIELD_NAME] = s2;
31
31
  }
32
- const N = d.items ? d.items : [], E = [], A = {}, _ = [], b = {}, w = [], C = [], I = /* @__PURE__ */ new Set(), X = a(N, g, I);
33
- for (const e2 of I) w.push(e2);
34
- for (const e2 of N) {
35
- const t2 = e2.props ? e2.props : {}, i2 = t2.yaxisSource, s2 = t2.yaxisField, o2 = t2.isCumulative;
32
+ const E = f.items ? f.items : [], A = [], _ = {}, b = [], w = {}, C = [], I = [], X = /* @__PURE__ */ new Set(), L = l(E, v, X);
33
+ for (const e2 of X) C.push(e2);
34
+ for (const e2 of E) {
35
+ const i2 = e2.props ? e2.props : {}, t2 = i2.yaxisSource, s2 = i2.yaxisField, o2 = i2.isCumulative;
36
36
  let a2 = null;
37
- if (!s2 || i2 && "variable" != i2) if ("formula" == i2) {
38
- let i3 = t2.formula ? t2.formula : "";
39
- for (const e3 in X) i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), X[e3]);
40
- a2 = { uuid: e2.uuid, type: "formula", formula: i3, data: [], dynamicDatas: [] };
41
- } else a2 = { uuid: e2.uuid, type: "fixed", field: t2.yaxisFix, data: [], dynamicDatas: [] };
42
- else a2 = { uuid: e2.uuid, type: "variable", field: s2, isCumulative: o2, data: [], dynamicDatas: [] }, s2 && !w.includes(s2) && (w.push(s2), C.push(s2)), o2 && !I.has(s2) && I.add(s2);
43
- null != a2 && (E.push(a2), A[e2.uuid] = a2), t2.dynamicSeriesField && !_.includes(t2.dynamicSeriesField) && a2 && (a2.dynamicField = t2.dynamicSeriesField, a2.dynamicSeriesTitle = t2.dynamicSeriesTitle, a2.dynamicShowStack = t2.dynamicShowStack, _.push(t2.dynamicSeriesField), b[t2.dynamicSeriesField] = s2);
37
+ if (!s2 || t2 && "variable" != t2) if ("formula" == t2) {
38
+ let t3 = i2.formula ? i2.formula : "";
39
+ for (const e3 in L) t3 = t3.replace(new RegExp(e3.replace("$", "\\$"), "g"), L[e3]);
40
+ a2 = { uuid: e2.uuid, type: "formula", formula: t3, data: [], dynamicDatas: [] };
41
+ } else a2 = { uuid: e2.uuid, type: "fixed", field: i2.yaxisFix, data: [], dynamicDatas: [] };
42
+ else a2 = { uuid: e2.uuid, type: "variable", field: s2, isCumulative: o2, data: [], dynamicDatas: [] }, s2 && !C.includes(s2) && C.push(s2), s2 && !I.includes(s2) && I.push(s2), o2 && !X.has(s2) && X.add(s2);
43
+ null != a2 && (A.push(a2), _[e2.uuid] = a2), i2.dynamicSeriesField && !b.includes(i2.dynamicSeriesField) && a2 && (a2.dynamicField = i2.dynamicSeriesField, a2.dynamicSeriesTitle = i2.dynamicSeriesTitle, a2.dynamicShowStack = i2.dynamicShowStack, b.push(i2.dynamicSeriesField), w[i2.dynamicSeriesField] = s2);
44
44
  }
45
- const L = {};
46
- if (_.length > 0) {
47
- const t2 = [], i2 = {};
48
- for (const s2 of g) if (s2) for (const a2 of w) {
49
- const l2 = s2[o.X_FIELD_NAME];
50
- let n2 = i2[l2];
45
+ const M = {};
46
+ if (b.length > 0) {
47
+ const i2 = [], t2 = {};
48
+ for (const s2 of v) if (s2) for (const o2 of C) {
49
+ const l2 = s2[a.X_FIELD_NAME];
50
+ let n2 = t2[l2];
51
51
  if (!n2) {
52
52
  n2 = {};
53
- for (const e2 of S) n2[e2] = s2[e2];
54
- n2[o.X_FIELD_NAME] = s2[o.X_FIELD_NAME], i2[l2] = n2, t2.push(n2);
53
+ for (const e2 of D) n2[e2] = s2[e2];
54
+ n2[a.X_FIELD_NAME] = s2[a.X_FIELD_NAME], t2[l2] = n2, i2.push(n2);
55
55
  }
56
- let r2 = e(s2, a2, void 0);
56
+ let r2 = e(s2, o2, void 0);
57
57
  if (!isNaN(r2)) {
58
- const e2 = n2[a2];
59
- isNaN || (r2 += e2), n2[a2] = r2;
58
+ const e2 = n2[o2];
59
+ isNaN || (r2 += e2), n2[o2] = r2;
60
60
  }
61
61
  }
62
- for (const t3 of _) {
62
+ for (const i3 of b) {
63
63
  const s2 = [];
64
- for (const a2 of g) {
65
- if (!a2) continue;
66
- const l2 = i2[a2[o.X_FIELD_NAME]];
64
+ for (const o2 of v) {
65
+ if (!o2) continue;
66
+ const l2 = t2[o2[a.X_FIELD_NAME]];
67
67
  if (!l2) continue;
68
- let n2 = e(a2, t3, void 0);
69
- n2 = null == n2 || null == n2 ? "" : n2, s2.includes(n2) || (s2.push(n2), C.push(n2), I.add(n2));
70
- const r2 = b[t3];
68
+ let n2 = e(o2, i3, void 0);
69
+ n2 = null == n2 || null == n2 ? "" : n2, s2.includes(n2) || (s2.push(n2), I.push(n2), X.add(n2));
70
+ const r2 = w[i3];
71
71
  if (void 0 !== r2) {
72
- const t4 = e(a2, r2, void 0);
73
- let i3 = l2[n2];
74
- void 0 === i3 ? i3 = t4 : isNaN(t4) || (i3 += t4), l2[n2] = i3;
72
+ const i4 = e(o2, r2, void 0);
73
+ let t3 = l2[n2];
74
+ void 0 === t3 ? t3 = i4 : isNaN(i4) || (t3 += i4), l2[n2] = t3;
75
75
  }
76
76
  }
77
- L[t3] = s2;
77
+ M[i3] = s2;
78
78
  }
79
- g = t2;
79
+ v = i2;
80
80
  }
81
- l(c2, d, g), g = n(c2, d, g, S, C);
82
- const M = [], j = {};
83
- for (const t2 of g) if (t2) {
84
- for (const i2 of I) {
85
- const s2 = e(t2, i2, void 0);
86
- let o2 = j[i2];
87
- void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), j[i2] = o2;
81
+ n(d2, f, v), v = r(d2, f, v, D, I);
82
+ const j = [], k = {};
83
+ for (const i2 of v) if (i2) {
84
+ for (const t2 of X) {
85
+ const s2 = e(i2, t2, void 0);
86
+ let o2 = k[t2];
87
+ void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), k[t2] = o2;
88
88
  }
89
- M.push(t2[o.X_FIELD_NAME]);
90
- for (const i2 of E) {
91
- let s2 = i2.data;
92
- const o2 = i2.dynamicDatas;
93
- if (i2.dynamicField) {
94
- let a2 = L[i2.dynamicField];
89
+ j.push(i2[a.X_FIELD_NAME]);
90
+ for (const t2 of A) {
91
+ let s2 = t2.data;
92
+ const o2 = t2.dynamicDatas;
93
+ if (t2.dynamicField) {
94
+ let a2 = M[t2.dynamicField];
95
95
  a2 = a2 || [];
96
96
  for (let l2 = 0; l2 < a2.length; l2++) {
97
97
  l2 >= o2.length && o2.push([]), s2 = o2[l2];
98
98
  const n2 = a2[l2];
99
- let r2 = e(t2, n2, void 0);
100
- i2.isCumulative && (r2 = j[n2]), s2.push(r2);
99
+ let r2 = e(i2, n2, void 0);
100
+ t2.isCumulative && (r2 = k[n2]), s2.push(r2);
101
101
  }
102
- } else if ("fixed" === i2.type) s2.push(i2.field);
103
- else if ("variable" === i2.type) {
104
- let o3 = e(t2, i2.field, void 0);
105
- i2.isCumulative && (o3 = j[i2.field]), s2.push(o3);
106
- } else if ("formula" === i2.type) {
107
- const e2 = r(i2.formula, j, t2, c2);
102
+ } else if ("fixed" === t2.type) s2.push(t2.field);
103
+ else if ("variable" === t2.type) {
104
+ let o3 = e(i2, t2.field, void 0);
105
+ t2.isCumulative && (o3 = k[t2.field]), s2.push(o3);
106
+ } else if ("formula" === t2.type) {
107
+ const e2 = u(t2.formula, k, i2, d2);
108
108
  s2.push(e2);
109
109
  } else s2.push(void 0);
110
110
  }
111
111
  }
112
- const k = d.defaultSeries, T = s(null == k ? [] : k), V = [];
113
- for (const e2 of T) {
114
- const i2 = A[e2.uuid];
115
- if (i2.dynamicField) {
116
- let o2 = L[i2.dynamicField];
112
+ const T = f.defaultSeries, V = s(null == T ? [] : T), $ = [];
113
+ for (const e2 of V) {
114
+ const t2 = _[e2.uuid];
115
+ if (t2.dynamicField) {
116
+ let o2 = M[t2.dynamicField];
117
117
  o2 = o2 || [];
118
- const a2 = i2.dynamicDatas ? i2.dynamicDatas : [];
118
+ const a2 = t2.dynamicDatas ? t2.dynamicDatas : [];
119
119
  for (let l2 = 0; l2 < o2.length; l2++) {
120
120
  const n2 = o2[l2], r2 = s(e2);
121
- if (i2.dynamicSeriesTitle) {
122
- const e3 = i2.dynamicSeriesTitle.replace("${name}", n2);
123
- r2.name = t(c2, e3);
121
+ if (t2.dynamicSeriesTitle) {
122
+ const e3 = t2.dynamicSeriesTitle.replace("${name}", n2);
123
+ r2.name = i(d2, e3);
124
124
  } else r2.name = n2;
125
- r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type && i2.dynamicShowStack && (r2.stack = e2.uuid), V.push(r2);
125
+ r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type && t2.dynamicShowStack && (r2.stack = e2.uuid), $.push(r2);
126
126
  }
127
- } else e2.data = i2 ? i2.data : [], V.push(e2);
127
+ } else e2.data = t2 ? t2.data : [], $.push(e2);
128
128
  }
129
- f.series = V;
130
- const $ = d.defaultXaxis, G = d.defaultYaxis;
131
- if (f.isBar) {
132
- if (G) for (const e2 of G) e2.data = M;
133
- f.xAxis = $, f.yAxis = G;
134
- } else $ && $.length > 0 && ($[0].data = M), f.xAxis = $, f.yAxis = G;
135
- const R = d.props ? d.props.selGroupVariable : null;
136
- !(d.props ? d.props.enableDrill : null) && R && (d.highlightInfos = [], i(c2.entity, R, null)), u(c2, d, "afterUpdateChart", f, { resultData: p }), d.groupFields = D, d.cacheDatas = g, d.rawResult = p;
129
+ p.series = $;
130
+ const G = f.defaultXaxis, R = f.defaultYaxis;
131
+ if (p.isBar) {
132
+ if (R) for (const e2 of R) e2.data = j;
133
+ p.xAxis = G, p.yAxis = R;
134
+ } else G && G.length > 0 && (G[0].data = j), p.xAxis = G, p.yAxis = R;
135
+ const U = f.props ? f.props.selGroupVariable : null;
136
+ !(f.props ? f.props.enableDrill : null) && U && (f.highlightInfos = [], t(d2.entity, U, null)), c(d2, f, "afterUpdateChart", p, { resultData: m }), f.groupFields = x, f.cacheDatas = v, f.rawResult = m;
137
137
  }
138
138
  export {
139
- c as updateChartOption
139
+ d as updateChartOption
140
140
  };
@@ -1,35 +1,37 @@
1
1
  import { formatVariableValue as e, getValueFromSource as o } from "../page-helper-util.js";
2
2
  import { deepCopy as t } from "../common-util.js";
3
- function s(s2, l, r, i) {
4
- if (!i || !i.result) return;
5
- const p = i && i.result ? i.result : {}, n = l.serviceDataField;
6
- let a = null;
7
- n ? a = p[n] : p && (a = [p]), a || (a = []);
8
- const u = l.props ? l.props.nameSource : void 0, c = l.props ? l.props.nameField : void 0, d = l.props ? l.props.nameFixed : void 0, m = l.props ? l.props.yaxisField : void 0, f = [c], h = [], v = [];
9
- for (let t2 of a) {
3
+ import { setDefaultGrid as s } from "./chart-util.js";
4
+ function r(r2, l, i, p) {
5
+ if (!p || !p.result) return;
6
+ s(i);
7
+ const n = p && p.result ? p.result : {}, a = l.serviceDataField;
8
+ let u = null;
9
+ a ? u = n[a] : n && (u = [n]), u || (u = []);
10
+ const c = l.props ? l.props.nameSource : void 0, m = l.props ? l.props.nameField : void 0, d = l.props ? l.props.nameFixed : void 0, f = l.props ? l.props.yaxisField : void 0, h = [m], v = [], g = [];
11
+ for (const t2 of u) {
10
12
  if (!t2) continue;
11
- let l2 = null;
12
- l2 = "fixed" == u ? e(s2, d) : o(t2, c, void 0), h.push(l2);
13
- const r2 = o(t2, m, void 0);
14
- v.push(r2);
13
+ let s2 = null;
14
+ s2 = "fixed" == c ? e(r2, d) : o(t2, m, void 0), v.push(s2);
15
+ const l2 = o(t2, f, void 0);
16
+ g.push(l2);
15
17
  }
16
- const g = l.defaultSeries;
17
- let F = g[0].pieColors;
18
- F = F || [];
19
- let x = g[0].pieColorMap;
20
- x = x || {};
18
+ const F = l.defaultSeries;
19
+ let x = F[0].pieColors;
20
+ x = x || [];
21
+ let j = F[0].pieColorMap;
22
+ j = j || {};
21
23
  const S = [];
22
- for (let e2 = 0; e2 < h.length && e2 < v.length; e2++) {
23
- const o2 = { value: v[e2], name: h[e2] };
24
- if (e2 < F.length || x[o2.name]) {
25
- let t2 = x[o2.name];
26
- t2 || (t2 = F[e2]), t2 && (o2.itemStyle = { color: t2 });
24
+ for (let e2 = 0; e2 < v.length && e2 < g.length; e2++) {
25
+ const o2 = { value: g[e2], name: v[e2] };
26
+ if (e2 < x.length || j[o2.name]) {
27
+ let t2 = j[o2.name];
28
+ t2 || (t2 = x[e2]), t2 && (o2.itemStyle = { color: t2 });
27
29
  }
28
30
  S.push(o2);
29
31
  }
30
- const j = t(g);
31
- j[0].data = S, r.series = [j[0]], l.groupFields = f, l.cacheDatas = a, l.rawResult = i;
32
+ const y = t(F);
33
+ y[0].data = S, i.series = [y[0]], l.groupFields = h, l.cacheDatas = u, l.rawResult = p;
32
34
  }
33
35
  export {
34
- s as updateChartOption
36
+ r as updateChartOption
35
37
  };