super-page-runtime 2.1.50 → 2.1.57

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 (36) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +110 -3
  2. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +12 -3
  3. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +24 -0
  4. package/dist/es/components/runtime/utils/charts/chart-util.js +18 -1
  5. package/dist/es/components/runtime/utils/common-util.d.ts +1 -0
  6. package/dist/es/components/runtime/utils/common-util.js +6 -5
  7. package/dist/es/components/runtime/utils/events/event-util.d.ts +1 -0
  8. package/dist/es/components/runtime/utils/events/event-util.js +17 -4
  9. package/dist/es/components/runtime/utils/events/standard-event.d.ts +1 -1
  10. package/dist/es/components/runtime/utils/events/standard-event.js +6 -4
  11. package/dist/es/components/runtime/utils/events/validator-util.js +2 -1
  12. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +1 -0
  13. package/dist/es/components/runtime/utils/page-helper-util.d.ts +18 -0
  14. package/dist/es/components/runtime/utils/page-helper-util.js +23 -5
  15. package/dist/es/components/runtime/utils/page-init-util.js +14 -10
  16. package/dist/es/components/runtime/utils/table-utils.js +3 -7
  17. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +3 -1
  18. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +5 -3
  19. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +108 -46
  20. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +4 -1
  21. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +64 -0
  22. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +4 -0
  23. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +106 -20
  24. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +0 -2
  25. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +107 -53
  26. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +25 -8
  27. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +18 -3
  28. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +1 -1
  29. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +0 -3
  30. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +0 -2
  31. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +3 -12
  32. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +49 -26
  33. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +19 -12
  34. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +3 -5
  35. package/dist/es/components/runtime/views/super-page.vue.js +88 -26
  36. package/package.json +2 -2
@@ -1,11 +1,12 @@
1
- import { setValueForVariableName } from "../page-helper-util.js";
2
- import { getComponentRefByCode } from "../global-refs.js";
1
+ import { setValueForVariableName, getOptionDatasSourceMap, getComponentOptionDatasFromPage, getVariableValue, setVariableValue } from "../page-helper-util.js";
2
+ import { getComponentRefByCode, getComponentRef } from "../global-refs.js";
3
3
  import eventBus from "../eventBus.js";
4
4
  import http from "agilebuilder-ui/src/utils/request";
5
5
  import { getAdditionalParamMap, refreshPage } from "../events/standard-event.js";
6
6
  import { updateFormItemEditState, dsiabledAllFields } from "../events/validator-util.js";
7
- import { getBaseUrl } from "../common-util.js";
7
+ import { getBaseUrl, deepCopy } from "../common-util.js";
8
8
  import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
9
+ import { getFormModelFields, getModelFields } from "../page-init-util.js";
9
10
  const functions = {
10
11
  /**
11
12
  * 展示页面中的某个组件元素
@@ -319,8 +320,114 @@ const functions = {
319
320
  // 根据编码获取组件引用对象
320
321
  getComponentRefByCode(pageContext, code) {
321
322
  return getComponentRefByCode(pageContext, code);
323
+ },
324
+ // 获得表单数据查看信息,例如:下拉框选项名等
325
+ getFormViewData(pageContext) {
326
+ var _a, _b, _c, _d, _e, _f, _g, _h;
327
+ const entity = pageContext.entity ? pageContext.entity : {};
328
+ const viewEntity = deepCopy(entity);
329
+ const optionSourceMap = getOptionDatasSourceMap(pageContext);
330
+ for (let uuid in optionSourceMap) {
331
+ const cacheOptions = getComponentOptionDatasFromPage(pageContext, uuid);
332
+ const componentRef = getComponentRef(pageContext, uuid);
333
+ if (componentRef) {
334
+ const componentConfigure = componentRef.getConfigure();
335
+ if (componentConfigure) {
336
+ if (((_b = (_a = componentConfigure.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && (((_d = (_c = componentConfigure.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) === "static" || ((_f = (_e = componentConfigure.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType) === "optionGroup")) {
337
+ if (componentConfigure.name && (componentConfigure.name === "select" && ((_h = (_g = componentConfigure.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || componentConfigure.name === "checkbox")) {
338
+ let dynamicFields = getFormModelFields(pageContext, componentConfigure);
339
+ const propValue = getVariableValue(viewEntity, dynamicFields);
340
+ if (propValue) {
341
+ const propValues = propValue.split(",");
342
+ const label = getSelectShowLable(propValues, cacheOptions);
343
+ setVariableValue(viewEntity, dynamicFields, label);
344
+ }
345
+ } else {
346
+ let dynamicFields = getFormModelFields(pageContext, componentConfigure);
347
+ const propValue = getVariableValue(viewEntity, dynamicFields);
348
+ const label = getSelectShowLable(propValue, cacheOptions);
349
+ setVariableValue(viewEntity, dynamicFields, label);
350
+ }
351
+ }
352
+ }
353
+ }
354
+ }
355
+ const listCodesMap = pageContext.listCodesMap;
356
+ for (let listCode in listCodesMap) {
357
+ let tableUuid;
358
+ if (listCode.indexOf("__") > 0) {
359
+ tableUuid = listCode.substring(listCode.lastIndexOf("__") + "__".length);
360
+ }
361
+ if (tableUuid) {
362
+ const componentRef = getComponentRef(pageContext, tableUuid);
363
+ if (componentRef) {
364
+ const componentConfigure = componentRef.getConfigure();
365
+ const prop = componentConfigure.code ? componentConfigure.code : listCode;
366
+ let dynamicFields = getModelFields(componentConfigure, prop);
367
+ const gridData = getVariableValue(viewEntity, dynamicFields);
368
+ const subTableOptions = componentRef.getTableSelectOptions(listCode);
369
+ packageSubTableShowLable(subTableOptions, gridData);
370
+ }
371
+ }
372
+ }
373
+ return viewEntity.data;
322
374
  }
323
375
  };
376
+ function packageSubTableShowLable(subTableOptions, subData) {
377
+ if (subTableOptions && subData) {
378
+ subData.forEach((rowData) => {
379
+ const props = Object.keys(subTableOptions);
380
+ props.forEach((prop) => {
381
+ const propValue = rowData[prop];
382
+ const values = subTableOptions[prop];
383
+ const propSelectOptions = values.options;
384
+ const column = values.column;
385
+ let propLabel;
386
+ if (column && column.componentType && (column.componentType === "multiselect" || column.componentType === "checkbox")) {
387
+ if (propValue) {
388
+ const propValues = propValue.split(",");
389
+ propLabel = getSelectShowLable(propValues, propSelectOptions);
390
+ }
391
+ } else {
392
+ propLabel = getSelectShowLable(propValue, propSelectOptions);
393
+ }
394
+ rowData[prop] = propLabel;
395
+ });
396
+ });
397
+ }
398
+ }
399
+ function getSelectShowLable(propValue, propSelectOptions) {
400
+ let showLabel;
401
+ if (propValue !== void 0 && propValue !== null && propSelectOptions) {
402
+ if (Array.isArray(propValue)) {
403
+ showLabel = "";
404
+ propValue.forEach((val) => {
405
+ showLabel = showLabel + getSingleSelectShowLable(propValue, propSelectOptions) + ",";
406
+ });
407
+ if (showLabel.indexOf(",") > 0) {
408
+ showLabel = showLabel.substring(0, showLabel.lastIndexOf(","));
409
+ }
410
+ } else {
411
+ showLabel = propValue;
412
+ showLabel = getSingleSelectShowLable(propValue, propSelectOptions);
413
+ }
414
+ }
415
+ return showLabel;
416
+ }
417
+ function getSingleSelectShowLable(propValue, propSelectOptions) {
418
+ let showLabel = propValue;
419
+ if (propValue !== void 0 && propValue !== null && propSelectOptions) {
420
+ for (let i = 0; i < propSelectOptions.length; i++) {
421
+ const optValue = propSelectOptions[i].value;
422
+ const optLabel = propSelectOptions[i].label ? propSelectOptions[i].label : propSelectOptions[i].name;
423
+ if (propValue + "" === optValue + "" && (optLabel !== void 0 && optLabel !== null)) {
424
+ showLabel = optLabel;
425
+ break;
426
+ }
427
+ }
428
+ }
429
+ return showLabel;
430
+ }
324
431
  function packageInitInfo(pageContext, type, settings) {
325
432
  if (!pageContext.initInfo) {
326
433
  pageContext.initInfo = {};
@@ -1,13 +1,17 @@
1
- import { getValueFromSource, formatVariableValue, setValueForVariableName } from "../page-helper-util.js";
1
+ import { setValueForVariableName, getValueFromSource, formatVariableValue } 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
+ import { handleChartEvent } from "../events/event-util.js";
4
5
  function updateChartOption(pageContext, configure, chartOption, resultData) {
6
+ var _a;
5
7
  if (!resultData || !resultData.result) {
6
8
  return;
7
9
  }
10
+ handleChartEvent(pageContext, configure, "beforeUpdateChart", chartOption, {
11
+ resultData
12
+ });
8
13
  const result = resultData && resultData.result ? resultData.result : {};
9
14
  let groupValue = resultData && resultData.groupValue ? resultData.groupValue : void 0;
10
- debugger;
11
15
  const dataSetField = configure.serviceDataField;
12
16
  let datas = null;
13
17
  if (dataSetField) {
@@ -24,6 +28,9 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
24
28
  if (!datas) {
25
29
  datas = [];
26
30
  }
31
+ if ((_a = configure.runtime.dataConfig) == null ? void 0 : _a.resultSet) {
32
+ setValueForVariableName(pageContext.entity, configure.runtime.dataConfig.resultSet, datas);
33
+ }
27
34
  let confGroups = configure.props ? configure.props.groups : null;
28
35
  if (!confGroups) {
29
36
  confGroups = [];
@@ -203,7 +210,6 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
203
210
  sortDatas(pageContext, configure, datas);
204
211
  datas = limitDatas(pageContext, configure, datas, groupFields, limitValueFields);
205
212
  const xValues = [];
206
- console.log("accumulateFields", accumulateFields);
207
213
  const cumulativeMap = {};
208
214
  for (const data of datas) {
209
215
  if (!data) {
@@ -309,6 +315,9 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
309
315
  configure.highlightInfos = [];
310
316
  setValueForVariableName(pageContext.entity, selGroupVariable, null);
311
317
  }
318
+ handleChartEvent(pageContext, configure, "afterUpdateChart", chartOption, {
319
+ resultData
320
+ });
312
321
  configure.groupFields = realGroupFilds;
313
322
  configure.cacheDatas = datas;
314
323
  configure.rawResult = resultData;
@@ -67,6 +67,30 @@ export declare function limitDatas(pageContext: PageContext, configure: Componen
67
67
  * @returns
68
68
  */
69
69
  export declare function caculateFormulaValue(itemConfs: any, datas: any, accumulateFields: any): any;
70
+ /**
71
+ * 获取数据源中的最小值
72
+ * @param datas 数据源
73
+ * @param fieldName 字段名
74
+ */
75
+ export declare function getMinValue(datas: any, fieldName: string): any;
76
+ /**
77
+ * 获取数据源中的最大值
78
+ * @param datas 数据源
79
+ * @param fieldName 字段名
80
+ */
81
+ export declare function getMaxValue(datas: any, fieldName: string): any;
82
+ /**
83
+ * 获取数据源中的汇总值
84
+ * @param datas 数据源
85
+ * @param fieldName 字段名
86
+ */
87
+ export declare function getSumValue(datas: any, fieldName: string): any;
88
+ /**
89
+ * 获取平均值
90
+ * @param datas 数据源
91
+ * @param fieldName 字段名
92
+ */
93
+ export declare function getAvgValue(datas: any, fieldName: string): any;
70
94
  /**
71
95
  * 执行统计图的计算公式
72
96
  * @param formulaStr 计算公式
@@ -14,7 +14,6 @@ const themeMap = {
14
14
  theme3
15
15
  };
16
16
  function getCustomTheme(themeName) {
17
- console.log("getdd", themeName);
18
17
  return themeMap[themeName];
19
18
  }
20
19
  function getCustomThemeOptions() {
@@ -127,6 +126,20 @@ function initChartOption(configure, chartOption) {
127
126
  if (yAxis.data) {
128
127
  yAxis.data = [];
129
128
  }
129
+ if (yAxis._dataMin === "auto") {
130
+ yAxis.min = function(value) {
131
+ if (value.min) {
132
+ return Math.floor(value.min / 10) * 10;
133
+ }
134
+ };
135
+ }
136
+ if (yAxis._dataMax === "auto") {
137
+ yAxis.max = function(value) {
138
+ if (value.max) {
139
+ return Math.ceil(value.max / 10) * 10;
140
+ }
141
+ };
142
+ }
130
143
  }
131
144
  }
132
145
  configure.defaultYaxis = defaultYaxis;
@@ -496,9 +509,13 @@ export {
496
509
  clearChartSelected,
497
510
  executeChartFormula,
498
511
  exportCommonChart,
512
+ getAvgValue,
499
513
  getCustomTheme,
500
514
  getCustomThemeOptions,
515
+ getMaxValue,
516
+ getMinValue,
501
517
  getNumFormatter,
518
+ getSumValue,
502
519
  initChartOption,
503
520
  limitDatas,
504
521
  monitorChartClickToVariable,
@@ -26,3 +26,4 @@ export declare function getPropClassName(configure: Component): any;
26
26
  export declare function isNumber(numStr: any): boolean;
27
27
  export declare function isWorkflowPage(pageContext: PageContext): boolean;
28
28
  export declare function refreshMobileDialogType(jumpPageSetting: any, isMobile: boolean): void;
29
+ export declare function isVariableInvalidValue(values: any, variable: string): boolean;
@@ -133,11 +133,8 @@ function isNumber(numStr) {
133
133
  }
134
134
  }
135
135
  function isWorkflowPage(pageContext) {
136
- var _a;
137
- let isWorkflow = false;
138
- if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
139
- isWorkflow = pageContext.workflowCode ? true : false;
140
- }
136
+ const isWorkflow = pageContext.isWorkflowEntity ? true : pageContext.workflowCode ? true : false;
137
+ console.log("isWorkflowPage----isWorkflow=", isWorkflow, "pageContext.isWorkflowEntity=", pageContext.isWorkflowEntity, "pageContext.workflowCode=", pageContext.workflowCode);
141
138
  return isWorkflow;
142
139
  }
143
140
  function refreshMobileDialogType(jumpPageSetting, isMobile) {
@@ -162,6 +159,9 @@ function refreshMobileDialogType(jumpPageSetting, isMobile) {
162
159
  jumpPageSetting.jumpPageMobileOpenMode = openMode;
163
160
  }
164
161
  }
162
+ function isVariableInvalidValue(values, variable) {
163
+ return values[variable] === null || values[variable] === void 0 || values[variable] === "";
164
+ }
165
165
  export {
166
166
  deepCopy,
167
167
  getBaseUrl,
@@ -171,6 +171,7 @@ export {
171
171
  getWorkflowId,
172
172
  isArrayFn,
173
173
  isNumber,
174
+ isVariableInvalidValue,
174
175
  isWorkflowPage,
175
176
  packageTemplateFiles,
176
177
  refreshMobileDialogType,
@@ -86,3 +86,4 @@ export declare function fileUploadDeleted(pageContext: any, configureObj: any, p
86
86
  * @param configure 组件配置
87
87
  */
88
88
  export declare function isShowComponent(configure: Component): boolean;
89
+ export declare function handleChartEvent(pageContext: PageContext, configure: Component, eventType: string, chartOption: object, otherParams?: object): any;
@@ -121,8 +121,8 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
121
121
  const tableUuid = getTableUuid(pageContext, configure);
122
122
  if (tableUuid) {
123
123
  const gridRef = getComponentRef(pageContext, tableUuid);
124
- const selections = gridRef.getSelections();
125
- const selectionIds = gridRef.getSelectionIds();
124
+ const selections = gridRef ? gridRef.getSelections() : null;
125
+ const selectionIds = gridRef ? gridRef.getSelectionIds() : null;
126
126
  if (!otherParams) {
127
127
  otherParams = {};
128
128
  }
@@ -134,7 +134,7 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
134
134
  otherParams["id"] = selectionIds && selectionIds.length > 0 ? selectionIds[0] : null;
135
135
  otherParams["ids"] = selectionIds;
136
136
  }
137
- const tableConfigure = gridRef.getTableConfigure();
137
+ const tableConfigure = gridRef ? gridRef.getTableConfigure() : null;
138
138
  otherParams["tableConfigure"] = tableConfigure;
139
139
  }
140
140
  const eventParams = packageEventParams(pageContext, configure, $event, otherParams);
@@ -674,7 +674,9 @@ function isShowComponent(configure) {
674
674
  if (!isMobile) {
675
675
  const events = configure && configure.events ? configure.events : [];
676
676
  if (events) {
677
- const eventArr = events.filter((item) => item.name === "click" && item.isStandard && item.eventName && item.eventName === "showSearch");
677
+ const eventArr = events.filter(
678
+ (item) => item.name === "click" && item.isStandard && item.eventName && item.eventName === "showSearch"
679
+ );
678
680
  if (eventArr && eventArr.length > 0) {
679
681
  isShow = false;
680
682
  }
@@ -682,6 +684,16 @@ function isShowComponent(configure) {
682
684
  }
683
685
  return isShow;
684
686
  }
687
+ function handleChartEvent(pageContext, configure, eventType, chartOption, otherParams) {
688
+ const events = configure && configure.runtime && configure.runtime.events ? configure.runtime.events : [];
689
+ const eventFun = getEventFuncByType(pageContext, events, eventType);
690
+ return callItemEvent(pageContext, configure, eventFun, {
691
+ configure,
692
+ pageContext,
693
+ chartOption,
694
+ ...otherParams
695
+ });
696
+ }
685
697
  export {
686
698
  appendDefaultMethods,
687
699
  canExecuteButton,
@@ -700,6 +712,7 @@ export {
700
712
  gridSelectAllRecords,
701
713
  gridSelectRecord,
702
714
  gridSelectionChange,
715
+ handleChartEvent,
703
716
  handleEvent,
704
717
  handleFormEvent,
705
718
  headerClick,
@@ -57,7 +57,7 @@ export declare function getSaveFormRequest(pageContext: PageContext, configureOb
57
57
  */
58
58
  export declare function dealAfterOperate(pageContext: any, configureObj: any, data: any, successTip: any, isListButton?: boolean): void;
59
59
  export declare function updateValuesWhenCloseDialog(parentPageContext: any, parentConfigureObj: any, sourceModel: any, sourceTableName: any): void;
60
- export declare function refreshFormOrListPage(pageContext: any, configureObj: any): void;
60
+ export declare function refreshFormOrListPage(pageContext: any, configureObj: any, isRefreshWhenClosePopup: any): void;
61
61
  export declare function doImportFinally(params: any, fileObj: any): void;
62
62
  export declare function judgeDataNumber(buttonConfigureObj: any, ids: any): boolean;
63
63
  export declare function dealCompleteTaskParam(commonEntity: any, isInit: any, pageContext: any, params?: any, operationResult?: any): boolean;
@@ -13,6 +13,7 @@ import { updateChartDatasources, getVariableValue, setVariableValue } from "../p
13
13
  import printLabelUtil from "./print-label.js";
14
14
  import { getTableNameByTableUuid } from "../table-utils.js";
15
15
  import { packageCustomRules, getWorkflowRules } from "./validator-util.js";
16
+ import { functions } from "../api/page-expose-util.js";
16
17
  const standardEvents = {
17
18
  // 表单标准事件保存save
18
19
  save: function(params) {
@@ -338,7 +339,8 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
338
339
  const button = configureObj.props.base;
339
340
  const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
340
341
  const backendUrl = pageContext.backendUrl;
341
- const viewModels = pageContext.entity.data;
342
+ const viewModels = functions.getFormViewData(pageContext);
343
+ console.log("exportFormReport----viewModels=", viewModels);
342
344
  const isPermission = button.isPermission === void 0 || button.isPermission === "true" || button.isPermission;
343
345
  const functionCodes = getPermissionCodes(configureObj, pageContext);
344
346
  const param = {
@@ -741,9 +743,9 @@ function dealAfterWithList(pageContext, configureObj, row, successTip) {
741
743
  });
742
744
  }
743
745
  }
744
- function refreshFormOrListPage(pageContext, configureObj) {
745
- let successOperation = configureObj.props.base.successOperation;
746
- console.log("refreshFormOrListPage22=====successOperation=", successOperation);
746
+ function refreshFormOrListPage(pageContext, configureObj, isRefreshWhenClosePopup) {
747
+ let successOperation = isRefreshWhenClosePopup ? "refresh" : configureObj.props.base.successOperation;
748
+ console.log("refreshFormOrListPage22=====successOperation=", successOperation, "isRefreshWhenClosePopup=", isRefreshWhenClosePopup);
747
749
  const buttonForPageType = getPageType(pageContext, configureObj);
748
750
  console.log("refreshFormOrListPage22=====buttonForPageType=", buttonForPageType);
749
751
  if (buttonForPageType && buttonForPageType === "list" && !successOperation) {
@@ -4,6 +4,7 @@ import { getComponentRef, getComponentRefByCode, getAllComponentRefs } from "../
4
4
  import { getI18n } from "agilebuilder-ui/src/utils/util";
5
5
  import { getAdditionalParamMap } from "./standard-event.js";
6
6
  import { isPromise } from "agilebuilder-ui/src/utils/common-util";
7
+ import { isWorkflowPage } from "../common-util.js";
7
8
  function setObjectPropRule(prop, rules, leafRule) {
8
9
  const rule = {};
9
10
  if (!rules) {
@@ -181,7 +182,7 @@ function validateDataModelFunc(pageContext, configureObj, isEnableRequired) {
181
182
  }
182
183
  function validateDataModel(isEnableRequired, dataModel, rules, pageContext) {
183
184
  if (isEnableRequired) {
184
- const isWorkflow = pageContext.workflowCode ? true : false;
185
+ const isWorkflow = isWorkflowPage(pageContext);
185
186
  if (isWorkflow) {
186
187
  return validateWorkflowFormDataModel(dataModel, pageContext, rules);
187
188
  } else {
@@ -69,6 +69,7 @@ export interface PageDesign extends Component {
69
69
  subTablePageInfo?: object;
70
70
  customEvents?: Array<any>;
71
71
  contextParam?: object;
72
+ systemtParam?: object;
72
73
  subTableWatchProps?: object;
73
74
  }
74
75
  /**
@@ -20,6 +20,12 @@ export declare function initComponentDataSources(component: Component, pageConte
20
20
  * @param dataSourceConfs 初始化数据配置参数
21
21
  */
22
22
  export declare function updateChartDatasources(pageContext: PageContext, dataSourceConfs: Array<any>, appendParams: any, isInit?: boolean): Promise<any>;
23
+ /**
24
+ * 更新指定uuid图表的数据
25
+ * @param pageContext 页面上下文
26
+ * @param componentUuid 组件uuid
27
+ */
28
+ export declare function updateChartDatasourcesByComponent(pageContext: PageContext, componentUuid: string): void;
23
29
  /**
24
30
  * 初始化数据源
25
31
  * @param pageContext 页面上下文
@@ -32,6 +38,18 @@ export declare function updateOptionDatasources(pageContext: PageContext, dataSo
32
38
  * @param configure
33
39
  */
34
40
  export declare function getOptionDatasFromPage(pageContext: PageContext, configure: Component): any;
41
+ /**
42
+ * 从页面缓存中获取查询到的选项组数据
43
+ * @param pageContext
44
+ * @param configure
45
+ */
46
+ export declare function getComponentOptionDatasFromPage(pageContext: PageContext, configureUuid: string): any;
47
+ /**
48
+ * 从页面缓存中获取查询到的选项组数据
49
+ * @param pageContext
50
+ * @param configure
51
+ */
52
+ export declare function getOptionDatasSourceMap(pageContext: PageContext): any;
35
53
  /**
36
54
  * 从页面缓存中获取查询到的统计图数据
37
55
  * @param pageContext
@@ -188,6 +188,14 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
188
188
  });
189
189
  });
190
190
  }
191
+ function updateChartDatasourcesByComponent(pageContext2, componentUuid) {
192
+ const chartDataSource = pageContext2.initChartServiceConfigs.find(
193
+ (item) => item.uuid === componentUuid
194
+ );
195
+ if (chartDataSource) {
196
+ updateChartDatasources(pageContext2, [chartDataSource], null, false);
197
+ }
198
+ }
191
199
  function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
192
200
  return new Promise((resolve, reject) => {
193
201
  if (!dataSourceConfs || dataSourceConfs.length == 0) {
@@ -235,12 +243,20 @@ function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
235
243
  });
236
244
  }
237
245
  function getOptionDatasFromPage(pageContext2, configure2) {
238
- if (!pageContext2 || !pageContext2.optionSourceMap || !configure2) {
239
- return [];
240
- }
241
- const cacheOptions = pageContext2.optionSourceMap[configure2.uuid];
246
+ return getComponentOptionDatasFromPage(pageContext2, configure2.uuid);
247
+ }
248
+ function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
249
+ const optionSourceMap = getOptionDatasSourceMap(pageContext2);
250
+ const cacheOptions = optionSourceMap[configureUuid];
242
251
  return cacheOptions ? cacheOptions : [];
243
252
  }
253
+ function getOptionDatasSourceMap(pageContext2) {
254
+ if (!pageContext2 || !pageContext2.optionSourceMap) {
255
+ return {};
256
+ }
257
+ const cacheOptions = pageContext2.optionSourceMap;
258
+ return cacheOptions ? cacheOptions : {};
259
+ }
244
260
  function getChartDatasFromPage(pageContext2, configure2) {
245
261
  if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure2) {
246
262
  return null;
@@ -471,7 +487,6 @@ function getValueFromSource(valueSource, paramName, paramType) {
471
487
  return getValueFromSource(childValue, newParamName, paramType);
472
488
  } else {
473
489
  if (paramType == "context") {
474
- console.log("newDate", paramName);
475
490
  if (paramName == "currentDate" || paramName == "currentTime") {
476
491
  return /* @__PURE__ */ new Date();
477
492
  } else if (paramName.startsWith("currentDate") && paramName.length > 11) {
@@ -662,8 +677,10 @@ export {
662
677
  formatVariableValue,
663
678
  getChartDatasFromPage,
664
679
  getComponentOptionConfigs,
680
+ getComponentOptionDatasFromPage,
665
681
  getFormPropName,
666
682
  getOptionDatasFromPage,
683
+ getOptionDatasSourceMap,
667
684
  getParamNames,
668
685
  getSizeConfig,
669
686
  getValueFromSource,
@@ -676,5 +693,6 @@ export {
676
693
  setVariableValue,
677
694
  setVariableValueWithProp,
678
695
  updateChartDatasources,
696
+ updateChartDatasourcesByComponent,
679
697
  updateOptionDatasources
680
698
  };
@@ -4,7 +4,7 @@ import { PageDimensions } from "./interfaces/page-design-types.js";
4
4
  import { setVariableValue, formatVariableValue, getFormPropName } from "./page-helper-util.js";
5
5
  import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
6
6
  import { functions } from "./api/page-expose-util.js";
7
- import { deepCopy } from "./common-util.js";
7
+ import { isWorkflowPage, deepCopy } from "./common-util.js";
8
8
  function queryPageDesignByCode(pageCode) {
9
9
  return http.get(
10
10
  window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
@@ -49,6 +49,10 @@ function convertToPageContext(pageDesign, pageRequest) {
49
49
  refercePropMap: (_a = pageDesign.runtime) == null ? void 0 : _a.refercePropMap,
50
50
  //当前表单页面中引用字段信息集合,get请求时需要使用,格式为{tableName:[字段名,.. ... ], tableName:[字段名,.. ... ]}
51
51
  subTableWatchProps: pageDesign.subTableWatchProps,
52
+ dataTypeMaps: pageDesign.dataTypeMaps,
53
+ // 列表页面时后台会传该属性到前端
54
+ isWorkflowEntity: pageDesign.isWorkflowEntity,
55
+ // 列表页面时后台会传该属性到前端。列表删除时会用到该属性。
52
56
  entity: {
53
57
  data: {},
54
58
  task: {},
@@ -56,7 +60,7 @@ function convertToPageContext(pageDesign, pageRequest) {
56
60
  //初始化request对象
57
61
  page: {},
58
62
  context: pageDesign.contextParam,
59
- system: {}
63
+ system: pageDesign.systemParam
60
64
  }
61
65
  };
62
66
  if (pageDesign.props && pageDesign.props.notIdInitializationList) {
@@ -74,6 +78,8 @@ function convertToPageContext(pageDesign, pageRequest) {
74
78
  if (variable.name) {
75
79
  if (variable.isArrayElement) {
76
80
  pageObj[variable.name] = [];
81
+ } else if (variable.defaultValue) {
82
+ pageObj[variable.name] = variable.defaultValue;
77
83
  } else {
78
84
  pageObj[variable.name] = void 0;
79
85
  }
@@ -277,17 +283,15 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
277
283
  tableRuntimes,
278
284
  additionalParamMapJson,
279
285
  pageCode,
280
- publishVersion
286
+ publishVersion,
287
+ pageType: pageDesign.pageType
281
288
  }
282
289
  );
283
290
  }
284
291
  function packageFormRules(pageContext, configure) {
285
- var _a, _b, _c;
292
+ var _a, _b;
286
293
  const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
287
- let isWorkflow = false;
288
- if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
289
- isWorkflow = pageContext.workflowCode ? true : false;
290
- }
294
+ let isWorkflow = isWorkflowPage(pageContext);
291
295
  let allFieldsDisabled = false;
292
296
  if (isWorkflow) {
293
297
  console.log(
@@ -298,7 +302,7 @@ function packageFormRules(pageContext, configure) {
298
302
  );
299
303
  if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
300
304
  const allFields = pageContext.fieldPermissionMap.get("all_fields");
301
- if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_b = configure.runtime) == null ? void 0 : _b.props)) {
305
+ if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_a = configure.runtime) == null ? void 0 : _a.props)) {
302
306
  configure.runtime.props.state = "disabled";
303
307
  allFieldsDisabled = true;
304
308
  }
@@ -338,7 +342,7 @@ function packageFormRules(pageContext, configure) {
338
342
  configure.runtime.props.state = "";
339
343
  }
340
344
  }
341
- if ((_c = configure.props) == null ? void 0 : _c.customRuleEvents) {
345
+ if ((_b = configure.props) == null ? void 0 : _b.customRuleEvents) {
342
346
  if (!pageContext.customRuleEvents) {
343
347
  pageContext.customRuleEvents = [];
344
348
  }
@@ -1,10 +1,7 @@
1
- import { getBaseUrl } from "./common-util.js";
2
- import http from "agilebuilder-ui/src/utils/request";
1
+ import "agilebuilder-ui/src/utils/common-util";
2
+ import "agilebuilder-ui/src/utils/util";
3
+ import "agilebuilder-ui/src/utils/request";
3
4
  import eventBus from "./eventBus.js";
4
- function getDataTypeMapRequest(backendUrl, tableName, isTest) {
5
- const baseUrl = getBaseUrl(backendUrl, isTest);
6
- return http.get(baseUrl + "/dsc/commons/tables/" + tableName + "/data-types");
7
- }
8
5
  function popupToPage(params) {
9
6
  const pageCode = params.pageContext && params.pageContext.code;
10
7
  console.log("弹框显示页面--popupToPage====params=", params);
@@ -22,7 +19,6 @@ function getTableNameByTableUuid(pageContext, tableUuid) {
22
19
  return tableConfigure && tableConfigure.props && tableConfigure.props.dataOrigin ? tableConfigure.props.dataOrigin.tableName : null;
23
20
  }
24
21
  export {
25
- getDataTypeMapRequest,
26
22
  getTableNameByTableUuid,
27
23
  popupToPage
28
24
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, createVNode, normalizeClass, unref, normalizeStyle, withCtx, Fragment, createTextVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
1
+ import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, createVNode, normalizeClass, unref, normalizeStyle, withCtx, Fragment, createTextVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
2
2
  import { SuperIcon } from "agilebuilder-ui";
3
3
  import { handleEvent } from "../../../../utils/events/event-util.js";
4
4
  import { $t } from "../../../../utils/i18n-util.js";
@@ -21,6 +21,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  function isButtongLoading() {
22
22
  return props.pageContext.canClick !== void 0 && props.pageContext.clickUuid !== void 0 ? !props.pageContext.canClick && props.pageContext.clickUuid === props.configure.uuid : false;
23
23
  }
24
+ onMounted(() => {
25
+ });
24
26
  return (_ctx, _cache) => {
25
27
  const _component_el_button = resolveComponent("el-button");
26
28
  return openBlock(), createElementBlock("span", _hoisted_1, [