super-page-runtime 2.0.75 → 2.0.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 (24) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +10 -0
  2. package/dist/es/components/runtime/utils/api/api-util.d.ts +2 -2
  3. package/dist/es/components/runtime/utils/api/api-util.js +18 -14
  4. package/dist/es/components/runtime/utils/api/page-expose-util.js +136 -66
  5. package/dist/es/components/runtime/utils/events/event-util.js +43 -2
  6. package/dist/es/components/runtime/utils/events/standard-event.js +83 -41
  7. package/dist/es/components/runtime/utils/events/validator-util.d.ts +1 -0
  8. package/dist/es/components/runtime/utils/events/validator-util.js +36 -29
  9. package/dist/es/components/runtime/utils/global-refs.d.ts +6 -0
  10. package/dist/es/components/runtime/utils/global-refs.js +11 -0
  11. package/dist/es/components/runtime/utils/page-init-util.d.ts +3 -1
  12. package/dist/es/components/runtime/utils/page-init-util.js +84 -27
  13. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +9 -2
  14. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +2 -1
  15. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +4 -2
  16. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +5 -17
  17. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -1
  18. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +3 -2
  19. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
  20. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +11 -5
  21. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +2 -2
  22. package/dist/es/components/runtime/views/super-page.vue.js +11 -4
  23. package/dist/es/style.css +3 -0
  24. package/package.json +2 -2
@@ -74,9 +74,9 @@ const standardEvents = {
74
74
  back: function(params) {
75
75
  console.log("表单标准事件返回back--params=", params);
76
76
  const pageContext = params.pageContext;
77
- const dataModel = pageContext.entity ? pageContext.entity.data : {};
77
+ const dataModel2 = pageContext.entity ? pageContext.entity.data : {};
78
78
  const isNeedValueMapping = params.configureObj.props && params.configureObj.props.base ? params.configureObj.props.base.isNeedValueMapping : false;
79
- closeDialog(pageContext, dataModel, isNeedValueMapping);
79
+ closeDialog(pageContext, dataModel2, isNeedValueMapping);
80
80
  },
81
81
  // 列表标准事件删除delete
82
82
  delete: function(params) {
@@ -243,10 +243,11 @@ const standardEvents = {
243
243
  }
244
244
  };
245
245
  function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
246
+ var _a;
246
247
  const templateUUID = templateFile.templateUuid;
247
248
  const fileName = templateFile.templateName;
248
249
  const systemCode = pageContext.systemCode;
249
- const logSetting = configureObj.props.logSetting;
250
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
250
251
  const isWorkflowForm = pageContext.workflowCode ? true : false;
251
252
  const beanName = pageContext.beanName;
252
253
  const button = configureObj.props.base;
@@ -273,7 +274,7 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
273
274
  pageVersion: pageContext.version
274
275
  };
275
276
  if (logSetting) {
276
- param["logSettingText"] = logSetting;
277
+ param["logSettingText"] = logSetting.join("");
277
278
  }
278
279
  const additionalParamMap = getAdditionalParamMap(pageContext);
279
280
  param["additionalParamMap"] = additionalParamMap;
@@ -387,6 +388,7 @@ function saveFunc(params, isListButton) {
387
388
  });
388
389
  }
389
390
  function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids2, row) {
391
+ var _a;
390
392
  const isWorkflow = pageContext.workflowCode ? true : false;
391
393
  const systemCode = pageContext.systemCode;
392
394
  const isPermission = configureObj.props.base.isPermission === void 0 || configureObj.props.base.isPermission === "true" || configureObj.props.base.isPermission;
@@ -424,9 +426,18 @@ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion
424
426
  param["dataConversionRule"] = conversionCodes;
425
427
  }
426
428
  }
427
- const logSetting = configureObj.props.logSetting;
429
+ console.log("getCommonFormRequestParam--------configureObj----", configureObj);
430
+ const autoSetValueData = configureObj.props.setValueList;
431
+ if (autoSetValueData) {
432
+ if (isArrayFn(autoSetValueData)) {
433
+ param["autoSetValueData"] = JSON.stringify(autoSetValueData);
434
+ } else if (typeof autoSetValueData === "string") {
435
+ param["autoSetValueData"] = autoSetValueData;
436
+ }
437
+ }
438
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
428
439
  if (logSetting) {
429
- param["logSettingText"] = logSetting;
440
+ param["logSettingText"] = logSetting.join("");
430
441
  }
431
442
  if (!param["systemCode"]) {
432
443
  param["systemCode"] = systemCode;
@@ -465,7 +476,14 @@ function getSaveFormRequestWithRow(pageContext, configureObj, url, isUnControlVe
465
476
  param.tableName = otherParams.tableName;
466
477
  }
467
478
  }
468
- return getSaveFormRequestByParam(systemCode, backendUrl, param, url, pageContext.entity.data, pageContext.isTest);
479
+ return getSaveFormRequestByParam(
480
+ systemCode,
481
+ backendUrl,
482
+ param,
483
+ url,
484
+ pageContext.entity.data,
485
+ pageContext.isTest
486
+ );
469
487
  }
470
488
  function getSaveFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo) {
471
489
  return getSaveFormRequestWithRow(
@@ -495,8 +513,11 @@ function dealAfterOperate(pageContext, configureObj, data, successTip, isListBut
495
513
  const buttonForPageType = getPageType(pageContext, configureObj, isListButton);
496
514
  if (buttonForPageType && buttonForPageType === "list") {
497
515
  dealAfterWithList(pageContext, configureObj, data, successTip);
516
+ pageContext.canClick = true;
498
517
  } else if (buttonForPageType && buttonForPageType === "form") {
499
518
  dealAfterWithForm(pageContext, configureObj, data, successTip);
519
+ } else {
520
+ pageContext.canClick = true;
500
521
  }
501
522
  }
502
523
  function getPageType(pageContext, configureObj, isListButton) {
@@ -514,15 +535,17 @@ function getPageType(pageContext, configureObj, isListButton) {
514
535
  function dealAfterWithForm(pageContext, configureObj, data, successTip) {
515
536
  if (data) {
516
537
  const commonEntity = data;
517
- let dataModel;
538
+ let dataModel2;
518
539
  if (commonEntity.entity) {
519
- dataModel = commonEntity.entity;
540
+ dataModel2 = commonEntity.entity;
520
541
  }
521
542
  if (commonEntity.formNo) {
522
543
  pageContext.initFormNo = commonEntity.formNo;
523
544
  }
524
- const totalModel = { ...dataModel, ...pageContext.entity.page };
545
+ const totalModel = { ...dataModel2, ...pageContext.entity.page };
525
546
  afterSuccessOperateInForm(pageContext, configureObj, totalModel);
547
+ } else {
548
+ pageContext.canClick = true;
526
549
  }
527
550
  if (successTip) {
528
551
  ElMessage({
@@ -532,26 +555,30 @@ function dealAfterWithForm(pageContext, configureObj, data, successTip) {
532
555
  });
533
556
  }
534
557
  }
535
- function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
558
+ function afterSuccessOperateInForm(pageContext, configureObj, dataModel2) {
536
559
  const successOperation = configureObj.props.base.successOperation;
537
560
  if (!successOperation || successOperation === null) {
538
561
  return;
539
562
  }
540
563
  const isNeedValueMapping = configureObj.props.base.isNeedValueMapping;
541
564
  if (successOperation === "noOperation") {
542
- if (dataModel) {
543
- pageContext.entity.data = dataModel;
565
+ if (dataModel2) {
566
+ pageContext.entity.data = dataModel2;
544
567
  }
568
+ pageContext.canClick = true;
545
569
  } else if (successOperation === "refresh") {
546
- if (dataModel && (dataModel.id || dataModel.ID)) {
547
- refreshPage(pageContext);
570
+ if (dataModel2 && (dataModel2.id || dataModel2.ID)) {
571
+ refreshPage(pageContext, dataModel2.ID ? dataModel2.ID : dataModel2.id);
572
+ } else {
573
+ pageContext.canClick = true;
548
574
  }
549
575
  } else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
550
- closeDialog(pageContext, dataModel, isNeedValueMapping);
576
+ closeDialog(pageContext, dataModel2, isNeedValueMapping);
577
+ pageContext.canClick = true;
551
578
  console.log("afterSuccessOperateInForm--successOperation=--", successOperation);
552
579
  }
553
580
  }
554
- function closeDialog(pageContext, dataModel, isNeedValueMapping) {
581
+ function closeDialog(pageContext, dataModel2, isNeedValueMapping) {
555
582
  const jumpMode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.jumpMode : null;
556
583
  if (jumpMode === "openWindow" || jumpMode === "newTab") {
557
584
  if (window.parent) {
@@ -561,12 +588,12 @@ function closeDialog(pageContext, dataModel, isNeedValueMapping) {
561
588
  }
562
589
  } else {
563
590
  const sourceTableName = pageContext.tableName;
564
- const isNeedValueMappingFinal = isNeedValueMapping !== void 0 && isNeedValueMapping === true && dataModel && dataModel !== void 0;
591
+ const isNeedValueMappingFinal = isNeedValueMapping !== void 0 && isNeedValueMapping === true && dataModel2 && dataModel2 !== void 0;
565
592
  const parentPageCode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.parentPageCode : null;
566
593
  const eventPageInfo = parentPageCode + "_";
567
594
  eventBus.$emit(eventPageInfo + "close-dialog", {
568
595
  isNeedValueMapping: isNeedValueMappingFinal,
569
- dataModel,
596
+ dataModel: dataModel2,
570
597
  sourceTableName,
571
598
  jumpMode
572
599
  });
@@ -599,7 +626,7 @@ function updateWithPageValue(sourceModel, valueMappings, parentPageContext) {
599
626
  const sourceFields = sourceField.split(".");
600
627
  const targetValue = getVariableValue(sourceEntity, sourceFields);
601
628
  const targetField = valueMapping.target;
602
- const targetFields = getModelFields(parentPageContext, null, targetField);
629
+ const targetFields = getModelFields(null, targetField);
603
630
  setVariableValue(parentPageContext.entity, targetFields, targetValue);
604
631
  });
605
632
  }
@@ -648,7 +675,7 @@ function refreshFormOrListPage(pageContext, configureObj) {
648
675
  console.error("tableUuid is empty");
649
676
  }
650
677
  } else if (buttonForPageType && buttonForPageType === "form") {
651
- refreshPage(pageContext);
678
+ refreshPage(pageContext, dataModel.ID ? dataModel.ID : dataModel.id);
652
679
  }
653
680
  }
654
681
  }
@@ -749,12 +776,13 @@ function deleteFunc(params) {
749
776
  type: "warning"
750
777
  }
751
778
  ).then(() => {
779
+ var _a;
752
780
  const pageContext = params.pageContext;
753
781
  const configureObj = params.configureObj;
754
782
  const configureBase = configureObj.props.base;
755
783
  const systemCode = pageContext.systemCode;
756
784
  const backendUrl = pageContext.backendUrl;
757
- let tableUuid = configureObj.props.base.tableUuid;
785
+ const tableUuid = configureObj.props.base.tableUuid;
758
786
  const tableName = getTableNameByTableUuid(pageContext, tableUuid);
759
787
  const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
760
788
  let path = baseUrl + "/dsc/commons/" + tableName;
@@ -783,9 +811,9 @@ function deleteFunc(params) {
783
811
  param["deleteLogicSetting"] = deleteLogicSetting;
784
812
  }
785
813
  }
786
- const logSetting = configureObj.props.logSetting;
814
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
787
815
  if (logSetting) {
788
- param["logSettingText"] = logSetting;
816
+ param["logSettingText"] = logSetting.join("");
789
817
  }
790
818
  const isSafeDelete = configureObj.props.base.isSafeDelete;
791
819
  if (isSafeDelete) {
@@ -816,6 +844,7 @@ function deleteFunc(params) {
816
844
  });
817
845
  }
818
846
  function downloadTemplateFunc(params) {
847
+ var _a;
819
848
  const pageContext = params.pageContext;
820
849
  const configureObj = params.configureObj;
821
850
  const configureBase = configureObj.props.base;
@@ -834,10 +863,12 @@ function downloadTemplateFunc(params) {
834
863
  param += "&fileName=" + encodeURI(templateUUID) + "&showName=" + encodeURI(showName);
835
864
  } else if (showName) {
836
865
  param += "&showName=" + encodeURI(showName);
866
+ } else if (pageContext.label) {
867
+ param += "&showName=" + encodeURI(pageContext.label) + ".xlsx";
837
868
  }
838
- const logSetting = configureObj.props.logSetting;
839
- if (logSetting && logSetting !== "") {
840
- param += "&logSettingText=" + logSetting;
869
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
870
+ if (logSetting) {
871
+ param += "&logSettingText=" + logSetting.join("");
841
872
  }
842
873
  if (systemCode) {
843
874
  param += "&systemCode=" + systemCode;
@@ -866,7 +897,7 @@ function downloadTemplateFunc(params) {
866
897
  if (token) {
867
898
  param += "&JWT=" + token;
868
899
  }
869
- let runCurrentRoleKey = "_RUN_CURRENT_ROLE";
900
+ const runCurrentRoleKey = "_RUN_CURRENT_ROLE";
870
901
  const currentRole = getSessionCache(runCurrentRoleKey);
871
902
  if (currentRole) {
872
903
  param += "&" + runCurrentRoleKey + "=" + currentRole;
@@ -1022,7 +1053,8 @@ function exportFunc(params) {
1022
1053
  const functionCodes = getPermissionCodes(params.configureObj, pageContext);
1023
1054
  const exportFileName = pageName;
1024
1055
  const exportOptions = {
1025
- backendUrl: pageContext.backendUrl
1056
+ backendUrl: pageContext.backendUrl,
1057
+ pageContext
1026
1058
  };
1027
1059
  console.log("exportFunc======exportOptions=", exportOptions);
1028
1060
  window["$vueApp"].config.globalProperties.$exportDataNew(
@@ -1039,21 +1071,22 @@ function exportFunc(params) {
1039
1071
  });
1040
1072
  }
1041
1073
  function getWorkflowSaveParams(params) {
1074
+ var _a;
1042
1075
  const pageContext = params.pageContext;
1043
1076
  const configureObj = params.configureObj;
1044
- const dataModel = pageContext.entity.data;
1077
+ const dataModel2 = pageContext.entity.data;
1045
1078
  const systemCode = pageContext.systemCode;
1046
1079
  const permissionPrefix = pageContext.code;
1047
1080
  let functionCodes = getPermissionCodes(configureObj, pageContext);
1048
1081
  if (!functionCodes) {
1049
1082
  functionCodes = permissionPrefix + ".xxx";
1050
1083
  }
1051
- if (!dataModel.id && !dataModel.ID) {
1052
- dataModel["page_code"] = pageContext.code;
1053
- dataModel["page_version"] = pageContext.version;
1084
+ if (!dataModel2.id && !dataModel2.ID) {
1085
+ dataModel2["page_code"] = pageContext.code;
1086
+ dataModel2["page_version"] = pageContext.version;
1054
1087
  }
1055
1088
  const param = {
1056
- entity: dataModel,
1089
+ entity: dataModel2,
1057
1090
  pageMoel: pageContext.entity.page,
1058
1091
  formNoRuleCode: pageContext.formNoRuleCode,
1059
1092
  tableName: pageContext.tableName,
@@ -1086,12 +1119,21 @@ function getWorkflowSaveParams(params) {
1086
1119
  param["dataConversionRule"] = conversionCodes;
1087
1120
  }
1088
1121
  }
1122
+ console.log("getWorkflowSaveParams----configureObj=", configureObj);
1123
+ const autoSetValueData = configureObj.props.setValueList;
1124
+ if (autoSetValueData) {
1125
+ if (isArrayFn(autoSetValueData)) {
1126
+ param["autoSetValueData"] = JSON.stringify(autoSetValueData);
1127
+ } else if (typeof autoSetValueData === "string") {
1128
+ param["autoSetValueData"] = autoSetValueData;
1129
+ }
1130
+ }
1089
1131
  if (pageContext.beanName) {
1090
1132
  param["beanName"] = pageContext.beanName;
1091
1133
  }
1092
- const logSetting = configureObj.props.logSetting;
1134
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
1093
1135
  if (logSetting) {
1094
- param["logSettingText"] = logSetting;
1136
+ param["logSettingText"] = logSetting.join("");
1095
1137
  }
1096
1138
  if (!param.systemCode) {
1097
1139
  param.systemCode = systemCode;
@@ -1119,7 +1161,7 @@ function getWorkflowSaveParams(params) {
1119
1161
  function workflowSaveFunc(params) {
1120
1162
  return new Promise((resolve, reject) => {
1121
1163
  const pageContext = params.pageContext;
1122
- const dataModel = pageContext.entity.data;
1164
+ const dataModel2 = pageContext.entity.data;
1123
1165
  const systemCode = pageContext.systemCode;
1124
1166
  const backendUrl = pageContext.backendUrl;
1125
1167
  let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons";
@@ -1134,7 +1176,7 @@ function workflowSaveFunc(params) {
1134
1176
  }
1135
1177
  const param = getWorkflowSaveParams(params);
1136
1178
  let request;
1137
- if (dataModel.id || dataModel.ID) {
1179
+ if (dataModel2.id || dataModel2.ID) {
1138
1180
  request = http.put(path, param);
1139
1181
  } else {
1140
1182
  request = http.post(path, param);
@@ -1311,15 +1353,15 @@ function doAssign(params, selectNodeInfo) {
1311
1353
  }
1312
1354
  function getTransactTaskParam(params) {
1313
1355
  const pageContext = params.pageContext;
1314
- const dataModel = pageContext.entity.data;
1356
+ const dataModel2 = pageContext.entity.data;
1315
1357
  const systemCode = pageContext.systemCode;
1316
1358
  const permissionPrefix = pageContext.code;
1317
1359
  const additionalParamMap = getAdditionalParamMap(pageContext);
1318
- const dataId = dataModel.ID !== void 0 && dataModel.ID !== null ? dataModel.ID : dataModel.id;
1360
+ const dataId = dataModel2.ID !== void 0 && dataModel2.ID !== null ? dataModel2.ID : dataModel2.id;
1319
1361
  const requestParams = {
1320
1362
  beanName: pageContext.beanName,
1321
1363
  id: dataId,
1322
- entity: dataModel,
1364
+ entity: dataModel2,
1323
1365
  additionalParamMap,
1324
1366
  tableName: pageContext.tableName,
1325
1367
  functionCode: permissionPrefix + ".xxx",
@@ -9,4 +9,5 @@ export declare function validateDataModelFunc(pageContext: any, configureObj: an
9
9
  */
10
10
  export declare function packageCustomRules(orgCustomRules: any, orgRules: any): any;
11
11
  export declare function i18nValidateRulesMessage(rules: any): {};
12
+ export declare function i18nValidatePropRulesMessage(propRules: any, isResetMessage: boolean): void;
12
13
  export declare function getWorkflowRules(pageContext: any): any;
@@ -360,35 +360,7 @@ function i18nValidateRulesMessage(rules) {
360
360
  for (let i = 0; i < propNames.length; i++) {
361
361
  const propName = propNames[i];
362
362
  const propRules = rules[propName];
363
- propRules.forEach((rule) => {
364
- const label = rule["label"];
365
- const i18nLabel = getI18n().t(label);
366
- if (rule["required"]) {
367
- rule["message"] = getI18n().t("superPageRuntimeMessage.required", { label: i18nLabel });
368
- }
369
- if (rule["myType"]) {
370
- rule["message"] = getI18n().t("superPageRuntimeMessage.formatMismatch", {
371
- label: i18nLabel
372
- });
373
- }
374
- if (rule["patternType"]) {
375
- rule["message"] = getI18n().t("superPageRuntimeMessage.formatMismatch", {
376
- label: i18nLabel
377
- });
378
- }
379
- if (rule["max"] !== void 0 && rule["max"] !== null) {
380
- rule["message"] = getI18n().t("superPageRuntimeMessage.overMaxLength", {
381
- label: i18nLabel,
382
- value: rule["max"]
383
- });
384
- }
385
- if (rule["min"] !== void 0 && rule["min"] !== null) {
386
- rule["message"] = getI18n().t("superPageRuntimeMessage.limitMinLength", {
387
- label: i18nLabel,
388
- value: rule["min"]
389
- });
390
- }
391
- });
363
+ i18nValidatePropRulesMessage(propRules, true);
392
364
  if (propName.indexOf(".") > 0) {
393
365
  setObjectPropRule(propName, newRules, propRules);
394
366
  } else {
@@ -399,6 +371,40 @@ function i18nValidateRulesMessage(rules) {
399
371
  }
400
372
  return newRules;
401
373
  }
374
+ function i18nValidatePropRulesMessage(propRules, isResetMessage) {
375
+ propRules.forEach((rule) => {
376
+ if (rule.message && !isResetMessage) {
377
+ return;
378
+ }
379
+ const label = rule["label"];
380
+ const i18nLabel = getI18n().t(label);
381
+ if (rule["required"]) {
382
+ rule["message"] = getI18n().t("superPageRuntimeMessage.required", { label: i18nLabel });
383
+ }
384
+ if (rule["myType"]) {
385
+ rule["message"] = getI18n().t("superPageRuntimeMessage.formatMismatch", {
386
+ label: i18nLabel
387
+ });
388
+ }
389
+ if (rule["patternType"]) {
390
+ rule["message"] = getI18n().t("superPageRuntimeMessage.formatMismatch", {
391
+ label: i18nLabel
392
+ });
393
+ }
394
+ if (rule["max"] !== void 0 && rule["max"] !== null) {
395
+ rule["message"] = getI18n().t("superPageRuntimeMessage.overMaxLength", {
396
+ label: i18nLabel,
397
+ value: rule["max"]
398
+ });
399
+ }
400
+ if (rule["min"] !== void 0 && rule["min"] !== null) {
401
+ rule["message"] = getI18n().t("superPageRuntimeMessage.limitMinLength", {
402
+ label: i18nLabel,
403
+ value: rule["min"]
404
+ });
405
+ }
406
+ });
407
+ }
402
408
  function getWorkflowRules(pageContext) {
403
409
  const dataModel = pageContext.entity.data;
404
410
  const pageModel = pageContext.entity.page;
@@ -463,6 +469,7 @@ function validateCustomRuleEvents(pageContext) {
463
469
  }
464
470
  export {
465
471
  getWorkflowRules,
472
+ i18nValidatePropRulesMessage,
466
473
  i18nValidateRulesMessage,
467
474
  packageCustomRules,
468
475
  setObjectPropRule,
@@ -57,3 +57,9 @@ export declare function removePageAllRef(pageContext: PageContext): void;
57
57
  * @param pageVersion
58
58
  */
59
59
  export declare function initComponentRefState(pageContext: PageContext): void;
60
+ /**
61
+ * 获取所有组件引用对象
62
+ * @param pageDesign 页面设计对象
63
+ * @returns
64
+ */
65
+ export declare function getAllComponentRefs(pageContext: PageContext): any;
@@ -67,9 +67,20 @@ function getPageRefKey(pageCode, pageVersion) {
67
67
  function getPageRefKeyByCode(pageCode, pageVersion) {
68
68
  return getPageRefKey(pageCode, pageVersion) + "-code";
69
69
  }
70
+ function getAllComponentRefs(pageContext) {
71
+ if (!pageContext) {
72
+ return;
73
+ }
74
+ const cacheKey = getPageRefKeyByCode(pageContext.code, pageContext.version);
75
+ if (!globalRefs[cacheKey]) {
76
+ globalRefs[cacheKey] = {};
77
+ }
78
+ return globalRefs[cacheKey];
79
+ }
70
80
  export {
71
81
  addComponentRef,
72
82
  addComponentRefByCode,
83
+ getAllComponentRefs,
73
84
  getComponentRef,
74
85
  getComponentRefByCode,
75
86
  initComponentRefState,
@@ -17,7 +17,8 @@ export declare function queryPageDesignByCode(pageCode: string): Promise<any>;
17
17
  * @param pageDesign 页面设计对象
18
18
  */
19
19
  export declare function convertToPageContext(pageDesign: PageDesign, pageRequest: object): PageContext | null;
20
- export declare function getModelFields(pageContext: PageContext, formItemConfigure: Component, prop?: string): string[];
20
+ export declare function packageAdditionalMapWithRoute(route: any, requestObj: any): void;
21
+ export declare function getModelFields(formItemConfigure: any, prop?: string): string[];
21
22
  /**
22
23
  * 获取表单元素模型名称
23
24
  * @param pageContext 页面对象
@@ -39,3 +40,4 @@ export declare function getPermissionCodes(configure: Component, pageContext: Pa
39
40
  */
40
41
  export declare function queryPageSuperGrids(pageDesign: any, pageContext: any, publishVersion: any): Promise<any>;
41
42
  export declare function packageFormRules(pageContext: PageContext, configure: any): void;
43
+ export declare function controlObjectRenderState(pageContext: PageContext, propName: string): void;
@@ -1,9 +1,11 @@
1
1
  import http from "agilebuilder-ui/src/utils/request";
2
- import { useRoute } from "vue-router";
2
+ import "vue-router";
3
3
  import { getAdditionalParamMap } from "./events/standard-event.js";
4
4
  import { PageDimensions } from "./interfaces/page-design-types.js";
5
- import { formatVariableValue, getFormPropName, setVariableValue } from "./page-helper-util.js";
5
+ import { setVariableValue, formatVariableValue, getFormPropName } from "./page-helper-util.js";
6
6
  import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
7
+ import { functions } from "./api/page-expose-util.js";
8
+ import { deepCopy } from "./common-util.js";
7
9
  function queryPageDesignByCode(pageCode) {
8
10
  return http.get(
9
11
  window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
@@ -29,20 +31,17 @@ function convertToPageContext(pageDesign, pageRequest) {
29
31
  // 表格uuid集合
30
32
  listCodes: pageDesign.listCodes,
31
33
  // 当前页面中表格对应的数据表名集合,后台保存子表记录时需要
32
- formNoRuleCode: pageDesign.formNoRuleCode,
34
+ formNoRuleCode: pageDesign.props ? pageDesign.props.formNoRuleCode : null,
33
35
  // 表单编号规则
34
- judgeHeavyList: pageDesign.judgeHeavyList,
36
+ judgeHeavyList: pageDesign.props && pageDesign.props.judgeHeavyList.length > 0 ? pageDesign.props.judgeHeavyList : null,
35
37
  // 判重组合字段集合配置
36
- conversionCodes: pageDesign.conversionCodes,
37
- // 数据转换规则
38
+ // conversionCodes: pageDesign.conversionCodes, // 数据转换规则。按钮上配置的,此处不需要
38
39
  pageType: pageDesign.pageType,
39
40
  // 页面类型:form、list、chart
40
- beanName: pageDesign.beanName,
41
+ beanName: pageDesign.props ? pageDesign.props.beanName : null,
41
42
  // 业务处理类,继承CommonBaseService接口的类
42
- importBeanName: pageDesign.importBeanName,
43
+ importBeanName: pageDesign.props ? pageDesign.props.importBeanName : null,
43
44
  // 导入处理类,继承ImportDefinitionService接口的类
44
- notIdInitializationList: pageDesign.notIdInitializationList,
45
- // 无ID或taskId时初始条件配置
46
45
  subTablePageInfo: pageDesign.subTablePageInfo,
47
46
  // 列表分页信息,格式是:{列表编码: 每页显示多少条记录},表单页面中校验有分页的子表时提示使用,提示信息格式:第 {pageNum} 页第 {row} 行记录
48
47
  workflowCode: pageDesign.workflowCode,
@@ -57,6 +56,15 @@ function convertToPageContext(pageDesign, pageRequest) {
57
56
  system: {}
58
57
  }
59
58
  };
59
+ if (pageDesign.props && pageDesign.props.notIdInitializationList) {
60
+ let notIdInitializationList = pageDesign.props.notIdInitializationList;
61
+ if (typeof notIdInitializationList === "string") {
62
+ notIdInitializationList = JSON.parse(notIdInitializationList);
63
+ }
64
+ if (notIdInitializationList.length > 0) {
65
+ pageContext["notIdInitializationList"] = notIdInitializationList;
66
+ }
67
+ }
60
68
  if (pageDesign.variables) {
61
69
  const pageObj = pageContext.entity.page;
62
70
  for (const variable of pageDesign.variables) {
@@ -90,7 +98,12 @@ function getPageDimensions() {
90
98
  function getRequestObject(pageRequest) {
91
99
  const requestObj = {};
92
100
  if (pageRequest) {
101
+ console.log("getRequestObject11----pageRequest=", pageRequest);
102
+ const paramStoreId = pageRequest.paramStoreId;
103
+ packageAdditionalMap(paramStoreId, requestObj);
104
+ delete pageRequest.paramStoreId;
93
105
  Object.assign(requestObj, pageRequest);
106
+ console.log("getRequestObject22----requestObj=", requestObj);
94
107
  }
95
108
  let url = decodeURI(window.location.href);
96
109
  if (url && url.includes("?")) {
@@ -101,33 +114,39 @@ function getRequestObject(pageRequest) {
101
114
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
102
115
  }
103
116
  }
104
- const route = useRoute();
117
+ if (requestObj["_t_"])
118
+ ;
119
+ return requestObj;
120
+ }
121
+ function packageAdditionalMapWithRoute(route, requestObj) {
122
+ console.log("packageAdditionalMapWithRoute----route=", route);
105
123
  if (route) {
106
124
  if (route.params) {
107
125
  Object.assign(requestObj, route.params);
108
126
  }
127
+ console.log("packageAdditionalMapWithRoute----route.query=", route.query);
109
128
  if (route.query) {
110
129
  Object.assign(requestObj, route.query);
111
130
  const paramStoreId = route.query.paramStoreId;
112
- if (paramStoreId) {
113
- const additionalParamMapJson = getSessionCache(paramStoreId);
114
- if (additionalParamMapJson) {
115
- const additionalParamMap = JSON.parse(additionalParamMapJson);
116
- Object.assign(requestObj, additionalParamMap);
117
- console.log("已获取到附加参数", additionalParamMap);
118
- }
119
- }
131
+ packageAdditionalMap(paramStoreId, requestObj);
132
+ }
133
+ console.log("packageAdditionalMapWithRoute----requestObj=", requestObj);
134
+ }
135
+ }
136
+ function packageAdditionalMap(paramStoreId, requestObj) {
137
+ if (paramStoreId) {
138
+ const additionalParamMapJson = getSessionCache(paramStoreId);
139
+ if (additionalParamMapJson) {
140
+ const additionalParamMap = JSON.parse(additionalParamMapJson);
141
+ Object.assign(requestObj, additionalParamMap);
142
+ console.log("已获取到附加参数", additionalParamMap);
120
143
  }
121
144
  }
122
- if (requestObj["_t_"])
123
- ;
124
- return requestObj;
125
145
  }
126
- function getModelFields(pageContext, formItemConfigure, prop) {
146
+ function getModelFields(formItemConfigure, prop) {
127
147
  if (!formItemConfigure) {
128
148
  return ["temp"];
129
149
  }
130
- pageContext.entity;
131
150
  let propsBase;
132
151
  let propName = prop;
133
152
  if (!prop) {
@@ -154,7 +173,7 @@ function getModelFields(pageContext, formItemConfigure, prop) {
154
173
  return fields;
155
174
  }
156
175
  function getFormModelFields(pageContext, formItemConfigure, prop) {
157
- const fields = getModelFields(pageContext, formItemConfigure, prop);
176
+ const fields = getModelFields(formItemConfigure, prop);
158
177
  const entity = pageContext.entity;
159
178
  if (entity.data.ID == void 0 && entity.data.id == void 0) {
160
179
  let propsBase;
@@ -175,10 +194,8 @@ function getFormModelFields(pageContext, formItemConfigure, prop) {
175
194
  }
176
195
  function getDefaultValue(pageContext, defaultValueSet, componentType, multiple) {
177
196
  let defaultValue;
178
- console.log("pageRuntime11---getDefaultValue---defaultValueSet---", defaultValueSet, "pageContext=", pageContext);
179
197
  if (defaultValueSet) {
180
198
  defaultValue = formatVariableValue(pageContext, defaultValueSet);
181
- console.log("pageRuntime22---getDefaultValue---defaultValue---", defaultValue);
182
199
  if (defaultValue != null && defaultValue != void 0 && componentType) {
183
200
  let isMultiple = false;
184
201
  if (componentType == "checkbox") {
@@ -290,12 +307,52 @@ function packageFormRules(pageContext, configure) {
290
307
  }
291
308
  }
292
309
  }
310
+ function controlObjectRenderState(pageContext, propName) {
311
+ if (pageContext.initInfo) {
312
+ const types = ["dynamicControlFormEdit", "disableElement", "enableElement", "hideElement", "showElement"];
313
+ types.forEach((type) => {
314
+ const infos = pageContext.initInfo[type];
315
+ if (infos) {
316
+ if (type === "dynamicControlFormEdit") {
317
+ let settings = infos.filter((item) => item.name === "_all_fields" || item.name === propName);
318
+ if (settings && settings.length > 0) {
319
+ settings = settings.filter((item) => item.name === "_all_fields");
320
+ if (settings && settings.length > 0) {
321
+ const copySetting = deepCopy(settings[0]);
322
+ copySetting.name = propName;
323
+ settings = [copySetting];
324
+ }
325
+ }
326
+ functions.dynamicControlFormEdit(pageContext, settings, false);
327
+ } else if (type === "disableElement") {
328
+ if (infos.indexOf(propName) >= 0) {
329
+ functions.disableElement(pageContext, [propName], false);
330
+ }
331
+ } else if (type === "enableElement") {
332
+ if (infos.indexOf(propName) >= 0) {
333
+ functions.enableElement(pageContext, [propName], false);
334
+ }
335
+ } else if (type === "hideElement") {
336
+ if (infos.indexOf(propName) >= 0) {
337
+ functions.hideElement(pageContext, [propName], false);
338
+ }
339
+ } else if (type === "showElement") {
340
+ if (infos.indexOf(propName) >= 0) {
341
+ functions.showElement(pageContext, [propName], false);
342
+ }
343
+ }
344
+ }
345
+ });
346
+ }
347
+ }
293
348
  export {
349
+ controlObjectRenderState,
294
350
  convertToPageContext,
295
351
  getDefaultValue,
296
352
  getFormModelFields,
297
353
  getModelFields,
298
354
  getPermissionCodes,
355
+ packageAdditionalMapWithRoute,
299
356
  packageFormRules,
300
357
  queryPageDesignByCode,
301
358
  queryPageSuperGrids