super-page-runtime 2.2.26 → 2.2.29

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.
@@ -36,16 +36,16 @@ function getTableQueryInfo(t, e) {
36
36
  o2.propDbName || (o2.propDbName = o2.propName);
37
37
  const t2 = {};
38
38
  Object.assign(t2, o2);
39
- const a2 = getParamNames(o2.propValue);
40
- for (const t3 of a2) t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (n.includes(t3) || n.push(t3));
39
+ const r2 = getParamNames(o2.propValue);
40
+ for (const t3 of r2) t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (n.includes(t3) || n.push(t3));
41
41
  o2.propValue, e2.push(t2);
42
42
  }
43
43
  o.props.searchForm = e2;
44
44
  }
45
45
  o.props.monitorFields = n;
46
- const a = [];
47
- if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 == a.indexOf(t.tableLableField) && (o.props.lableField = t.tableLableField), t.autoSets) for (const e2 of t.autoSets) e2.source && -1 == a.indexOf(e2.source) && a.push(e2.source);
48
- return o.props.queryFields = a, o.props.pageSize = t.displayQuantity, o;
46
+ const r = [];
47
+ if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 == r.indexOf(t.tableLableField) && (o.props.lableField = t.tableLableField), t.autoSets) for (const e2 of t.autoSets) e2.source && -1 == r.indexOf(e2.source) && r.push(e2.source);
48
+ return o.props.queryFields = r, o.props.pageSize = t.displayQuantity, o;
49
49
  }
50
50
  function getServiceQueryInfo(t, e) {
51
51
  const o = { type: "service" };
@@ -61,16 +61,16 @@ function getServiceQueryInfo(t, e) {
61
61
  return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
62
62
  }
63
63
  function updateChartDatasources(t, e, o, n) {
64
- return new Promise((a, r) => {
65
- if (!e || 0 == e.length) return void r(new Error("无需查询的统计图配置!"));
64
+ return new Promise((r, a) => {
65
+ if (!e || 0 == e.length) return void a(new Error("无需查询的统计图配置!"));
66
66
  const s = deepCopy(e);
67
67
  s.forEach((e2) => {
68
68
  const o2 = e2.services;
69
69
  if (o2 && o2.length > 0) {
70
70
  const e3 = o2[0].serviceInputs;
71
71
  e3 && (o2[0].serviceInParams = {}, e3.forEach((e4) => {
72
- const n2 = e4.name, a2 = e4.value;
73
- o2[0].serviceInParams[n2] = getValueFromVariable(t.entity, a2);
72
+ const n2 = e4.name, r2 = e4.value;
73
+ o2[0].serviceInParams[n2] = getValueFromVariable(t.entity, r2);
74
74
  }), delete o2[0].serviceInputs);
75
75
  }
76
76
  });
@@ -84,19 +84,19 @@ function updateChartDatasources(t, e, o, n) {
84
84
  t.chartDataSourceMap || (t.chartDataSourceMap = {});
85
85
  for (const o2 in e2) {
86
86
  t.chartDataSourceMap[o2] = e2[o2];
87
- const a2 = getComponentRef(t, o2);
88
- if (a2) {
89
- const r2 = a2.getConfigure();
90
- if ((!n || r2 && (void 0 === r2.initializationQuery || r2.initializationQuery)) && a2.updateChartDatas && (a2.updateChartDatas(e2[o2]), (_b = (_a = r2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
91
- const n2 = e2[o2] && e2[o2].length > 0 ? e2[o2][0] : {}, a3 = n2 && n2.result ? n2.result : {};
87
+ const r2 = getComponentRef(t, o2);
88
+ if (r2) {
89
+ const a2 = r2.getConfigure();
90
+ if ((!n || a2 && (void 0 === a2.initializationQuery || a2.initializationQuery)) && r2.updateChartDatas && (r2.updateChartDatas(e2[o2]), (_b = (_a = a2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
91
+ const n2 = e2[o2] && e2[o2].length > 0 ? e2[o2][0] : {}, r3 = n2 && n2.result ? n2.result : {};
92
92
  let s2 = null;
93
- r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(t.entity, r2.runtime.dataConfig.resultSet, s2);
93
+ a2.serviceDataField ? s2 = r3[a2.serviceDataField] : r3 && (s2 = Array.isArray(r3) ? r3 : [r3]), s2 || (s2 = []), setValueForVariableName(t.entity, a2.runtime.dataConfig.resultSet, s2);
94
94
  }
95
95
  }
96
96
  }
97
- a(e2);
97
+ r(e2);
98
98
  }).catch((t2) => {
99
- r(t2);
99
+ a(t2);
100
100
  });
101
101
  });
102
102
  }
@@ -105,11 +105,11 @@ function updateChartDatasourcesByComponent(t, e) {
105
105
  o && updateChartDatasources(t, [o], null, false);
106
106
  }
107
107
  function updateOptionDatasources(t, e, o) {
108
- return new Promise((n, a) => {
109
- if (!e || 0 == e.length) return void a(new Error("无需查询的配置!"));
110
- const r = t.entity ? t.entity : {}, s = {};
111
- r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query = o;
112
- const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query: o }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
108
+ return new Promise((n, r) => {
109
+ if (!e || 0 == e.length) return void r(new Error("无需查询的配置!"));
110
+ const a = t.entity ? t.entity : {}, s = {};
111
+ a.request && Object.assign(s, a.request), a.page && Object.assign(s, a.page), s.query = o;
112
+ const i = { entityMap: a.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query: o }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
113
113
  http.post(l, i).then((e2) => {
114
114
  t.optionSourceMap || (t.optionSourceMap = {});
115
115
  for (const o2 in e2) {
@@ -119,7 +119,7 @@ function updateOptionDatasources(t, e, o) {
119
119
  }
120
120
  n(e2);
121
121
  }).catch((t2) => {
122
- a(t2);
122
+ r(t2);
123
123
  });
124
124
  });
125
125
  }
@@ -144,14 +144,14 @@ function queryOptionDatasources(t, e, o) {
144
144
  }
145
145
  function autoSetAfterSelect(t, e, o, n) {
146
146
  if (!o || 0 == o.length) return;
147
- const a = e.entity ? e.entity : {};
147
+ const r = e.entity ? e.entity : {};
148
148
  for (const t2 of o) {
149
149
  if (!t2.source || !t2.target) continue;
150
150
  const e2 = getValuesByField(n, t2.source);
151
151
  let o2 = t2.target;
152
152
  if (!o2 || !o2.startsWith("${")) continue;
153
153
  o2 = o2.substring(2, o2.length - 1);
154
- setVariableValue(a, o2.split("."), e2.join(","));
154
+ setVariableValue(r, o2.split("."), e2.join(","));
155
155
  }
156
156
  }
157
157
  function getValuesByField(t, e) {
@@ -182,8 +182,8 @@ function setVariableValue(t, e, o) {
182
182
  if (!t || !e || 0 == e.length) return;
183
183
  let n = t;
184
184
  for (let t2 = 0; t2 < e.length; t2++) {
185
- const a = e[t2];
186
- t2 + 1 === e.length ? n[a] = o : (void 0 === n[a] && (n[a] = {}), n = n[a]);
185
+ const r = e[t2];
186
+ t2 + 1 === e.length ? n[r] = o : (void 0 === n[r] && (n[r] = {}), n = n[r]);
187
187
  }
188
188
  }
189
189
  function setVariableValueWithProp(t, e, o) {
@@ -194,9 +194,10 @@ function formatVariableValue(t, e) {
194
194
  if (!t || "" == e || null == e || null == e) return e;
195
195
  const o = t.entity ? t.entity : {}, n = getParamNames(e);
196
196
  for (const t2 in n) {
197
- const a = n[t2], r = getValueFromVariable(o, a);
198
- if (r && "[object Date]" === Object.prototype.toString.call(r)) return dayjs(r).format("YYYY-MM-DD hh:mm:ss");
199
- e = e.replace(a, null == r ? "" : r);
197
+ const r = n[t2], a = getValueFromVariable(o, r);
198
+ if (a && "[object Date]" === Object.prototype.toString.call(a)) return dayjs(a).format("YYYY-MM-DD hh:mm:ss");
199
+ if (a && "number" == typeof a) return a;
200
+ e = e.replace(r, null == a ? "" : a);
200
201
  }
201
202
  return e;
202
203
  }
@@ -229,18 +230,18 @@ function formatValueByType(t, e, o) {
229
230
  function getValueFromVariable(t, e, o) {
230
231
  if (null == e || null == e) return e;
231
232
  if (e.startsWith("${") && e.endsWith("}")) {
232
- let n = e.substring(2, e.length - 1), a = null, r = null;
233
- if (n.startsWith("data.")) n = n.substring(5), r = t.data, a = "data";
234
- else if (n.startsWith("page.")) n = n.substring(5), a = "page", r = t.page;
235
- else if (n.startsWith("task.")) n = n.substring(5), a = "task", r = t.task;
236
- else if (n.startsWith("request.")) n = n.substring(8), a = "request", r = t.request;
237
- else if (n.startsWith("context.")) n = n.substring(8), a = "context", r = t.context;
238
- else if (n.startsWith("system.")) n = n.substring(7), a = "system", r = t.system;
233
+ let n = e.substring(2, e.length - 1), r = null, a = null;
234
+ if (n.startsWith("data.")) n = n.substring(5), a = t.data, r = "data";
235
+ else if (n.startsWith("page.")) n = n.substring(5), r = "page", a = t.page;
236
+ else if (n.startsWith("task.")) n = n.substring(5), r = "task", a = t.task;
237
+ else if (n.startsWith("request.")) n = n.substring(8), r = "request", a = t.request;
238
+ else if (n.startsWith("context.")) n = n.substring(8), r = "context", a = t.context;
239
+ else if (n.startsWith("system.")) n = n.substring(7), r = "system", a = t.system;
239
240
  else {
240
241
  if (n.startsWith("fixed.")) return n.substring(6);
241
- n.startsWith("row.") && (n = n.substring(4), r = o, a = "row");
242
+ n.startsWith("row.") && (n = n.substring(4), a = o, r = "row");
242
243
  }
243
- return n ? getValueFromSource(r, n, a) : "";
244
+ return n ? getValueFromSource(a, n, r) : "";
244
245
  }
245
246
  return e;
246
247
  }
@@ -248,17 +249,17 @@ function getValueFromSource(t, e, o) {
248
249
  if ("context" != o && !t || !e) return;
249
250
  const n = e.indexOf(".");
250
251
  if (n > -1) {
251
- const a = e.substring(0, n), r = e.substring(n + 1);
252
- let s = t[a];
253
- return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, o);
252
+ const r = e.substring(0, n), a = e.substring(n + 1);
253
+ let s = t[r];
254
+ return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, a, o);
254
255
  }
255
256
  if ("context" == o) {
256
257
  if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
257
258
  if (e.startsWith("currentDate") && e.length > 11) {
258
259
  const t2 = e.substring(11), o2 = t2.substring(0, 1);
259
260
  let n2 = parseInt(t2.substring(1, t2.length - 1), 10);
260
- const a = t2.substring(t2.length - 1), r = /* @__PURE__ */ new Date();
261
- return n2 = "+" === o2 ? n2 : -n2, "d" === a || "w" === a ? (n2 = "w" === a ? 7 * n2 : n2, r.setDate(r.getDate() + n2)) : "m" === a ? r.setMonth(r.getMonth() + n2) : "y" === a && r.setFullYear(r.getFullYear() + n2), r;
261
+ const r = t2.substring(t2.length - 1), a = /* @__PURE__ */ new Date();
262
+ return n2 = "+" === o2 ? n2 : -n2, "d" === r || "w" === r ? (n2 = "w" === r ? 7 * n2 : n2, a.setDate(a.getDate() + n2)) : "m" === r ? a.setMonth(a.getMonth() + n2) : "y" === r && a.setFullYear(a.getFullYear() + n2), a;
262
263
  }
263
264
  if (!t) return;
264
265
  }
@@ -274,13 +275,13 @@ function caculateShowCondition(pageContext, showConditions, row) {
274
275
  let n = e.operator;
275
276
  if (!o || "" === o) continue;
276
277
  n || (n = "EQ");
277
- const a = getValueFromVariable(entityData, o, row);
278
- let r = getValueFromVariable(entityData, e.propValue, row);
278
+ const r = getValueFromVariable(entityData, o, row);
279
+ let a = getValueFromVariable(entityData, e.propValue, row);
279
280
  const s = e.dataType;
280
- "CONTAIN" != n && "NOT_CONTAIN" != n || a && !a.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
281
+ "CONTAIN" != n && "NOT_CONTAIN" != n || r && !r.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
281
282
  let i = e.variableIsNull, u;
282
- if (i || (i = "null"), void 0 !== r && "" !== r || (r = null, "null" === i ? n = "IS_NULL" : "notequal" === i ? n = "IS_NOT_NULL" : u = true), null == u) try {
283
- u = executeExpression(a, n, r, s);
283
+ if (i || (i = "null"), void 0 !== a && "" !== a || (a = null, "null" === i ? n = "IS_NULL" : "notequal" === i ? n = "IS_NOT_NULL" : u = true), null == u) try {
284
+ u = executeExpression(r, n, a, s);
284
285
  } catch (t2) {
285
286
  u = false;
286
287
  }
@@ -295,17 +296,17 @@ function caculateShowCondition(pageContext, showConditions, row) {
295
296
  }
296
297
  function monitorFieldChange(t, e, o) {
297
298
  if (!o || !t || !e || 0 == e.length) return;
298
- const n = [], a = [];
299
+ const n = [], r = [];
299
300
  for (let t2 of e) if (t2.startsWith("${")) {
300
301
  t2 = t2.substring(2, t2.length - 1);
301
302
  const e2 = t2.split(".");
302
- "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2), a.includes(e2[0]) || a.push(e2[0]));
303
+ "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2), r.includes(e2[0]) || r.push(e2[0]));
303
304
  }
304
- const r = t.entity;
305
- let s = getMonitorFieldValues(n, r), i = false;
306
- for (const t2 of a) watch(r[t2], () => {
305
+ const a = t.entity;
306
+ let s = getMonitorFieldValues(n, a), i = false;
307
+ for (const t2 of r) watch(a[t2], () => {
307
308
  i && clearTimeout(i), i = setTimeout(function() {
308
- const t3 = getMonitorFieldValues(n, r);
309
+ const t3 = getMonitorFieldValues(n, a);
309
310
  s != t3 && (s = t3, o());
310
311
  }, 200);
311
312
  });
@@ -57,7 +57,7 @@ function b(e2) {
57
57
  function y(e2, t2) {
58
58
  if (e2) {
59
59
  Object.assign(t2, e2);
60
- E(e2.paramStoreId, t2), delete e2.paramStoreId;
60
+ E(e2.paramStoreId, t2), delete e2.paramStoreId, e2.jumpMode && (t2.jumpMode = e2.jumpMode);
61
61
  }
62
62
  }
63
63
  function h(e2, t2) {
@@ -102,7 +102,7 @@ function P(e2, t2, s2, i2) {
102
102
  }
103
103
  return n2;
104
104
  }
105
- function C(e2, t2) {
105
+ function M(e2, t2) {
106
106
  if (!t2 || !e2 || t2.isTest) return "true";
107
107
  const s2 = [];
108
108
  if (e2.autoPermissions) for (const i2 of e2.autoPermissions) s2.push(t2.code + "." + i2.simpleCode);
@@ -116,13 +116,13 @@ function C(e2, t2) {
116
116
  }
117
117
  return s2.join(",");
118
118
  }
119
- function I(s2, i2, n2) {
119
+ function j(s2, i2, n2) {
120
120
  const o2 = s2.tableRuntimes, r2 = t(i2);
121
121
  let l2;
122
122
  const a2 = i2.code;
123
123
  return r2 && Object.keys(r2) > 0 && (l2 = JSON.stringify(r2)), e.post(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/super-grids", { tableRuntimes: o2, additionalParamMapJson: l2, pageCode: a2, publishVersion: n2, pageType: s2.pageType });
124
124
  }
125
- function M(e2, t2) {
125
+ function C(e2, t2) {
126
126
  var _a, _b;
127
127
  const s2 = t2.props && t2.props.base ? t2.props.base.prop : null;
128
128
  let n2 = false;
@@ -141,7 +141,7 @@ function M(e2, t2) {
141
141
  ((_b = t2.props) == null ? void 0 : _b.customRuleEvents) && (e2.customRuleEvents || (e2.customRuleEvents = []), e2.customRuleEvents.push({ prop: o2, events: t2.props.customRuleEvents }));
142
142
  }
143
143
  }
144
- function j(e2, t2) {
144
+ function I(e2, t2) {
145
145
  if (e2.initInfo) {
146
146
  ["dynamicControlFormEdit", "disableElement", "enableElement", "hideElement", "showElement"].forEach((s2) => {
147
147
  const i2 = e2.initInfo[s2];
@@ -157,16 +157,16 @@ function j(e2, t2) {
157
157
  }
158
158
  }
159
159
  export {
160
- j as controlObjectRenderState,
160
+ I as controlObjectRenderState,
161
161
  c as convertToPageContext,
162
162
  P as getDefaultValue,
163
163
  w as getFormModelFields,
164
164
  v as getModelFields,
165
- C as getPermissionCodes,
165
+ M as getPermissionCodes,
166
166
  b as packageAdditionalMapWithLocationSearch,
167
167
  y as packageAdditionalMapWithPageRequest,
168
168
  h as packageAdditionalMapWithRoute,
169
- M as packageFormRules,
169
+ C as packageFormRules,
170
170
  f as queryPageDesignByCode,
171
- I as queryPageSuperGrids
171
+ j as queryPageSuperGrids
172
172
  };
@@ -9,6 +9,7 @@ const C = { "element-loading-text": "加载中..." }, v = e({ name: "HomeChart",
9
9
  const v2 = e2, y = t(true), S = t(false), b = t({});
10
10
  let I, U = t(null);
11
11
  return v2.chartCode && g.get(window.$vueApp.config.globalProperties.baseAPI + "/mms/home-chart-layout/" + v2.chartCode).then((e3) => {
12
+ var _a, _b;
12
13
  if (e3 && e3.designJson) {
13
14
  const t2 = JSON.parse(e3.designJson);
14
15
  let a2 = window.localStorage.getItem("HOME_MY_CHARTS_ALIAS");
@@ -18,8 +19,8 @@ const C = { "element-loading-text": "加载中..." }, v = e({ name: "HomeChart",
18
19
  }
19
20
  const i2 = window.frameElement;
20
21
  b.value = t2.chartJson, b.value.homeChartSettingUserId = v2.homeChartSettingUserId, i2 && (b.value.runtime.common.style.pc_style.height = i2.clientHeight + "px");
21
- const n2 = { showHomepageSearch: true, name: e3.pageName, code: e3.pageCode, label: "", dimensions: "", version: 1, isWorkflowEntity: false, variables: t2.variables, systemCode: e3.systemCode, uuid: e3.uuid, allChartUuids: [], backendUrl: e3.backendUrl, rules: {}, pageType: "chart", beanName: t2.beanName, initChartServiceConfigs: [t2.initChartServiceConfigs], entity: { data: {}, task: {}, request: {}, page: {}, context: e3.contextParam, system: e3.systemParam } };
22
- if (t2.variables) {
22
+ const n2 = { showHomepageSearch: false, name: e3.pageName, code: e3.pageCode, label: "", dimensions: "", version: 1, isWorkflowEntity: false, variables: t2.variables, systemCode: e3.systemCode, uuid: e3.uuid, allChartUuids: [], backendUrl: e3.backendUrl, rules: {}, pageType: "chart", beanName: t2.beanName, initChartServiceConfigs: [t2.initChartServiceConfigs], entity: { data: {}, task: {}, request: {}, page: {}, context: e3.contextParam, system: e3.systemParam } };
23
+ if (((_a = b.value.pushHomepage) == null ? void 0 : _a.searchConditions) && ((_b = b.value.pushHomepage) == null ? void 0 : _b.searchConditions.length) > 0 && (n2.showHomepageSearch = true), t2.variables) {
23
24
  const e4 = n2.entity.page;
24
25
  for (const a3 of t2.variables) a3.name && (a3.isArrayElement ? e4[a3.name] = [] : a3.defaultValue ? e4[a3.name] = a3.defaultValue : e4[a3.name] = void 0);
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.2.26",
3
+ "version": "2.2.29",
4
4
  "description": "AgileBuilder super page runtime",
5
5
  "license": "ISC",
6
6
  "main": "dist/es/index.js",
@@ -48,7 +48,7 @@
48
48
  "@vitejs/plugin-vue-jsx": "^3.1.0",
49
49
  "@vue/eslint-config-prettier": "^8.0.0",
50
50
  "@vue/test-utils": "^2.4.4",
51
- "agilebuilder-ui": "1.1.11",
51
+ "agilebuilder-ui": "1.1.12",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",