super-page-runtime 2.1.77 → 2.1.80

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 (19) hide show
  1. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -1
  2. package/dist/es/components/runtime/utils/charts/chart-util.js +11 -3
  3. package/dist/es/components/runtime/utils/events/event-util.js +8 -3
  4. package/dist/es/components/runtime/utils/events/standard-event.js +1 -2
  5. package/dist/es/components/runtime/utils/events/validator-util.d.ts +2 -2
  6. package/dist/es/components/runtime/utils/events/validator-util.js +22 -29
  7. package/dist/es/components/runtime/utils/page-helper-util.js +21 -3
  8. package/dist/es/components/runtime/utils/page-init-util.js +3 -4
  9. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +1 -1
  10. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +3 -3
  11. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +2 -0
  12. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +2 -3
  13. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +2 -0
  14. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +1 -2
  15. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +2 -0
  16. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
  17. package/dist/es/components/runtime/views/super-page.vue.js +1 -2
  18. package/package.json +2 -2
  19. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +0 -1
@@ -104,7 +104,7 @@ export declare function executeChartFormula(formulaStr: string, accumulateMap: a
104
104
  * @param chartDom
105
105
  * @returns
106
106
  */
107
- export declare function exportCommonChart(chartDom: any): {
107
+ export declare function exportCommonChart(chartRef: any): {
108
108
  isTable: boolean;
109
109
  fileContent: any;
110
110
  fileSize: string;
@@ -495,11 +495,19 @@ function executeChartFormula(formulaStr, accumulateMap, rowData, pageContext) {
495
495
  row: rowData
496
496
  });
497
497
  }
498
- function exportCommonChart(chartDom) {
499
- const fileSize = chartDom.getAttribute("width") + ":" + chartDom.getAttribute("height");
498
+ function exportCommonChart(chartRef) {
499
+ if (!chartRef || !chartRef.$el) {
500
+ return;
501
+ }
502
+ const canvasDoms = chartRef.$el.getElementsByTagName("canvas");
503
+ if (!canvasDoms || canvasDoms.length === 0) {
504
+ return;
505
+ }
506
+ const canvasDom = canvasDoms[0];
507
+ const fileSize = canvasDom.width + ":" + canvasDom.height;
500
508
  return {
501
509
  isTable: false,
502
- fileContent: chartDom.getAttribute("base64Url"),
510
+ fileContent: canvasDom.toDataURL(),
503
511
  fileSize
504
512
  };
505
513
  }
@@ -4,7 +4,7 @@ import { validateDataModelFunc } from "./validator-util.js";
4
4
  import { getComponentRef, getComponentRefByCode } from "../global-refs.js";
5
5
  import { ElMessage } from "element-plus";
6
6
  import { analysisCondition } from "agilebuilder-ui/src/utils/util";
7
- import { getListCode } from "../common-util.js";
7
+ import { getListCode, deepCopy } from "../common-util.js";
8
8
  import eventBus from "../eventBus.js";
9
9
  import { getValueFromSource } from "../page-helper-util.js";
10
10
  import { expressJump } from "../table-utils.js";
@@ -378,6 +378,7 @@ function doAfterClickFunc(pageContext, configure, eventParams, isStandardEvent,
378
378
  }
379
379
  }
380
380
  function doClickEvent(pageContext, configure, clickEventFunObj, eventParams) {
381
+ let configureObj = configure;
381
382
  let linkPage = configure.props.linkPage;
382
383
  if (linkPage && linkPage instanceof Array) {
383
384
  const row = getRowData(eventParams);
@@ -388,11 +389,15 @@ function doClickEvent(pageContext, configure, clickEventFunObj, eventParams) {
388
389
  show = result.show;
389
390
  toLinkPage = show ? result.toPage : null;
390
391
  }
391
- linkPage = toLinkPage;
392
+ linkPage = toLinkPage ? toLinkPage.linkPage : null;
393
+ if (linkPage) {
394
+ configureObj = deepCopy(configure);
395
+ configureObj.props.linkPage = linkPage;
396
+ }
392
397
  }
393
398
  if (linkPage && linkPage.jumpPageUrl) {
394
399
  pageContext.canClick = true;
395
- doClickJumpPageEvent(pageContext, configure, eventParams);
400
+ doClickJumpPageEvent(pageContext, configureObj, eventParams);
396
401
  } else {
397
402
  doClickCustomEvent(pageContext, configure, clickEventFunObj, eventParams);
398
403
  }
@@ -2233,8 +2233,7 @@ function formatAdditionalParamMapIds(ids2) {
2233
2233
  ids2 = ids2.split(",");
2234
2234
  } else if (typeof ids2 === "number") {
2235
2235
  ids2 = [ids2];
2236
- } else
2237
- ;
2236
+ } else ;
2238
2237
  }
2239
2238
  return ids2;
2240
2239
  }
@@ -18,7 +18,7 @@ export declare function disabledAllFields(pageContext: PageContext): void;
18
18
  export declare function dynamicControlTableEdit(pageContext: PageContext, customRules: any[], tableCode?: any): void;
19
19
  export declare function updateComponentDisplayState(ref: any, item: any): void;
20
20
  /**
21
- * 布尔型校验需要自定义,为了兼容oracle和mysql数据库
21
+ * 布尔型和日期校验需要自定义,为了兼容oracle和mysql数据库
22
22
  * @param fieldRule
23
23
  */
24
- export declare function packageBooleanRule(fieldRule: any): void;
24
+ export declare function packageCustomValidator(fieldRule: any): void;
@@ -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) {
@@ -346,7 +326,7 @@ function packageCustomRules(orgCustomRules, orgRules) {
346
326
  }
347
327
  });
348
328
  } else {
349
- packageBooleanRule(customRules[key]);
329
+ packageCustomValidator(customRules[key]);
350
330
  orgRules[key] = customRules[key];
351
331
  }
352
332
  });
@@ -548,8 +528,8 @@ function updateComponentDisplayState(ref, item) {
548
528
  }
549
529
  }
550
530
  }
551
- function packageBooleanRule(fieldRule) {
552
- if (fieldRule.type && fieldRule.type === "boolean") {
531
+ function packageCustomValidator(fieldRule) {
532
+ if (fieldRule && fieldRule.type && fieldRule.type === "boolean") {
553
533
  fieldRule.validator = function(rule, value, callback) {
554
534
  if (value === void 0 || value === null) {
555
535
  if (rule.required) {
@@ -564,6 +544,19 @@ function packageBooleanRule(fieldRule) {
564
544
  }
565
545
  return false;
566
546
  };
547
+ } else if (fieldRule && fieldRule.type && fieldRule.type === "date") {
548
+ fieldRule.validator = function(rule, value, callback) {
549
+ if (value === void 0 || value === null) {
550
+ if (rule.required) {
551
+ return false;
552
+ } else {
553
+ return true;
554
+ }
555
+ } else {
556
+ const date = new Date(value);
557
+ return !isNaN(date.getTime());
558
+ }
559
+ };
567
560
  }
568
561
  }
569
562
  export {
@@ -572,8 +565,8 @@ export {
572
565
  getWorkflowRules,
573
566
  i18nValidatePropRulesMessage,
574
567
  i18nValidateRulesMessage,
575
- packageBooleanRule,
576
568
  packageCustomRules,
569
+ packageCustomValidator,
577
570
  setObjectPropRule,
578
571
  updateComponentDisplayState,
579
572
  updateFormItemEditState,
@@ -3,6 +3,7 @@ import dayjs from "dayjs";
3
3
  import { executeExpression } from "agilebuilder-ui/src/utils/calculator/calculator-util";
4
4
  import { getComponentRef } from "./global-refs.js";
5
5
  import { watch } from "vue";
6
+ import { deepCopy } from "./common-util.js";
6
7
  function getComponentOptionConfigs(component, pageContext2) {
7
8
  if (!component.props || !component.props.dataOrigin) {
8
9
  return;
@@ -80,8 +81,7 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
80
81
  }
81
82
  }
82
83
  }
83
- if (f.propValue)
84
- ;
84
+ if (f.propValue) ;
85
85
  searchForm.push(tempObj);
86
86
  }
87
87
  infoObj.props.searchForm = searchForm;
@@ -136,6 +136,24 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
136
136
  reject(new Error("无需查询的统计图配置!"));
137
137
  return;
138
138
  }
139
+ const dataSourceConfsCopy = deepCopy(dataSourceConfs);
140
+ dataSourceConfsCopy.forEach((item) => {
141
+ var _a;
142
+ const configureUuid = item.uuid;
143
+ const componentRef = getComponentRef(pageContext2, configureUuid);
144
+ if (componentRef) {
145
+ const configure = componentRef.getConfigure();
146
+ const serviceInputs = (_a = configure == null ? void 0 : configure.props.dataOrigin) == null ? void 0 : _a.serviceInputs;
147
+ if (serviceInputs) {
148
+ serviceInputs.forEach((inParam) => {
149
+ const paramName = inParam.name;
150
+ const paramValue = inParam.value;
151
+ item.serviceInParams = {};
152
+ item.serviceInParams[paramName] = getValueFromVariable(pageContext2.entity, paramValue);
153
+ });
154
+ }
155
+ }
156
+ });
139
157
  const entityData2 = pageContext2.entity ? pageContext2.entity : {};
140
158
  const additionalParamMap = {};
141
159
  if (entityData2.request) {
@@ -155,7 +173,7 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
155
173
  entityMap: entityData2.data,
156
174
  additionalParamMap,
157
175
  taskMap,
158
- dataSourceList: dataSourceConfs,
176
+ dataSourceList: dataSourceConfsCopy,
159
177
  systemCode: pageContext2.systemCode,
160
178
  pageCode: pageContext2.code
161
179
  };
@@ -5,7 +5,7 @@ import { setVariableValue, formatVariableValue, getFormPropName } from "./page-h
5
5
  import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
6
6
  import { functions } from "./api/page-expose-util.js";
7
7
  import { isWorkflowPage, deepCopy } from "./common-util.js";
8
- import { packageBooleanRule } from "./events/validator-util.js";
8
+ import { packageCustomValidator } from "./events/validator-util.js";
9
9
  function queryPageDesignByCode(pageCode) {
10
10
  return http.get(
11
11
  window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
@@ -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) {
@@ -319,7 +318,7 @@ function packageFormRules(pageContext, configure) {
319
318
  pageContext.rules[propName] = [];
320
319
  }
321
320
  configure.props.rules.forEach((fieldRule) => {
322
- packageBooleanRule(fieldRule);
321
+ packageCustomValidator(fieldRule);
323
322
  });
324
323
  pageContext.rules[propName] = configure.props.rules;
325
324
  }
@@ -75,5 +75,5 @@ export declare function getIndexColumn(): {
75
75
  tittleClass: string;
76
76
  };
77
77
  };
78
- export declare function computeFormula(itemConfs: any, datas: any): void;
78
+ export declare function computeFormula(itemConfs: any, datas: any, entity: any): void;
79
79
  export {};
@@ -478,7 +478,7 @@ function getIndexColumn() {
478
478
  }
479
479
  };
480
480
  }
481
- function computeFormula(itemConfs, datas) {
481
+ function computeFormula(itemConfs, datas, entity) {
482
482
  Object.keys(itemConfs).forEach((key) => {
483
483
  const paramNames = getParamNames(itemConfs[key]);
484
484
  datas.forEach((data, index) => {
@@ -505,8 +505,8 @@ function computeFormula(itemConfs, datas) {
505
505
  currentRowValue = 0;
506
506
  }
507
507
  totalValueMap[paramName] = currentRowValue;
508
- } else if (paramName.startsWith("${row.")) {
509
- totalValueMap[paramName] = data[getFieldName(paramName)];
508
+ } else if (paramName.startsWith("${page.") || paramName.startsWith("${data.") || paramName.startsWith("${row.") || paramName.startsWith("${request.") || paramName.startsWith("${context.") || paramName.startsWith("${system.") || paramName.startsWith("${fixed.")) {
509
+ totalValueMap[paramName] = getValueFromVariable(entity, paramName, data);
510
510
  }
511
511
  }
512
512
  let expr = itemConfs[key];
@@ -5,6 +5,8 @@ import "agilebuilder-ui/src/utils/request";
5
5
  import "dayjs";
6
6
  import "agilebuilder-ui/src/utils/calculator/calculator-util";
7
7
  import "../../../../utils/global-refs.js";
8
+ import "agilebuilder-ui/src/utils/common-util";
9
+ import "agilebuilder-ui/src/utils/util";
8
10
  import { expressJump } from "../../../../utils/table-utils.js";
9
11
  const _hoisted_1 = { key: 0 };
10
12
  const _hoisted_2 = { key: 1 };
@@ -181,7 +181,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
181
181
  }
182
182
  }
183
183
  if (Object.keys(dataFormulaMapping.value).length > 0 && tmpTableData2 && tmpTableData2.length > 0) {
184
- computeFormula(dataFormulaMapping.value, tmpTableData2);
184
+ computeFormula(dataFormulaMapping.value, tmpTableData2, props.pageContext.entity);
185
185
  }
186
186
  if ((_a2 = props.configure.pageination) == null ? void 0 : _a2.enable) {
187
187
  tableDataPageination(resultData);
@@ -248,8 +248,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
248
248
  }
249
249
  }
250
250
  } else {
251
- if (highOrder && highOrder.mergeColumn)
252
- ;
251
+ if (highOrder && highOrder.mergeColumn) ;
253
252
  if (highOrder && highOrder.mergeRow && highOrder.mergeRow.includes(property)) {
254
253
  if (rowIndex === 0) {
255
254
  return {
@@ -4,6 +4,8 @@ import "agilebuilder-ui/src/utils/request";
4
4
  import "dayjs";
5
5
  import "agilebuilder-ui/src/utils/calculator/calculator-util";
6
6
  import "../../../../utils/global-refs.js";
7
+ import "agilebuilder-ui/src/utils/common-util";
8
+ import "agilebuilder-ui/src/utils/util";
7
9
  import _sfc_main$1 from "./sub-table-runtime.vue.js";
8
10
  import _sfc_main$2 from "./main-table-runtime.vue.js";
9
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -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) {
@@ -7,6 +7,8 @@ import "agilebuilder-ui/src/utils/request";
7
7
  import "dayjs";
8
8
  import "agilebuilder-ui/src/utils/calculator/calculator-util";
9
9
  import "../../../../utils/global-refs.js";
10
+ import "agilebuilder-ui/src/utils/common-util";
11
+ import "agilebuilder-ui/src/utils/util";
10
12
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
13
  __name: "depttree-runtime",
12
14
  props: {
@@ -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.77",
3
+ "version": "2.1.80",
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.0.93",
51
+ "agilebuilder-ui": "1.0.94",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",