super-page-runtime 2.3.38 → 2.3.39-cdn1

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.
@@ -2,6 +2,7 @@ interface eventBus {
2
2
  $on: any;
3
3
  $emit: any;
4
4
  $off: any;
5
+ $has: (event: string) => boolean;
5
6
  }
6
7
  declare const bus: eventBus;
7
8
  export default bus;
@@ -1,5 +1,8 @@
1
- import o from "mitt";
2
- const t = o(), f = { $on: t.on, $emit: t.emit, $off: t.off };
1
+ import t from "mitt";
2
+ const o = t(), r = { $on: o.on, $emit: o.emit, $off: o.off, $has: (t2) => {
3
+ const r2 = o.all.get(t2);
4
+ return Array.isArray(r2) && r2.length > 0;
5
+ } };
3
6
  export {
4
- f as default
7
+ r as default
5
8
  };
@@ -1,14 +1,14 @@
1
1
  import { isMobileBrowser as e, isPromise as n } from "agilebuilder-ui/src/utils/common-util";
2
2
  import { getAdditionalParamMap as t, standardEvents as o, judgeDataNumber as i, dealAfterOperate as r } from "./standard-event.js";
3
- import { validateDataModelFunc as u } from "./validator-util.js";
4
- import { getComponentRef as c, getComponentRefByCode as l } from "../global-refs.js";
5
- import { ElMessage as a } from "element-plus";
6
- import { analysisCondition as s } from "agilebuilder-ui/src/utils/util";
7
- import { getListCode as f, deepCopy as m } from "../common-util.js";
8
- import g from "../eventBus.js";
9
- import { getValueFromSource as d } from "../page-helper-util.js";
10
- import { expressJump as p } from "../table-utils.js";
11
- const v = ["downloadTemplate", "back", "exportForm", "exportPDF", "lineEditCreate", "workflowSave"], b = ["downloadTemplate", "exportForm", "exportPDF", "export", "exportCharts"], C = ["import"];
3
+ import { isNotNeedValidateRequired as u, validateDataModelFunc as c } from "./validator-util.js";
4
+ import { getComponentRef as l, getComponentRefByCode as a } from "../global-refs.js";
5
+ import { ElMessage as s } from "element-plus";
6
+ import { analysisCondition as f } from "agilebuilder-ui/src/utils/util";
7
+ import { getListCode as m, deepCopy as g } from "../common-util.js";
8
+ import d from "../eventBus.js";
9
+ import { getValueFromSource as p } from "../page-helper-util.js";
10
+ import { expressJump as v } from "../table-utils.js";
11
+ const b = ["downloadTemplate", "exportForm", "exportPDF", "export", "exportCharts"], C = ["import"];
12
12
  function x(e2, n2) {
13
13
  if (e2 && e2.customEvents) {
14
14
  const t2 = function(e3) {
@@ -24,7 +24,7 @@ function x(e2, n2) {
24
24
  n3[e4.eventName] = t3;
25
25
  } catch (n4) {
26
26
  const t4 = `自定义方法${e4.eventName}解析失败,请检查函数体是否正确`;
27
- console.error(t4, n4), a.error(t4);
27
+ console.error(t4, n4), s.error(t4);
28
28
  }
29
29
  } else {
30
30
  let t3 = e4.componentUuid + "_";
@@ -33,7 +33,7 @@ function x(e2, n2) {
33
33
  n3[t3] = new Function("params", e4.jsContent);
34
34
  } catch (n4) {
35
35
  let t4 = "";
36
- e4.title && (t4 += e4.title + "的"), e4.label && (t4 += e4.label), t4 += "事件解析失败,请检查事件函数体是否正确", a.error(t4), console.error(t4, n4);
36
+ e4.title && (t4 += e4.title + "的"), e4.label && (t4 += e4.label), t4 += "事件解析失败,请检查事件函数体是否正确", s.error(t4), console.error(t4, n4);
37
37
  }
38
38
  }
39
39
  }), n3;
@@ -41,24 +41,24 @@ function x(e2, n2) {
41
41
  !function(e3, n3) {
42
42
  if (!n3) return;
43
43
  for (const t3 in n3) {
44
- j(n3[t3], e3);
44
+ k(n3[t3], e3);
45
45
  }
46
46
  }(n2, t2), n2.customEvents = t2;
47
47
  }
48
48
  }
49
- function k(e2, n2) {
49
+ function j(e2, n2) {
50
50
  if (e2.customEvents) return e2.customEvents[n2];
51
51
  }
52
- function j(e2, n2) {
52
+ function k(e2, n2) {
53
53
  e2.get = function(e3) {
54
- return e3 ? l(n2, e3) : void 0;
54
+ return e3 ? a(n2, e3) : void 0;
55
55
  }, e2.getByUuid = function(e3) {
56
- return e3 ? c(n2, e3) : void 0;
56
+ return e3 ? l(n2, e3) : void 0;
57
57
  }, e2.getPageContext = function() {
58
58
  return n2;
59
59
  }, e2.getContextValue = function(e3) {
60
60
  let t2 = n2 && n2.entity ? n2.entity.context : null;
61
- return t2 = t2 || {}, d(t2, e3, "context");
61
+ return t2 = t2 || {}, p(t2, e3, "context");
62
62
  }, e2.getContext = function() {
63
63
  return n2 && n2.entity ? n2.entity.context : {};
64
64
  }, e2.getSystem = function() {
@@ -70,7 +70,7 @@ function j(e2, n2) {
70
70
  }, e2.getPage = function() {
71
71
  return n2 && n2.entity ? n2.entity.page : {};
72
72
  }, e2.getCustomFunc = function(e3) {
73
- return k(n2, e3);
73
+ return j(n2, e3);
74
74
  };
75
75
  }
76
76
  function O(e2) {
@@ -90,7 +90,7 @@ function y(e2, n2, t2, o2, i2) {
90
90
  const e3 = n2.subTableWatchProps;
91
91
  if (e3) for (const n3 in e3) {
92
92
  const o3 = e3[n3], i3 = (_b = (_a = t2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop;
93
- o3 && o3.indexOf(i3) >= 0 && g.$emit("_refreshSubTable_" + n3, { propName: i3 });
93
+ o3 && o3.indexOf(i3) >= 0 && d.$emit("_refreshSubTable_" + n3, { propName: i3 });
94
94
  }
95
95
  }
96
96
  return w(e2, n2, t2, o2, true, i2, true);
@@ -144,21 +144,19 @@ function T(e2, t2, o2) {
144
144
  const i2 = t2.runtime && t2.runtime.events ? t2.runtime.events : [];
145
145
  let r2 = true;
146
146
  (o2 == null ? void 0 : o2.skipValidate) && (r2 = false);
147
- const c2 = H(e2, i2, "click");
148
- if (c2) {
149
- const e3 = function(e4, n2) {
150
- return e4 && v.includes(n2.eventName);
151
- }(c2.isStandard, c2.event);
152
- e3 && (r2 = false);
147
+ const l2 = H(e2, i2, "click");
148
+ if (l2) {
149
+ const e3 = l2.isStandard, n2 = l2.event;
150
+ u(e3, n2) && (r2 = false);
153
151
  }
154
- u(e2, t2, r2).then((i3) => {
152
+ c(e2, t2, l2, r2).then((i3) => {
155
153
  if (!i3) return void (e2.canClick = true);
156
154
  const r3 = D(e2, t2, o2);
157
155
  r3 ? n(r3) ? r3.then((n2) => {
158
- n2 ? A(e2, t2, c2, o2) : e2.canClick = true;
156
+ n2 ? A(e2, t2, l2, o2) : e2.canClick = true;
159
157
  }).catch((n2) => {
160
158
  console.error(n2), e2.canClick = true;
161
- }) : A(e2, t2, c2, o2) : e2.canClick = true;
159
+ }) : A(e2, t2, l2, o2) : e2.canClick = true;
162
160
  }).catch((n2) => {
163
161
  console.error(n2), e2.canClick = true;
164
162
  });
@@ -170,9 +168,9 @@ function F(e2, n2, t2, o2, i2) {
170
168
  function U(e2, n2, t2, o2) {
171
169
  const i2 = n2.code, r2 = n2.version, u2 = P(n2, t2);
172
170
  if (u2) {
173
- const e3 = c(n2, u2), t3 = e3 ? e3.getSelections() : null, l2 = e3 ? e3.getSelectionIds() : null;
174
- o2 || (o2 = {}), o2.tableUuid = u2, o2.listCode = f(i2, r2, u2);
175
- _(n2) && (o2.selections = t3, o2.id = l2 && l2.length > 0 ? l2[0] : null, o2.ids = l2);
171
+ const e3 = l(n2, u2), t3 = e3 ? e3.getSelections() : null, c2 = e3 ? e3.getSelectionIds() : null;
172
+ o2 || (o2 = {}), o2.tableUuid = u2, o2.listCode = m(i2, r2, u2);
173
+ _(n2) && (o2.selections = t3, o2.id = c2 && c2.length > 0 ? c2[0] : null, o2.ids = c2);
176
174
  const a2 = e3 ? e3.getTableConfigure() : null;
177
175
  o2.tableConfigure = a2;
178
176
  }
@@ -185,7 +183,7 @@ function D(e2, n2, t2) {
185
183
  }
186
184
  function L(e2, n2, t2) {
187
185
  const o2 = e2.code + "_";
188
- g.$emit(o2 + "open-dialog", { pageContext: e2, configureObj: n2, eventParams: t2 });
186
+ d.$emit(o2 + "open-dialog", { pageContext: e2, configureObj: n2, eventParams: t2 });
189
187
  }
190
188
  function _(e2, n2) {
191
189
  return !(!e2.pageType || "list" !== e2.pageType);
@@ -211,9 +209,9 @@ function A(e2, t2, o2, i2) {
211
209
  let n3 = e3 ? e3.row : null;
212
210
  n3 || (n3 = e3 && e3.selections && e3.selections.length > 0 ? e3.selections[0] : null);
213
211
  return n3;
214
- }(i2), o3 = p(e2, t2, u2, n2);
212
+ }(i2), o3 = v(e2, t2, u2, n2);
215
213
  let c2, l2 = false;
216
- o3 && (l2 = o3.show, c2 = l2 ? o3.toPage : null), u2 = c2 ? c2.linkPage : null, u2 && (r2 = m(t2), r2.props.linkPage = u2);
214
+ o3 && (l2 = o3.show, c2 = l2 ? o3.toPage : null), u2 = c2 ? c2.linkPage : null, u2 && (r2 = g(t2), r2.props.linkPage = u2);
217
215
  }
218
216
  u2 && u2.jumpPageUrl ? (e2.canClick = true, L(e2, r2, i2)) : function(e3, t3, o3, i3) {
219
217
  const r3 = o3, u3 = _(e3);
@@ -282,18 +280,18 @@ function Q(e2) {
282
280
  if (null == u2 || "" === u2 || null == r2 || 0 === r2.length) e3({ canExecute: true });
283
281
  else {
284
282
  const o4 = n2.entity.context, i3 = t(n2), c2 = true, l2 = n2.tableName;
285
- let f2, m2, g2 = true;
283
+ let a2, m2, g2 = true;
286
284
  for (let e4 = 0; e4 < r2.length; e4++) {
287
285
  const t2 = r2[e4];
288
286
  for (let e5 = 0; e5 < u2.length; e5++) {
289
- const r3 = u2[e5], a2 = r3.toolTips, d2 = r3.conditionList;
290
- if (!s(d2, t2, i3, o4, c2, l2, null, n2)) {
291
- g2 = false, f2 = a2, m2 = t2;
287
+ const r3 = u2[e5], s2 = r3.toolTips, d2 = r3.conditionList;
288
+ if (!f(d2, t2, i3, o4, c2, l2, null, n2)) {
289
+ g2 = false, a2 = s2, m2 = t2;
292
290
  break;
293
291
  }
294
292
  }
295
293
  }
296
- g2 ? e3({ canExecute: true }) : (f2 && a({ showClose: true, type: "warning", message: f2 }), e3({ canExecute: false, message: f2, failEntity: m2 }));
294
+ g2 ? e3({ canExecute: true }) : (a2 && s({ showClose: true, type: "warning", message: a2 }), e3({ canExecute: false, message: a2, failEntity: m2 }));
297
295
  }
298
296
  });
299
297
  }
@@ -390,7 +388,7 @@ function le(n2, t2) {
390
388
  return o2;
391
389
  }
392
390
  export {
393
- j as appendDefaultMethods,
391
+ k as appendDefaultMethods,
394
392
  Q as canExecuteButton,
395
393
  X as cellClick,
396
394
  Y as cellDblClick,
@@ -403,7 +401,7 @@ export {
403
401
  re as fileUploadDeleted,
404
402
  oe as fileUploadUploaded,
405
403
  H as getClickEventFuncByType,
406
- k as getCustomFunc,
404
+ j as getCustomFunc,
407
405
  U as getDefaultEventParams,
408
406
  $ as getEventFuncByType,
409
407
  B as getEventNameByType,