super-page-runtime 2.1.93 → 2.1.932

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,9 +1,8 @@
1
- import { setValueForVariableName, getValueFromSource, formatVariableValue } from "../page-helper-util.js";
1
+ import { getValueFromSource, formatVariableValue, setValueForVariableName } from "../page-helper-util.js";
2
2
  import { deepCopy } from "../common-util.js";
3
3
  import { CommonName, caculateFormulaValue, sortDatas, limitDatas, executeChartFormula } from "./chart-util.js";
4
4
  import { handleChartEvent } from "../events/event-util.js";
5
5
  function updateChartOption(pageContext, configure, chartOption, resultData) {
6
- var _a;
7
6
  if (!resultData || !resultData.result) {
8
7
  return;
9
8
  }
@@ -28,9 +27,6 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
28
27
  if (!datas) {
29
28
  datas = [];
30
29
  }
31
- if ((_a = configure.runtime.dataConfig) == null ? void 0 : _a.resultSet) {
32
- setValueForVariableName(pageContext.entity, configure.runtime.dataConfig.resultSet, datas);
33
- }
34
30
  configure.runtime.dataConfig.runtimeData = datas;
35
31
  let confGroups = configure.props ? configure.props.groups : null;
36
32
  if (!confGroups) {
@@ -2238,8 +2238,7 @@ function formatAdditionalParamMapIds(ids2) {
2238
2238
  ids2 = ids2.split(",");
2239
2239
  } else if (typeof ids2 === "number") {
2240
2240
  ids2 = [ids2];
2241
- } else
2242
- ;
2241
+ } else ;
2243
2242
  }
2244
2243
  return ids2;
2245
2244
  }
@@ -76,25 +76,10 @@ function getEndObjectRule(rule, props, currentProp) {
76
76
  }
77
77
  function getValidator(columns) {
78
78
  const rules = {};
79
- if (columns) {
80
- columns.forEach((editField) => {
81
- const prop = editField.model;
82
- if (prop && editField.validations) {
83
- const validations = editField.validations;
84
- if (prop.indexOf(".") > 0) {
85
- setObjectPropRule(editField.prop, rules, validations);
86
- } else {
87
- if (validations && validations.length > 0) {
88
- rules[prop] = [...validations];
89
- }
90
- }
91
- }
92
- });
93
- }
94
79
  return rules;
95
80
  }
96
81
  function validator(entity, rules, columns, rowIndex, isSql) {
97
- return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
82
+ return validatorEntity(entity, rules, columns, rowIndex, true);
98
83
  }
99
84
  function sublistVerify(rules) {
100
85
  if (!rules) {
@@ -120,7 +105,7 @@ function sublistVerify(rules) {
120
105
  function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
121
106
  let validateRules = sublistVerify(rules);
122
107
  if ((!rules || rules === null) && columns) {
123
- validateRules = getValidator(columns);
108
+ validateRules = getValidator();
124
109
  }
125
110
  if (!validateRules || Object.keys(validateRules).length === 0) {
126
111
  entity["validateErrorField"] = "";
@@ -138,11 +123,6 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
138
123
  if (errors) {
139
124
  result = errors[0].message;
140
125
  fieldName = errors[0]["field"];
141
- if (typeof rowIndex !== "undefined" && rowIndex !== null) {
142
- result = getI18n().t("superPageRuntimeMessage.recordLine", {
143
- row: rowIndex + 1
144
- }) + "," + result;
145
- }
146
126
  ElMessage({
147
127
  message: result,
148
128
  showClose: true,
@@ -155,11 +135,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
155
135
  }
156
136
  if (fieldName && isShouldRepeateValdate === true) {
157
137
  const reg1 = /[A-Z]+/;
158
- if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
138
+ if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
159
139
  const copyEntity = JSON.parse(JSON.stringify(entity));
160
140
  copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
161
141
  delete copyEntity[fieldName.toLowerCase()];
162
- result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
142
+ result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
163
143
  }
164
144
  }
165
145
  }
@@ -272,7 +252,7 @@ function validateCommon(dataModel, pageContext, rules) {
272
252
  if (!rules || Object.keys(rules).length === 0) {
273
253
  resolve(true);
274
254
  } else {
275
- const validateEntityResult = validator(handleModels, rules, null, null, true);
255
+ const validateEntityResult = validator(handleModels, rules, null, null);
276
256
  if (validateEntityResult === true) {
277
257
  const validateResult = validateSubTables(pageContext);
278
258
  if (validateResult === true) {
@@ -81,8 +81,7 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
81
81
  }
82
82
  }
83
83
  }
84
- if (f.propValue)
85
- ;
84
+ if (f.propValue) ;
86
85
  searchForm.push(tempObj);
87
86
  }
88
87
  infoObj.props.searchForm = searchForm;
@@ -152,7 +151,10 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
152
151
  serviceInputs.forEach((inParam) => {
153
152
  const paramName = inParam.name;
154
153
  const paramValue = inParam.value;
155
- services[0].serviceInParams[paramName] = getValueFromVariable(pageContext2.entity, paramValue);
154
+ services[0].serviceInParams[paramName] = getValueFromVariable(
155
+ pageContext2.entity,
156
+ paramValue
157
+ );
156
158
  });
157
159
  }
158
160
  }
@@ -185,6 +187,7 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
185
187
  const baseUrl = getBaseUrl(backendUrl, pageContext2.isTest);
186
188
  const url = baseUrl + "/common/common-data/find-chart-datas";
187
189
  http.post(url, param).then((result) => {
190
+ var _a, _b;
188
191
  if (!pageContext2.chartDataSourceMap) {
189
192
  pageContext2.chartDataSourceMap = {};
190
193
  }
@@ -196,6 +199,30 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
196
199
  if (!isInit || chartConfig && chartConfig.initializationQuery) {
197
200
  if (componentObj.updateChartDatas) {
198
201
  componentObj.updateChartDatas(result[uuid]);
202
+ if ((_b = (_a = chartConfig.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet) {
203
+ const serviceData = result[uuid] && result[uuid].length > 0 ? result[uuid][0] : {};
204
+ const chartData = serviceData && serviceData.result ? serviceData.result : {};
205
+ let datas = null;
206
+ if (chartConfig.serviceDataField) {
207
+ datas = result[chartConfig.dataSetField];
208
+ } else {
209
+ if (chartData) {
210
+ if (Array.isArray(chartData)) {
211
+ datas = chartData;
212
+ } else {
213
+ datas = [chartData];
214
+ }
215
+ }
216
+ }
217
+ if (!datas) {
218
+ datas = [];
219
+ }
220
+ setValueForVariableName(
221
+ pageContext2.entity,
222
+ chartConfig.runtime.dataConfig.resultSet,
223
+ datas
224
+ );
225
+ }
199
226
  }
200
227
  }
201
228
  }
@@ -145,8 +145,7 @@ function getRequestObject(pageRequest) {
145
145
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
146
146
  }
147
147
  }
148
- if (requestObj["_t_"])
149
- ;
148
+ if (requestObj["_t_"]) ;
150
149
  return requestObj;
151
150
  }
152
151
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -238,8 +238,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
238
238
  }
239
239
  }
240
240
  } else {
241
- if (highOrder && highOrder.mergeColumn)
242
- ;
241
+ if (highOrder && highOrder.mergeColumn) ;
243
242
  if (highOrder && highOrder.mergeRow && highOrder.mergeRow.includes(property)) {
244
243
  if (rowIndex === 0) {
245
244
  return {
@@ -71,8 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
71
71
  menuTree.value.filter(val);
72
72
  });
73
73
  const filterNode = (value, data) => {
74
- if (!value)
75
- return true;
74
+ if (!value) return true;
76
75
  return data.name.includes(value);
77
76
  };
78
77
  function handleNodeClick(data, node, nodeTree) {
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from "./placeholder-runtime.vue2.js";
2
- import "./placeholder-runtime.vue3.js";
2
+ /* empty css */
3
3
  import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const placeholderRuntime = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-96fc65d8"]]);
5
5
  export {
@@ -361,8 +361,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
361
361
  if (!_selectFile_.value) {
362
362
  return;
363
363
  }
364
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
365
- return;
364
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
366
365
  const fileObj = _selectFile_.value.files[0];
367
366
  if (fileObj) {
368
367
  _selectFile_.value.value = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.93",
3
+ "version": "2.1.932",
4
4
  "description": "AgileBuilder super page runtime",
5
5
  "license": "ISC",
6
6
  "main": "dist/es/index.js",