super-page-runtime 2.0.22 → 2.0.27

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 (33) hide show
  1. package/dist/es/components/runtime/utils/api/api-util.js +13 -5
  2. package/dist/es/components/runtime/utils/api/page-expose-util.js +5 -1
  3. package/dist/es/components/runtime/utils/assemblys-config.js +22 -7
  4. package/dist/es/components/runtime/utils/barcode-util.d.ts +8 -0
  5. package/dist/es/components/runtime/utils/barcode-util.js +36 -0
  6. package/dist/es/components/runtime/utils/common-util.js +1 -1
  7. package/dist/es/components/runtime/utils/events/event-util.d.ts +14 -0
  8. package/dist/es/components/runtime/utils/events/event-util.js +95 -32
  9. package/dist/es/components/runtime/utils/events/print-label.d.ts +5 -0
  10. package/dist/es/components/runtime/utils/events/print-label.js +153 -0
  11. package/dist/es/components/runtime/utils/events/standard-event.d.ts +3 -0
  12. package/dist/es/components/runtime/utils/events/standard-event.js +128 -52
  13. package/dist/es/components/runtime/utils/form/scan-util.js +191 -0
  14. package/dist/es/components/runtime/utils/page-helper-util.js +19 -2
  15. package/dist/es/components/runtime/utils/page-init-util.d.ts +1 -1
  16. package/dist/es/components/runtime/utils/page-init-util.js +21 -20
  17. package/dist/es/components/runtime/utils/table-utils.js +1 -10
  18. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +4 -0
  19. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +96 -0
  20. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +1 -1
  21. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +4 -0
  22. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +179 -0
  23. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +95 -62
  24. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +16 -10
  25. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +3 -2
  26. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +25 -1
  27. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +77 -39
  28. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +24 -1
  29. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +21 -3
  30. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +4 -1
  31. package/dist/es/components/runtime/views/super-page-dialog.vue.js +3 -0
  32. package/dist/es/components/runtime/views/super-page.vue.js +59 -38
  33. package/package.json +4 -3
@@ -11,6 +11,9 @@ import { doAfterClickEvent, handleEvent } from "./event-util.js";
11
11
  import { setStoreInfo } from "../store-util.js";
12
12
  import { refreshPage } from "../api/api-util.js";
13
13
  import { updateWithPageValue } from "agilebuilder-ui/src/utils/jump-page-utils";
14
+ import { getPermissionCodes } from "../page-init-util.js";
15
+ import { updateChartDatasources } from "../page-helper-util.js";
16
+ import printLabelUtil from "./print-label.js";
14
17
  const standardEvents = {
15
18
  // 表单标准事件保存save
16
19
  save: function(params) {
@@ -205,6 +208,37 @@ const standardEvents = {
205
208
  lineEditCreate: function(params) {
206
209
  console.log("列表行编辑 新建lineEditCreate--params=", params);
207
210
  return lineEditCreateFunc(params);
211
+ },
212
+ printLabel: function(params) {
213
+ console.log("打印标签 打印标签事件--params=", params);
214
+ return printLabel(params);
215
+ },
216
+ queryCharts: function(params) {
217
+ console.log("查询统计图--params=", params);
218
+ const pageContext = params.pageContext;
219
+ const chartConfigs = pageContext.initChartServiceConfigs;
220
+ if (!chartConfigs || chartConfigs.length == 0) {
221
+ console.log("无需要查询的统计图数据");
222
+ return;
223
+ }
224
+ const configure = params.configureObj;
225
+ let runtimeProps = null;
226
+ if (configure && configure.runtime) {
227
+ runtimeProps = configure.runtime.props;
228
+ }
229
+ const hisState = runtimeProps ? runtimeProps.state : void 0;
230
+ if (runtimeProps) {
231
+ runtimeProps.state = "disabled";
232
+ }
233
+ updateChartDatasources(pageContext, chartConfigs, void 0).then(() => {
234
+ if (runtimeProps) {
235
+ runtimeProps.state = hisState;
236
+ }
237
+ }).catch(() => {
238
+ if (runtimeProps) {
239
+ runtimeProps.state = hisState;
240
+ }
241
+ });
208
242
  }
209
243
  };
210
244
  function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
@@ -219,6 +253,7 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
219
253
  const backendUrl = pageContext.backendUrl;
220
254
  const viewModels = pageContext.entity.data;
221
255
  const isPermission = button.isPermission === void 0 || button.isPermission === "true" || button.isPermission;
256
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
222
257
  const param = {
223
258
  entity: viewModels,
224
259
  fileName: templateUUID,
@@ -228,16 +263,18 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
228
263
  beanName,
229
264
  isWorkflowForm,
230
265
  // 是否是流程表单
231
- functionCode: button.functionCode,
266
+ functionCode: functionCodes,
232
267
  tableName,
233
268
  isPermission: isPermission + "",
234
269
  systemCode,
235
- tableNames: pageContext.tableNames
270
+ tableNames: pageContext.tableNames,
271
+ pageCode: pageContext.code,
272
+ pageVersion: pageContext.version
236
273
  };
237
274
  if (logSetting) {
238
275
  param["logSettingText"] = logSetting;
239
276
  }
240
- let additionalParamMap = getAdditionalParamMap(pageContext);
277
+ const additionalParamMap = getAdditionalParamMap(pageContext);
241
278
  param["additionalParamMap"] = additionalParamMap;
242
279
  let exportResult;
243
280
  if (isPdf) {
@@ -348,19 +385,25 @@ function saveFunc(params, isListButton) {
348
385
  }
349
386
  });
350
387
  }
351
- function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids) {
388
+ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids, row) {
352
389
  const isWorkflow = pageContext.workflowCode ? true : false;
353
390
  const systemCode = pageContext.systemCode;
354
391
  const isPermission = configureObj.props.base.isPermission === void 0 || configureObj.props.base.isPermission === "true" || configureObj.props.base.isPermission;
392
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
393
+ let entity = row;
394
+ if (!entity) {
395
+ entity = pageContext.entity.data;
396
+ }
355
397
  const param = {
356
- entity: pageContext.entity.data,
357
- pageModel: pageContext.entity.page,
398
+ entity,
358
399
  tableName: pageContext.tableName,
359
400
  formNoRuleCode: pageContext.formNoRuleCode,
360
401
  isWorkflowEntity: isWorkflow,
361
- functionCode: configureObj.props.base.functionCode,
402
+ functionCode: functionCodes,
362
403
  isPermission: isPermission + "",
363
- tableNames: pageContext.tableNames
404
+ tableNames: pageContext.tableNames,
405
+ pageCode: pageContext.code,
406
+ pageVersion: pageContext.version
364
407
  };
365
408
  if (ids) {
366
409
  param["ids"] = ids;
@@ -380,14 +423,6 @@ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion
380
423
  param["dataConversionRule"] = conversionCodes;
381
424
  }
382
425
  }
383
- const autoSetValueData = configureObj.props.base.setValueList;
384
- if (autoSetValueData) {
385
- if (isArrayFn(autoSetValueData)) {
386
- param["autoSetValueData"] = autoSetValueData.join(",");
387
- } else if (typeof autoSetValueData === "string") {
388
- param["autoSetValueData"] = autoSetValueData;
389
- }
390
- }
391
426
  const logSetting = configureObj.props.logSetting;
392
427
  if (logSetting) {
393
428
  param["logSettingText"] = logSetting;
@@ -405,14 +440,14 @@ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion
405
440
  if (mainDefaultValueColumns) {
406
441
  param["mainDefaultValueColumns"] = mainDefaultValueColumns;
407
442
  }
408
- let additionalParamMap = getAdditionalParamMap(pageContext);
443
+ const additionalParamMap = getAdditionalParamMap(pageContext);
409
444
  param["additionalParamMap"] = additionalParamMap;
410
445
  if (isUnControlVersion !== void 0) {
411
446
  param["unControlVersion"] = isUnControlVersion;
412
447
  }
413
448
  return param;
414
449
  }
415
- function getSaveFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo) {
450
+ function getSaveFormRequestWithRow(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, row) {
416
451
  const systemCode = pageContext.systemCode;
417
452
  const backendUrl = pageContext.backendUrl;
418
453
  const param = getCommonFormRequestParam(
@@ -421,10 +456,22 @@ function getSaveFormRequest(pageContext, configureObj, url, isUnControlVersion,
421
456
  isUnControlVersion,
422
457
  mainDefaultValueColumns,
423
458
  dynamicColumnInfo,
424
- null
459
+ null,
460
+ row
425
461
  );
426
462
  return getSaveFormRequestByParam(systemCode, backendUrl, param, url, pageContext.entity.data);
427
463
  }
464
+ function getSaveFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo) {
465
+ return getSaveFormRequestWithRow(
466
+ pageContext,
467
+ configureObj,
468
+ url,
469
+ isUnControlVersion,
470
+ mainDefaultValueColumns,
471
+ dynamicColumnInfo,
472
+ null
473
+ );
474
+ }
428
475
  function getSaveFormRequestByParam(systemCode, backendUrl, param, url, formData) {
429
476
  const baseUrl = getBaseUrl(backendUrl);
430
477
  let path = baseUrl + url;
@@ -468,7 +515,7 @@ function dealAfterWithForm(pageContext, configureObj, data, successTip) {
468
515
  }
469
516
  }
470
517
  function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
471
- let successOperation = configureObj.props.base.successOperation;
518
+ const successOperation = configureObj.props.base.successOperation;
472
519
  if (!successOperation || successOperation === null) {
473
520
  return;
474
521
  }
@@ -498,7 +545,11 @@ function closeDialog(pageContext, dataModel, isNeedValueMapping) {
498
545
  const isNeedValueMappingFinal = isNeedValueMapping !== void 0 && isNeedValueMapping === true && dataModel && dataModel !== void 0;
499
546
  const parentPageCode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.parentPageCode : null;
500
547
  const eventPageInfo = parentPageCode + "_";
501
- eventBus.$emit(eventPageInfo + "close-dialog", { isNeedValueMapping: isNeedValueMappingFinal, dataModel, sourceTableName });
548
+ eventBus.$emit(eventPageInfo + "close-dialog", {
549
+ isNeedValueMapping: isNeedValueMappingFinal,
550
+ dataModel,
551
+ sourceTableName
552
+ });
502
553
  } else if (jumpMode === "openWindow" || jumpMode === "newTab") {
503
554
  if (window.parent) {
504
555
  window.parent.close();
@@ -616,7 +667,8 @@ function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion
616
667
  isUnControlVersion,
617
668
  mainDefaultValueColumns,
618
669
  dynamicColumnInfo,
619
- ids
670
+ ids,
671
+ null
620
672
  );
621
673
  getSaveFormRequestByParam(systemCode, backendUrl, param, url, pageContext.entity.data).then((result) => {
622
674
  resolve(result);
@@ -659,13 +711,16 @@ function deleteFunc(params) {
659
711
  path = getRealRestApiPath(path, systemCode, backendUrl);
660
712
  const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
661
713
  const isWorkflow = pageContext.workflowCode ? true : false;
714
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
662
715
  const param = {
663
716
  ids,
664
- functionCode: configureBase.functionCode,
717
+ functionCode: functionCodes,
665
718
  isPermission: isPermission + "",
666
719
  systemCode,
667
720
  isWorkflowEntity: isWorkflow,
668
- tableNames: pageContext.tableNames
721
+ tableNames: pageContext.tableNames,
722
+ pageCode: pageContext.code,
723
+ pageVersion: pageContext.version
669
724
  };
670
725
  if (configureBase.beanName) {
671
726
  param["beanName"] = configureBase.beanName;
@@ -689,7 +744,8 @@ function deleteFunc(params) {
689
744
  http.delete(path, {
690
745
  data: param
691
746
  }).then((data) => {
692
- const gridRef = getComponentRef(pageContext, params.tableUuid);
747
+ const tableUuid = configureObj.props.base.tableUuid;
748
+ const gridRef = getComponentRef(pageContext, tableUuid);
693
749
  if (gridRef) {
694
750
  gridRef.isDeleteChange(true);
695
751
  gridRef.clearSelections();
@@ -744,12 +800,19 @@ function downloadTemplateFunc(params) {
744
800
  if (pageContext.beanName) {
745
801
  param += "&beanName=" + pageContext.beanName;
746
802
  }
747
- if (configureBase.functionCode) {
748
- param += "&functionCode=" + configureBase.functionCode;
803
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
804
+ if (functionCodes) {
805
+ param += "&functionCode=" + functionCodes;
749
806
  }
750
807
  if (pageContext.tableName) {
751
808
  param += "&tableName=" + pageContext.tableName;
752
809
  }
810
+ if (pageContext.code) {
811
+ param += "&pageCode=" + pageContext.code;
812
+ }
813
+ if (pageContext.version) {
814
+ param += "&pageVersion=" + pageContext.version;
815
+ }
753
816
  if (configureBase) {
754
817
  const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
755
818
  param += "&isPermission=" + isPermission;
@@ -802,10 +865,11 @@ function doImportFinally(params, fileObj) {
802
865
  if (isWorkflowEntity !== null && isWorkflowEntity !== void 0) {
803
866
  param.append("isWorkflowEntity", isWorkflowEntity + "");
804
867
  }
805
- if (buttonConfigureBase.functionCode) {
806
- param.append("functionCode", buttonConfigureBase.functionCode);
868
+ const functionCodes = getPermissionCodes(buttonConfigureObj, pageContext);
869
+ if (functionCodes) {
870
+ param.append("functionCode", functionCodes);
807
871
  }
808
- let additionalParamMap = getAdditionalParamMap(pageContext);
872
+ const additionalParamMap = getAdditionalParamMap(pageContext);
809
873
  param.append("additionalParamMapStr", JSON.stringify(additionalParamMap));
810
874
  const isPermission = buttonConfigureBase.isPermission === void 0 || buttonConfigureBase.isPermission === "true" || buttonConfigureBase.isPermission;
811
875
  param.append("isPermission", isPermission + "");
@@ -897,12 +961,13 @@ function exportFunc(params) {
897
961
  isAsync = false;
898
962
  }
899
963
  const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
964
+ const functionCodes = getPermissionCodes(params.configureObj, pageContext);
900
965
  const exportFileName = pageName;
901
966
  window["$vueApp"].config.globalProperties.$exportDataNew(
902
967
  dataParam,
903
968
  exportFileName,
904
969
  listCode,
905
- configureBase.functionCode,
970
+ functionCodes,
906
971
  null,
907
972
  null,
908
973
  isAsync,
@@ -916,10 +981,10 @@ function getWorkflowSaveParams(params) {
916
981
  const configureObj = params.configureObj;
917
982
  const dataModel = pageContext.entity.data;
918
983
  const systemCode = pageContext.systemCode;
919
- const permissionPrefix = systemCode + "." + pageContext.code;
920
- let functionCode = configureObj.props.base.functionCode;
921
- if (!functionCode) {
922
- functionCode = permissionPrefix + ".xxx";
984
+ const permissionPrefix = pageContext.code;
985
+ let functionCodes = getPermissionCodes(configureObj, pageContext);
986
+ if (!functionCodes) {
987
+ functionCodes = permissionPrefix + ".xxx";
923
988
  }
924
989
  if (!dataModel.id && !dataModel.ID) {
925
990
  dataModel["pageCode"] = pageContext.code;
@@ -932,9 +997,11 @@ function getWorkflowSaveParams(params) {
932
997
  tableName: pageContext.tableName,
933
998
  emailTemplateCode: pageContext.emailTemplateCode,
934
999
  definitionId: pageContext.definitionId,
935
- functionCode,
1000
+ functionCode: functionCodes,
936
1001
  systemCode,
937
- tableNames: pageContext.tableNames
1002
+ tableNames: pageContext.tableNames,
1003
+ pageCode: pageContext.code,
1004
+ pageVersion: pageContext.version
938
1005
  };
939
1006
  if (pageContext.completeTaskParam) {
940
1007
  param["completeTaskParam"] = {
@@ -957,14 +1024,6 @@ function getWorkflowSaveParams(params) {
957
1024
  param["dataConversionRule"] = conversionCodes;
958
1025
  }
959
1026
  }
960
- const autoSetValueData = configureObj.props.base.setValueList;
961
- if (autoSetValueData) {
962
- if (isArrayFn(autoSetValueData)) {
963
- param["autoSetValueData"] = autoSetValueData.join(",");
964
- } else if (typeof autoSetValueData === "string") {
965
- param["autoSetValueData"] = autoSetValueData;
966
- }
967
- }
968
1027
  if (pageContext.beanName) {
969
1028
  param["beanName"] = pageContext.beanName;
970
1029
  }
@@ -975,7 +1034,7 @@ function getWorkflowSaveParams(params) {
975
1034
  if (!param.systemCode) {
976
1035
  param.systemCode = systemCode;
977
1036
  }
978
- let additionalParamMap = getAdditionalParamMap(pageContext);
1037
+ const additionalParamMap = getAdditionalParamMap(pageContext);
979
1038
  param["additionalParamMap"] = additionalParamMap;
980
1039
  if (additionalParamMap.ids && additionalParamMap.ids.length > 0) {
981
1040
  param["ids"] = additionalParamMap.ids;
@@ -1180,21 +1239,21 @@ function doAssign(params, selectNodeInfo) {
1180
1239
  function getTransactTaskParam(params) {
1181
1240
  const pageContext = params.pageContext;
1182
1241
  const dataModel = pageContext.entity.data;
1183
- const pageModel = pageContext.entity.page;
1184
1242
  const systemCode = pageContext.systemCode;
1185
- const permissionPrefix = systemCode + "." + pageContext.code;
1243
+ const permissionPrefix = pageContext.code;
1186
1244
  const additionalParamMap = getAdditionalParamMap(pageContext);
1187
1245
  const dataId = dataModel.ID !== void 0 && dataModel.ID !== null ? dataModel.ID : dataModel.id;
1188
1246
  ({
1189
1247
  beanName: pageContext.beanName,
1190
1248
  id: dataId,
1191
1249
  entity: dataModel,
1192
- pageModel,
1193
1250
  additionalParamMap,
1194
1251
  tableName: pageContext.tableName,
1195
1252
  functionCode: permissionPrefix + ".xxx",
1196
1253
  isWorkflowEntity: true,
1197
- tableNames: pageContext.tableNames
1254
+ tableNames: pageContext.tableNames,
1255
+ pageCode: pageContext.code,
1256
+ pageVersion: pageContext.version
1198
1257
  });
1199
1258
  ({
1200
1259
  taskId: pageContext.completeTaskParam.taskId,
@@ -1385,8 +1444,8 @@ function getTaskInformitions(params) {
1385
1444
  });
1386
1445
  return;
1387
1446
  }
1388
- const permissionPrefix = systemCode + "." + pageContext.code;
1389
- let additionalParamMap = getAdditionalParamMap(pageContext);
1447
+ const permissionPrefix = pageContext.code;
1448
+ const additionalParamMap = getAdditionalParamMap(pageContext);
1390
1449
  const requestParams = {
1391
1450
  beanName: pageContext.beanName,
1392
1451
  additionalParamMap,
@@ -1485,6 +1544,22 @@ function lineEditCreateFunc(params) {
1485
1544
  gridRef.createRow(params);
1486
1545
  }
1487
1546
  }
1547
+ function printLabel(params) {
1548
+ let templateUuid = null;
1549
+ try {
1550
+ if (params.menuItem) {
1551
+ templateUuid = params.menuItem.templateUuid;
1552
+ } else {
1553
+ templateUuid = params.configureObj.props.base.template[0].templateUuid;
1554
+ }
1555
+ if (!templateUuid) {
1556
+ throw new Error("未找到模板");
1557
+ }
1558
+ } catch (e) {
1559
+ console.error("打印标签失败,未在配置中找到找到模板", e, params);
1560
+ }
1561
+ printLabelUtil.printLabel(params, templateUuid);
1562
+ }
1488
1563
  function isVisibleWorkflowButton(standardEventName, buttonInfo, completeTaskParam) {
1489
1564
  let isVisible = true;
1490
1565
  if (standardEventName && buttonInfo) {
@@ -1683,6 +1758,7 @@ export {
1683
1758
  getAdditionalParamMap,
1684
1759
  getRemoveSigner,
1685
1760
  getSaveFormRequest,
1761
+ getSaveFormRequestWithRow,
1686
1762
  getTaskInformitions,
1687
1763
  isVisibleWorkflowButton,
1688
1764
  judgeDataNumber,
@@ -0,0 +1,191 @@
1
+ import http from "agilebuilder-ui/src/utils/request";
2
+ import { setValueForVariableName } from "../page-helper-util.js";
3
+ function formatScanRuleSets(ruleList) {
4
+ const scanRuleSets2 = {};
5
+ ruleList.forEach((ruleSet) => {
6
+ if (ruleSet.type === "group") {
7
+ ruleSet.outs.forEach((valueSet) => {
8
+ if (!scanRuleSets2[valueSet.ruleCode]) {
9
+ scanRuleSets2[valueSet.ruleCode] = { outs: [], adaptations: [] };
10
+ }
11
+ scanRuleSets2[valueSet.ruleCode].outs.push(valueSet);
12
+ });
13
+ } else {
14
+ scanRuleSets2[ruleSet.code] = { outs: ruleSet.outs, adaptations: [] };
15
+ }
16
+ });
17
+ return packageScanRuleSets(scanRuleSets2);
18
+ }
19
+ function packageScanRuleSets(scanRuleSets2) {
20
+ return new Promise((resolve, reject) => {
21
+ if (Object.keys(scanRuleSets2).length > 0) {
22
+ http.post("/dc/setting-barcode-analysis/by-codes", Object.keys(scanRuleSets2)).then((res2) => {
23
+ res2.forEach((rule) => {
24
+ const ruleOuts = JSON.parse(rule.barcodeAnalysisOuts);
25
+ const needOutsFields = /* @__PURE__ */ new Set();
26
+ const outsFiledsSet = {};
27
+ scanRuleSets2[rule.code].outs.forEach((valueSet) => {
28
+ needOutsFields.add(valueSet.returnedValue);
29
+ outsFiledsSet[valueSet.returnedValue] = valueSet.pageVariable;
30
+ });
31
+ const filteredOutsField = [];
32
+ ruleOuts.forEach((outFiled) => {
33
+ if (needOutsFields.has(outFiled.code)) {
34
+ outFiled.pageVariable = outsFiledsSet[outFiled.code];
35
+ filteredOutsField.push(outFiled);
36
+ }
37
+ });
38
+ scanRuleSets2[rule.code].outs = filteredOutsField;
39
+ scanRuleSets2[rule.code].adaptations = JSON.parse(rule.barcodeAnalysisAdaptations);
40
+ resolve(scanRuleSets2);
41
+ });
42
+ });
43
+ } else {
44
+ resolve(null);
45
+ }
46
+ });
47
+ }
48
+ function analysisScanValue(scanValue, scanRuleSets) {
49
+ if (!scanValue) {
50
+ return null;
51
+ }
52
+ const scanSets = Object.values(scanRuleSets);
53
+ for (let i = 0; i < scanSets.length; i++) {
54
+ const scanSet = scanSets[i];
55
+ const adaptations = scanSet.adaptations;
56
+ let validStr = "";
57
+ for (let k = 0; k < adaptations.length; k++) {
58
+ const adap = adaptations[k];
59
+ const indexs = _getScanIndexs(scanValue, adap.startIndex, adap.endIndex);
60
+ const startIndex = indexs[0];
61
+ const endIndex = indexs[1];
62
+ let paramValue = scanValue.substring(startIndex, endIndex);
63
+ let compareValue = adap.value;
64
+ let operate = adap.operate;
65
+ if (operate == "times") {
66
+ const realValue = paramValue.split(compareValue == void 0 ? "" : compareValue).length - 1;
67
+ compareValue = realValue;
68
+ paramValue = adap.times;
69
+ operate = "=";
70
+ }
71
+ if (isNaN(paramValue) || isNaN(compareValue)) {
72
+ paramValue = "'" + paramValue + "'";
73
+ compareValue = "'" + compareValue + "'";
74
+ }
75
+ if (adap.leftBracket) {
76
+ validStr += adap.leftBracket;
77
+ }
78
+ if (operate == "<>") {
79
+ operate = "!=";
80
+ } else if (operate == "=") {
81
+ operate = "==";
82
+ }
83
+ if (operate == "include" || operate == "notinclude") {
84
+ validStr += paramValue + ".indexOf(" + compareValue + ")";
85
+ if (operate == "include") {
86
+ validStr += ">-1";
87
+ } else {
88
+ validStr += "<0";
89
+ }
90
+ } else {
91
+ validStr += paramValue + operate + compareValue;
92
+ }
93
+ if (adap.rightBracket) {
94
+ validStr += adap.rightBracket;
95
+ }
96
+ if (adap.joinStr && k + 1 < adaptations.length) {
97
+ const joinStr = adap.joinStr == "and" ? "&&" : "||";
98
+ validStr += joinStr;
99
+ }
100
+ }
101
+ let res = false;
102
+ if (validStr) {
103
+ try {
104
+ console.log("validStr", validStr);
105
+ res = eval("(" + validStr + ")");
106
+ console.log("res", res);
107
+ } catch (e) {
108
+ console.log(e);
109
+ }
110
+ } else {
111
+ res = true;
112
+ }
113
+ if (res) {
114
+ return executeAnalysisForScan(scanValue, scanSet);
115
+ }
116
+ }
117
+ return null;
118
+ }
119
+ function executeAnalysisForScan(scanValue2, scanSet2) {
120
+ if (!scanSet2 || !scanValue2) {
121
+ return;
122
+ }
123
+ const outs = scanSet2.outs;
124
+ const params = {};
125
+ outs.forEach((outJson) => {
126
+ const fieldName = outJson.fieldName;
127
+ if (outJson.fixedValue != void 0) {
128
+ params[fieldName] = outJson.fixedValue;
129
+ } else {
130
+ let pValue = scanValue2;
131
+ if (outJson.splitChar && outJson.splitNum) {
132
+ const splitChar = outJson.splitChar == "|" ? outJson.splitChar : outJson.splitChar;
133
+ const strs = scanValue2.split(splitChar);
134
+ const splitNum = outJson.splitNum < 1 ? 1 : outJson.splitNum;
135
+ console.log(pValue, splitChar, strs, splitNum);
136
+ if (splitNum <= strs.length) {
137
+ pValue = strs[splitNum - 1];
138
+ } else {
139
+ pValue = "";
140
+ }
141
+ }
142
+ if (outJson.splitChar2 && outJson.splitNum2) {
143
+ const splitChar2 = outJson.splitChar2 == "|" ? outJson.splitChar2 : outJson.splitChar2;
144
+ const strs = pValue.split(splitChar2);
145
+ const splitNum2 = outJson.splitNum2 < 1 ? 1 : outJson.splitNum2;
146
+ console.log(pValue, splitChar2, strs, splitNum2);
147
+ if (splitNum2 <= strs.length) {
148
+ pValue = strs[splitNum2 - 1];
149
+ } else {
150
+ pValue = "";
151
+ }
152
+ }
153
+ if (pValue.length > 0) {
154
+ const indexs = _getScanIndexs(pValue, outJson.startIndex, outJson.endIndex);
155
+ const startIndex = indexs[0];
156
+ const endIndex = indexs[1];
157
+ pValue = pValue.substring(startIndex, endIndex);
158
+ }
159
+ params[fieldName] = pValue;
160
+ }
161
+ });
162
+ return { value: scanValue2, params, scanSet: scanSet2 };
163
+ }
164
+ function _getScanIndexs(value, startIndex, endIndex) {
165
+ startIndex = startIndex == void 0 ? 0 : startIndex - 1;
166
+ startIndex = startIndex < 0 ? 0 : startIndex;
167
+ startIndex = startIndex > value.length - 1 ? value.length - 1 : startIndex;
168
+ endIndex = endIndex == void 0 ? value.length : endIndex;
169
+ endIndex = endIndex > value.length ? value.length : endIndex;
170
+ endIndex = endIndex < 1 ? 1 : endIndex;
171
+ if (endIndex < startIndex) {
172
+ endIndex = startIndex;
173
+ }
174
+ return [startIndex, endIndex];
175
+ }
176
+ function setScanAnalysisValue(pageContext, scanSet2, params) {
177
+ if (!scanSet2) {
178
+ return;
179
+ }
180
+ const outs = scanSet2.outs;
181
+ outs.forEach((outField) => {
182
+ const fieldName = outField.fieldName;
183
+ const value = params[fieldName];
184
+ setValueForVariableName(pageContext.entity, outField.pageVariable, value);
185
+ });
186
+ }
187
+ export {
188
+ analysisScanValue,
189
+ formatScanRuleSets,
190
+ setScanAnalysisValue
191
+ };
@@ -156,7 +156,11 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams) {
156
156
  systemCode: pageContext2.systemCode,
157
157
  pageCode: pageContext2.code
158
158
  };
159
- const url = window["$vueApp"].config.globalProperties.baseURL + "/common/common-data/find-chart-datas";
159
+ let baseUrl = pageContext2.backendUrl;
160
+ if (!baseUrl) {
161
+ baseUrl = window["$vueApp"].config.globalProperties.baseURL;
162
+ }
163
+ const url = baseUrl + "/common/common-data/find-chart-datas";
160
164
  http.post(url, param).then((result) => {
161
165
  if (!pageContext2.chartDataSourceMap) {
162
166
  pageContext2.chartDataSourceMap = {};
@@ -198,7 +202,11 @@ function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
198
202
  systemCode: pageContext2.systemCode,
199
203
  query
200
204
  };
201
- const url = window["$vueApp"].config.globalProperties.baseURL + "/common/common-data/find-datas";
205
+ let baseUrl = pageContext2.backendUrl;
206
+ if (!baseUrl) {
207
+ baseUrl = window["$vueApp"].config.globalProperties.baseURL;
208
+ }
209
+ const url = baseUrl + "/common/common-data/find-datas";
202
210
  http.post(url, param).then((result) => {
203
211
  if (!pageContext2.optionSourceMap) {
204
212
  pageContext2.optionSourceMap = {};
@@ -331,6 +339,7 @@ function setValueForVariableName(entity, variableName, newValue) {
331
339
  setVariableValue(entity, fields, newValue);
332
340
  }
333
341
  function setVariableValue(entity, fields, newValue) {
342
+ debugger;
334
343
  if (!entity || !fields || fields.length == 0) {
335
344
  return;
336
345
  }
@@ -611,6 +620,13 @@ function getMonitorFieldValues(monitorFieldInfos, entity) {
611
620
  }
612
621
  return values;
613
622
  }
623
+ function getFormPropName(prop) {
624
+ if (prop && prop.indexOf("${") >= 0) {
625
+ return prop.substring(prop.indexOf(".") + 1, prop.lastIndexOf("}"));
626
+ } else {
627
+ return prop;
628
+ }
629
+ }
614
630
  export {
615
631
  autoSetAfterSelect,
616
632
  caculateShowCondition,
@@ -618,6 +634,7 @@ export {
618
634
  formatVariableValue,
619
635
  getChartDatasFromPage,
620
636
  getComponentOptionConfigs,
637
+ getFormPropName,
621
638
  getOptionDatasFromPage,
622
639
  getValueFromSource,
623
640
  getVariableValue,
@@ -22,7 +22,7 @@ export declare function convertToPageContext(pageDesign: PageDesign, pageRequest
22
22
  * @param pageContext 页面对象
23
23
  * @param formItemConfigure 表单元素配置参数
24
24
  */
25
- export declare function getFormModelFields(pageContext: PageContext, formItemConfigure: Component): string[];
25
+ export declare function getFormModelFields(pageContext: PageContext, formItemConfigure: Component, prop?: string): string[];
26
26
  /**
27
27
  * 获取组件的权限编码
28
28
  * @param configure