super-page-runtime 2.3.40 → 2.3.41

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,5 +1,5 @@
1
1
  import { getOptionDatasSourceMap as e, getComponentOptionDatasFromPage as t, getVariableValue as n, setVariableValue as o, setValueForVariableName as i } from "../page-helper-util.js";
2
- import { getComponentRef as a, getComponentRefByCode as r } from "../global-refs.js";
2
+ import { getComponentRef as r, getComponentRefByCode as a } from "../global-refs.js";
3
3
  import s 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";
@@ -9,28 +9,28 @@ import { replacePrefix as b, isMobileBrowser as h } from "agilebuilder-ui/src/ut
9
9
  import { getFormModelFields as E, getModelFields as C } from "../page-init-util.js";
10
10
  import { getCustomFunc as P } from "../events/event-util.js";
11
11
  import { isHasFieldPermissionAuth as T } from "../table-utils.js";
12
- import { scrollIntoComponentWithCode as k, scrollIntoComponentWithUuid as $ } from "../anchor-util.js";
13
- const v = { showElement: function(e2, t2, n2) {
14
- n2 ? D(e2, "showElement", t2) : t2.forEach((t3) => {
15
- const n3 = r(e2, t3);
12
+ import { scrollIntoComponentWithCode as k, scrollIntoComponentWithUuid as v } from "../anchor-util.js";
13
+ const $ = { showElement: function(e2, t2, n2) {
14
+ n2 ? V(e2, "showElement", t2) : t2.forEach((t3) => {
15
+ const n3 = a(e2, t3);
16
16
  n3 ? n3.show() : console.error(`未找到code为${t3}的组件`);
17
17
  });
18
18
  }, hideElement: function(e2, t2, n2) {
19
- n2 ? D(e2, "hideElement", t2) : t2.forEach((t3) => {
20
- const n3 = r(e2, t3);
19
+ n2 ? V(e2, "hideElement", t2) : t2.forEach((t3) => {
20
+ const n3 = a(e2, t3);
21
21
  n3 ? n3.hide() : console.error(`未找到code为${t3}的组件`);
22
22
  });
23
23
  }, enableElement: function(e2, t2, n2) {
24
- n2 ? D(e2, "enableElement", t2) : t2.forEach((t3) => {
25
- const n3 = r(e2, t3);
24
+ n2 ? V(e2, "enableElement", t2) : t2.forEach((t3) => {
25
+ const n3 = a(e2, t3);
26
26
  if (n3) {
27
27
  const e3 = n3.getConfigure();
28
28
  e3 && e3.runtime.props && (e3.runtime.props.state = "enabled");
29
29
  } else console.error(`未找到code为${t3}的组件`);
30
30
  });
31
31
  }, disableElement: function(e2, t2, n2) {
32
- n2 ? D(e2, "disableElement", t2) : t2.forEach((t3) => {
33
- const n3 = r(e2, t3);
32
+ n2 ? V(e2, "disableElement", t2) : t2.forEach((t3) => {
33
+ const n3 = a(e2, t3);
34
34
  if (n3) {
35
35
  const e3 = n3.getConfigure();
36
36
  e3 && e3.runtime.props && (e3.runtime.props.state = "disabled");
@@ -49,7 +49,7 @@ const v = { showElement: function(e2, t2, n2) {
49
49
  i(e2.entity, o2.startsWith("${") ? o2 : "${" + t2 + "." + o2 + "}", n2[o2]);
50
50
  });
51
51
  }, dynamicControlFormEdit: function(e2, t2, n2) {
52
- n2 ? D(e2, "dynamicControlFormEdit", t2) : d(e2, t2);
52
+ n2 ? V(e2, "dynamicControlFormEdit", t2) : d(e2, t2);
53
53
  }, disabledAllFields(e2) {
54
54
  p(e2);
55
55
  }, dynamicControlTableEdit(e2, t2, n2) {
@@ -57,15 +57,15 @@ const v = { showElement: function(e2, t2, n2) {
57
57
  }, executeServiceFlow: function(e2, t2, n2) {
58
58
  const o2 = e2.code;
59
59
  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);
60
- const i2 = e2.backendUrl, a2 = y(i2, e2.isTest);
61
- return l.post(`${a2}/dsc/service-flow/execute/${o2}/${t2}`, n2);
60
+ const i2 = e2.backendUrl, r2 = y(i2, e2.isTest);
61
+ return l.post(`${r2}/dsc/service-flow/execute/${o2}/${t2}`, n2);
62
62
  }, openPage: function(e2, t2) {
63
63
  s.$emit(e2.code + "_open-dialog", { pageContext: e2, eventParams: t2.eventParams, configureObj: { props: { linkPage: t2 } } });
64
64
  }, refreshPage: function(e2, t2) {
65
65
  f(e2, t2);
66
66
  }, refreshSubTableHandle: function(e2, t2) {
67
67
  let n2;
68
- const o2 = r(e2, t2);
68
+ const o2 = a(e2, t2);
69
69
  if (o2) {
70
70
  const e3 = o2.getConfigure();
71
71
  e3 && e3.uuid && e3.name && "table" === e3.name && (n2 = e3.uuid);
@@ -73,7 +73,7 @@ const v = { showElement: function(e2, t2, n2) {
73
73
  n2 ? s.$emit("_refreshSubTableHandle_" + n2) : console.error("tableUUid is undefined");
74
74
  }, refreshChildData(e2, t2, n2) {
75
75
  let o2;
76
- const i2 = r(e2, t2);
76
+ const i2 = a(e2, t2);
77
77
  if (i2) {
78
78
  const e3 = i2.getConfigure();
79
79
  e3 && e3.uuid && e3.name && "table" === e3.name && (o2 = e3.uuid);
@@ -82,27 +82,27 @@ const v = { showElement: function(e2, t2, n2) {
82
82
  }, 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, getTaskDataValue: (e2, t2) => e2.entity.task ? e2.entity.task[t2] : null, getValueByType: (e2, t2, n2) => e2.entity[t2] ? e2.entity[t2][n2] : null, getAdditionalParams: (e2) => u(e2), getAdditionalParamValue(e2, t2) {
83
83
  const n2 = u(e2);
84
84
  return n2 ? n2[t2] : null;
85
- }, isMobile: () => h(), getComponentRefByProp: (e2, t2) => r(e2, t2), getComponentRefByCode: (e2, t2) => a(e2, t2), getFormViewData(i2) {
85
+ }, isMobile: () => h(), getComponentRefByProp: (e2, t2) => a(e2, t2), getComponentRefByCode: (e2, t2) => r(e2, t2), getFormViewData(i2) {
86
86
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
87
- const r2 = i2.entity ? i2.entity : {}, s2 = g(r2), l2 = e(i2);
87
+ const a2 = i2.entity ? i2.entity : {}, s2 = g(a2), l2 = e(i2);
88
88
  for (const e2 in l2) {
89
- const r3 = t(i2, e2), l3 = a(i2, e2);
89
+ const a3 = t(i2, e2), l3 = r(i2, e2);
90
90
  if (l3) {
91
91
  const e3 = l3.getConfigure();
92
92
  if (e3) if (!((_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)) {
93
93
  if ("dynamicData" === ((_h = (_g = e3 == null ? void 0 : e3.props) == null ? void 0 : _g.dataOrigin) == null ? void 0 : _h.optionValueSetType) && ("select" === (e3 == null ? void 0 : e3.name) || "checkbox" === (e3 == null ? void 0 : e3.name) || "radio" === (e3 == null ? void 0 : e3.name))) {
94
- const t2 = E(i2, e3), a2 = l3.getSelectItemsTitle(), r4 = a2 && a2.length > 0 ? a2 : n(s2, t2);
95
- o(s2, t2, r4);
94
+ const t2 = E(i2, e3), r2 = l3.getSelectItemsTitle(), a4 = r2 && r2.length > 0 ? r2 : n(s2, t2);
95
+ o(s2, t2, a4);
96
96
  }
97
97
  } else if (e3.name && ("select" === e3.name && ((_j = (_i = e3.props) == null ? void 0 : _i.base) == null ? void 0 : _j.multiple) || "checkbox" === e3.name)) {
98
- const t2 = E(i2, e3), a2 = n(s2, t2);
99
- if (a2) {
100
- const e4 = j(a2.split(","), r3);
98
+ const t2 = E(i2, e3), r2 = n(s2, t2);
99
+ if (r2) {
100
+ const e4 = S(r2.split(","), a3);
101
101
  o(s2, t2, e4);
102
102
  }
103
103
  } else {
104
- const t2 = E(i2, e3), a2 = j(n(s2, t2), r3);
105
- o(s2, t2, a2);
104
+ const t2 = E(i2, e3), r2 = S(n(s2, t2), a3);
105
+ o(s2, t2, r2);
106
106
  }
107
107
  }
108
108
  }
@@ -110,12 +110,12 @@ const v = { showElement: function(e2, t2, n2) {
110
110
  for (const e2 in c2) {
111
111
  let t2;
112
112
  if (e2.indexOf("__") > 0 && (t2 = e2.substring(e2.lastIndexOf("__") + 2)), t2) {
113
- const o2 = a(i2, t2);
113
+ const o2 = r(i2, t2);
114
114
  if (o2) {
115
- const t3 = o2.getConfigure(), i3 = t3.code ? t3.code : e2, a2 = C(t3, i3), r3 = n(s2, a2), l3 = o2.getTableSelectOptions(e2), c3 = o2.getColumns(), u2 = {}, f2 = {};
115
+ const t3 = o2.getConfigure(), i3 = t3.code ? t3.code : e2, r2 = C(t3, i3), a3 = n(s2, r2), l3 = o2.getTableSelectOptions(e2), c3 = o2.getColumns(), u2 = {}, f2 = {};
116
116
  c3 && c3.length > 0 && c3.forEach((e3) => {
117
117
  "DATE" !== e3.dataType && "TIME" !== e3.dataType || (f2[e3.prop] = e3);
118
- }), u2.formatDateColumns = f2, V(l3, r3, u2, o2);
118
+ }), u2.formatDateColumns = f2, j(l3, a3, u2, o2);
119
119
  }
120
120
  }
121
121
  }
@@ -128,7 +128,7 @@ const v = { showElement: function(e2, t2, n2) {
128
128
  }, isHasFieldAuthWithTable(e2, t2, n2) {
129
129
  T(e2, t2, n2);
130
130
  }, scrollIntoComponentWithUuid(e2, t2) {
131
- $(e2, t2);
131
+ v(e2, t2);
132
132
  }, scrollIntoComponentWithCode(e2, t2) {
133
133
  k(e2, t2);
134
134
  }, isSignerTaskTransactor(e2, t2) {
@@ -141,7 +141,7 @@ const v = { showElement: function(e2, t2, n2) {
141
141
  }
142
142
  return false;
143
143
  } };
144
- function V(e2, t2, n2, o2) {
144
+ function j(e2, t2, n2, o2) {
145
145
  if (e2 && t2) {
146
146
  const i2 = o2.getSuperGridRef();
147
147
  t2.forEach((t3) => {
@@ -153,38 +153,50 @@ function V(e2, t2, n2, o2) {
153
153
  });
154
154
  }
155
155
  Object.keys(e2).forEach((n3) => {
156
- const o3 = t3[n3], i3 = e2[n3], a2 = i3.options, r2 = i3.column;
156
+ const o3 = t3[n3], i3 = e2[n3], r2 = i3.options, a2 = i3.column;
157
157
  let s2;
158
- if (r2 && r2.componentType && ("multiselect" === r2.componentType || "checkbox" === r2.componentType)) {
158
+ if (a2 && a2.componentType && ("multiselect" === a2.componentType || "checkbox" === a2.componentType)) {
159
159
  if (o3) {
160
- s2 = j(o3.split(","), a2);
160
+ s2 = S(o3.split(","), r2);
161
161
  }
162
- } else s2 = j(o3, a2);
162
+ } else s2 = S(o3, r2);
163
163
  t3[n3] = s2;
164
164
  });
165
165
  });
166
166
  }
167
167
  }
168
- function j(e2, t2) {
169
- let n2;
170
- return null != e2 && t2 && (Array.isArray(e2) ? (n2 = "", e2.forEach((e3) => {
171
- n2 = n2 + A(e3, t2) + ",";
172
- }), n2.indexOf(",") > 0 && (n2 = n2.substring(0, n2.lastIndexOf(",")))) : (n2 = e2, n2 = A(e2, t2))), n2;
173
- }
174
- function A(e2, t2) {
175
- let n2 = e2;
176
- if (null != e2 && t2) for (let o2 = 0; o2 < t2.length; o2++) {
177
- const i2 = t2[o2].value, a2 = t2[o2].label ? t2[o2].label : t2[o2].name;
178
- if (e2 + "" == i2 + "" && null != a2) {
179
- n2 = a2;
180
- break;
181
- }
168
+ function S(e2, t2) {
169
+ if (null == e2 || !t2) return "";
170
+ if (Array.isArray(e2)) {
171
+ const n2 = function(e3) {
172
+ const t3 = /* @__PURE__ */ new Map();
173
+ for (const n3 of e3) {
174
+ const e4 = String(n3.value);
175
+ if (!t3.has(e4)) {
176
+ const o2 = n3.label ? n3.label : n3.name;
177
+ null != o2 && t3.set(e4, o2);
178
+ }
179
+ }
180
+ return t3;
181
+ }(t2);
182
+ return e2.map((e3) => {
183
+ const t3 = String(e3);
184
+ return n2.has(t3) ? n2.get(t3) : e3;
185
+ }).join(",");
182
186
  }
183
- return n2;
187
+ return function(e3, t3) {
188
+ if (null == e3 || !t3) return e3;
189
+ const n2 = String(e3);
190
+ for (const e4 of t3) if (String(e4.value) === n2) {
191
+ const t4 = e4.label ? e4.label : e4.name;
192
+ if (null != t4) return t4;
193
+ }
194
+ return e3;
195
+ }(e2, t2);
184
196
  }
185
- function D(e2, t2, n2) {
197
+ function V(e2, t2, n2) {
186
198
  e2.initInfo || (e2.initInfo = {}), e2.initInfo[t2] = n2;
187
199
  }
188
200
  export {
189
- v as functions
201
+ $ as functions
190
202
  };