super-page-runtime 2.1.64 → 2.1.67

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.
@@ -3,7 +3,7 @@ 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
- import { updateFormItemEditState, disabledAllFields } from "../events/validator-util.js";
6
+ import { updateFormItemEditState, disabledAllFields, dynamicControlTableEdit } from "../events/validator-util.js";
7
7
  import { getBaseUrl, deepCopy } from "../common-util.js";
8
8
  import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
9
9
  import { getFormModelFields, getModelFields } from "../page-init-util.js";
@@ -187,8 +187,10 @@ const functions = {
187
187
  * 控制表格编辑权限
188
188
  * @param pageContext 页面上下文
189
189
  * @param rules
190
+ * @param tableCode 列表的“自定义编码”配置
190
191
  */
191
- dynamicControlTableEdit(pageContext, rules) {
192
+ dynamicControlTableEdit(pageContext, rules, tableCode) {
193
+ dynamicControlTableEdit(pageContext, rules, tableCode);
192
194
  },
193
195
  /**
194
196
  * 调用服务流,
@@ -31,6 +31,7 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
31
31
  if ((_a = configure.runtime.dataConfig) == null ? void 0 : _a.resultSet) {
32
32
  setValueForVariableName(pageContext.entity, configure.runtime.dataConfig.resultSet, datas);
33
33
  }
34
+ configure.runtime.dataConfig.runtimeData = datas;
34
35
  let confGroups = configure.props ? configure.props.groups : null;
35
36
  if (!confGroups) {
36
37
  confGroups = [];
@@ -1015,6 +1015,7 @@ function downloadTemplateFunc(params) {
1015
1015
  window.open(baseUrl + "/dsc/commons/download-files" + param);
1016
1016
  }
1017
1017
  function doImportFinally(params, fileObj) {
1018
+ var _a;
1018
1019
  const pageContext = params.pageContext;
1019
1020
  const buttonConfigureObj = params.configureObj;
1020
1021
  const tableConfigure = params.tableConfigure;
@@ -1032,7 +1033,7 @@ function doImportFinally(params, fileObj) {
1032
1033
  if (pageContext.beanName) {
1033
1034
  param.append("beanName", pageContext.beanName);
1034
1035
  }
1035
- const listViewImportDuplicate = tableConfigure.props.listViewImportDuplicate;
1036
+ const listViewImportDuplicate = (_a = tableConfigure.props.importSetting) == null ? void 0 : _a.listViewImportDuplicate;
1036
1037
  if (listViewImportDuplicate) {
1037
1038
  param.append("importDuplicateRule", listViewImportDuplicate);
1038
1039
  }
@@ -15,5 +15,5 @@ export declare function i18nValidatePropRulesMessage(propRules: any, isResetMess
15
15
  export declare function getWorkflowRules(pageContext: any): any;
16
16
  export declare function updateFormItemEditState(pageContext: PageContext, customRules: any[]): void;
17
17
  export declare function disabledAllFields(pageContext: PageContext): void;
18
- export declare function dynamicControlTableEdit(pageContext: PageContext, customRules: any[]): void;
18
+ export declare function dynamicControlTableEdit(pageContext: PageContext, customRules: any[], tableCode?: any): void;
19
19
  export declare function updateComponentDisplayState(ref: any, item: any): void;
@@ -4,7 +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
+ import { isWorkflowPage, getListCode } from "../common-util.js";
8
8
  function setObjectPropRule(prop, rules, leafRule) {
9
9
  const rule = {};
10
10
  if (!rules) {
@@ -512,6 +512,24 @@ function disabledAllFields(pageContext) {
512
512
  updateComponentDisplayState(ref, { disabled: true });
513
513
  });
514
514
  }
515
+ function dynamicControlTableEdit(pageContext, customRules, tableCode) {
516
+ let gridRef;
517
+ let tableUuid;
518
+ if (tableCode) {
519
+ gridRef = getComponentRefByCode(pageContext, tableCode);
520
+ tableUuid = gridRef ? gridRef.getTableUuid() : null;
521
+ } else {
522
+ tableUuid = pageContext.tableUuids && pageContext.tableUuids.length > 0 ? pageContext.tableUuids[0] : null;
523
+ gridRef = tableUuid ? getComponentRef(pageContext, tableUuid) : null;
524
+ }
525
+ if (!gridRef) {
526
+ return;
527
+ }
528
+ const pageCode = pageContext.code;
529
+ const pageVersion = pageContext.version;
530
+ const listCode = getListCode(pageCode, pageVersion, tableUuid);
531
+ gridRef.dynamicControlTableEdit(pageContext, customRules, listCode);
532
+ }
515
533
  function updateComponentDisplayState(ref, item) {
516
534
  if (ref) {
517
535
  const configure = ref.getConfigure();
@@ -531,6 +549,7 @@ function updateComponentDisplayState(ref, item) {
531
549
  }
532
550
  export {
533
551
  disabledAllFields,
552
+ dynamicControlTableEdit,
534
553
  getWorkflowRules,
535
554
  i18nValidatePropRulesMessage,
536
555
  i18nValidateRulesMessage,
@@ -106,9 +106,18 @@ const standardFuncUrlMap = {
106
106
  label: "暂存",
107
107
  functions: [
108
108
  {
109
+ label: "暂存",
110
+ code: "save",
109
111
  funcType: "AUTHENTICATED",
110
112
  //公用
111
113
  path: "/workflow-commons$POST"
114
+ },
115
+ {
116
+ label: "修改",
117
+ code: "update",
118
+ funcType: "AUTHENTICATED",
119
+ //公用
120
+ path: "/workflow-commons$PUT"
112
121
  }
113
122
  ]
114
123
  },
@@ -1,7 +1,6 @@
1
1
  import { getParamNames, getValueFromVariable } from "../../../../utils/page-helper-util.js";
2
2
  import { getCustomFunc } from "../../../../utils/events/event-util.js";
3
3
  import { getMinValue, getMaxValue, getSumValue, getAvgValue } from "../../../../utils/charts/chart-util.js";
4
- import "element-plus/es/locale/index.mjs";
5
4
  class ExpressionEvaluator {
6
5
  static evaluate(pageContext, conditions, data2) {
7
6
  const expressions = conditions.map(
@@ -197,7 +196,6 @@ function getHeaderCellStyleUtil(data2, runtimeStyle, props) {
197
196
  }
198
197
  function getRowStyleUtil(data2, groupSummaryDataRowIndex, props) {
199
198
  const returnStyle = {};
200
- console.log("getRowStyleUtil---props.configure---", props.configure);
201
199
  if (props.configure.style.rowStyle) {
202
200
  for (let i = 0; i < props.configure.style.rowStyle.length; i++) {
203
201
  const rowStyle = props.configure.style.rowStyle[i];
@@ -219,13 +217,11 @@ function getRowStyleUtil(data2, groupSummaryDataRowIndex, props) {
219
217
  copyStyle(returnStyle, rowStyle);
220
218
  }
221
219
  } else {
222
- console.log("getRowStyleUtil---rowStyle---", rowStyle);
223
220
  copyStyle(returnStyle, rowStyle);
224
221
  }
225
222
  }
226
223
  }
227
224
  if (groupSummaryDataRowIndex && groupSummaryDataRowIndex.length > 0 && groupSummaryDataRowIndex.indexOf(data2.rowIndex) !== -1) {
228
- console.log("getRowStyleUtil---groupSummaryDataRowIndex---", groupSummaryDataRowIndex);
229
225
  const result = {};
230
226
  if (props.configure.style.collectStyle && props.configure.style.collectStyle.length > 0) {
231
227
  for (let i = 0; i < props.configure.style.collectStyle.length; i++) {
@@ -238,7 +234,6 @@ function getRowStyleUtil(data2, groupSummaryDataRowIndex, props) {
238
234
  }
239
235
  return result;
240
236
  }
241
- console.log("getRowStyleUtil---returnStyle---", returnStyle);
242
237
  return returnStyle;
243
238
  }
244
239
  function getCellStyleUtil(data2, cellStyles, props) {
@@ -246,30 +241,42 @@ function getCellStyleUtil(data2, cellStyles, props) {
246
241
  if (cellStyles) {
247
242
  for (let i = 0; i < cellStyles.length; i++) {
248
243
  const columnsStyleSetting = cellStyles[i];
249
- if (columnsStyleSetting.scopeFunc) {
250
- const func = getCustomFunc(props.pageContext, columnsStyleSetting.scopeFunc);
251
- if (func) {
252
- const funcResult = func.apply(func, [{ data: data2 }]);
253
- if (funcResult !== false) {
244
+ if (isSetStyle(columnsStyleSetting)) {
245
+ if (columnsStyleSetting.scopeFunc) {
246
+ const func = getCustomFunc(props.pageContext, columnsStyleSetting.scopeFunc);
247
+ if (func) {
248
+ const funcResult = func.apply(func, [{ data: data2 }]);
249
+ if (funcResult !== false) {
250
+ copyStyle(cellStyle, columnsStyleSetting);
251
+ }
252
+ }
253
+ } else if (columnsStyleSetting.matchingCondition) {
254
+ const result = ExpressionEvaluator.evaluate(
255
+ props.pageContext,
256
+ columnsStyleSetting.matchingCondition,
257
+ data2.row
258
+ );
259
+ if (result || result === void 0) {
254
260
  copyStyle(cellStyle, columnsStyleSetting);
255
261
  }
256
- }
257
- } else if (columnsStyleSetting.matchingCondition) {
258
- const result = ExpressionEvaluator.evaluate(
259
- props.pageContext,
260
- columnsStyleSetting.matchingCondition,
261
- data2.row
262
- );
263
- if (result || result === void 0) {
262
+ } else {
264
263
  copyStyle(cellStyle, columnsStyleSetting);
265
264
  }
266
- } else {
267
- copyStyle(cellStyle, columnsStyleSetting);
268
265
  }
269
266
  }
270
267
  }
271
268
  return cellStyle;
272
269
  }
270
+ function isSetStyle(columnsStyleSetting) {
271
+ let customStyle;
272
+ if (columnsStyleSetting.customStyle) {
273
+ customStyle = JSON.parse(columnsStyleSetting.customStyle);
274
+ }
275
+ if (columnsStyleSetting.style && Object.keys(columnsStyleSetting.style).length > 0 || customStyle && Object.keys(customStyle).length > 0) {
276
+ return true;
277
+ }
278
+ return false;
279
+ }
273
280
  function copyStyle(target, source) {
274
281
  Object.assign(target, source.style);
275
282
  if (source.customStyle) {
@@ -118,7 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
118
118
  isSql: true,
119
119
  extraParam: {
120
120
  beanName: pageContext.beanName,
121
- functionCode: permissionPrefix + ".list",
121
+ functionCode: permissionPrefix + ".listData",
122
122
  tableName,
123
123
  systemCode: systemCode2,
124
124
  // 系统编码传给列表数据后台请求
@@ -766,6 +766,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
766
766
  return gridRef.value.getTableSelectOptions(listCode);
767
767
  }
768
768
  }
769
+ function dynamicControlTableEdit(pageContext2, customRules, listCode2) {
770
+ if (gridRef.value) {
771
+ debugger;
772
+ gridRef.value.dynamicControlTableEdit(pageContext2, customRules, listCode2);
773
+ }
774
+ }
769
775
  __expose({
770
776
  refresh,
771
777
  createRow,
@@ -776,7 +782,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
776
782
  isDeleteChange,
777
783
  validatorSunTableListData,
778
784
  showMobileSearch,
779
- getTableSelectOptions
785
+ getTableSelectOptions,
786
+ dynamicControlTableEdit
780
787
  });
781
788
  return (_ctx, _cache) => {
782
789
  const _component_super_grid = resolveComponent("super-grid");
@@ -524,6 +524,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
524
524
  return gridRef.value.getTableSelectOptions(listCode);
525
525
  }
526
526
  }
527
+ function dynamicControlTableEdit(pageContext2, customRules, listCode2) {
528
+ if (gridRef.value) {
529
+ gridRef.value.dynamicControlTableEdit(pageContext2, customRules, listCode2);
530
+ }
531
+ }
527
532
  __expose({
528
533
  createRow,
529
534
  getSelections,
@@ -533,7 +538,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
533
538
  validatorSunTableListData,
534
539
  getValue,
535
540
  setValue,
536
- getTableSelectOptions
541
+ getTableSelectOptions,
542
+ dynamicControlTableEdit
537
543
  });
538
544
  return (_ctx, _cache) => {
539
545
  const _component_super_grid = resolveComponent("super-grid");
@@ -69,6 +69,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
69
  return gridRef.value.getTableSelectOptions();
70
70
  }
71
71
  }
72
+ function dynamicControlTableEdit(pageContext, customRules, listCode) {
73
+ if (gridRef.value) {
74
+ gridRef.value.dynamicControlTableEdit(pageContext, customRules, listCode);
75
+ }
76
+ }
77
+ function getTableUuid() {
78
+ return props.configure.uuid;
79
+ }
72
80
  __expose({
73
81
  refresh,
74
82
  createRow,
@@ -79,7 +87,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
79
87
  isDeleteChange,
80
88
  validatorSunTableListData,
81
89
  showMobileSearch,
82
- getTableSelectOptions
90
+ getTableSelectOptions,
91
+ dynamicControlTableEdit,
92
+ getTableUuid
83
93
  });
84
94
  return (_ctx, _cache) => {
85
95
  return openBlock(), createElementBlock("div", null, [
@@ -19,22 +19,60 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  const headerStyle = runtimeInfo.headerStyle;
20
20
  const titleExceedStyle = runtimeInfo.titleExceedStyle;
21
21
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
22
- if (designProperty.value.activeValue === void 0 || designProperty.value.activeValue === null) {
23
- designProperty.value.activeValue = "1";
22
+ let val = getVariableValue(entity, dynamicFields);
23
+ if (val !== void 0 && val !== null && (val + "" === "1" || val + "" === "0")) {
24
+ if (designProperty.value.activeValue === void 0 || designProperty.value.activeValue === null) {
25
+ designProperty.value.activeValue = "1";
26
+ }
27
+ if (designProperty.value.inactiveValue === void 0 || designProperty.value.inactiveValue === null) {
28
+ designProperty.value.inactiveValue = "0";
29
+ }
30
+ }
31
+ if (val !== void 0 && val !== null && (val + "" === "true" || val + "" === "false")) {
32
+ if (designProperty.value.activeValue === void 0 || designProperty.value.activeValue === null) {
33
+ designProperty.value.activeValue = "true";
34
+ }
35
+ if (designProperty.value.inactiveValue === void 0 || designProperty.value.inactiveValue === null) {
36
+ designProperty.value.inactiveValue = "false";
37
+ }
24
38
  }
25
- if (designProperty.value.inactiveValue === void 0 || designProperty.value.inactiveValue === null) {
26
- designProperty.value.inactiveValue = "0";
39
+ if (designProperty.value.activeValue === void 0 || designProperty.value.activeValue === null || designProperty.value.activeValue === "") {
40
+ designProperty.value.activeValue = true;
41
+ }
42
+ if (designProperty.value.inactiveValue === void 0 || designProperty.value.inactiveValue === null || designProperty.value.inactiveValue === "") {
43
+ designProperty.value.inactiveValue = false;
27
44
  }
28
45
  const switchStyle = runtimeInfo.switchStyle;
29
46
  const dynamicModelMethod = computed({
30
47
  get() {
31
- let val = getVariableValue(entity, dynamicFields);
32
- if (val !== void 0 && val !== null) {
33
- val = val + "";
48
+ let val2 = getVariableValue(entity, dynamicFields);
49
+ if (val2 !== void 0 && val2 !== null) {
50
+ if (designProperty.value.activeValue === true) {
51
+ if (val2 + "" === "1") {
52
+ val2 = true;
53
+ }
54
+ if (val2 + "" === "0") {
55
+ val2 = false;
56
+ }
57
+ } else {
58
+ val2 = val2 + "";
59
+ }
34
60
  }
35
- return val;
61
+ return val2;
36
62
  },
37
63
  set(value) {
64
+ if (value !== void 0 && value !== null) {
65
+ if (designProperty.value.activeValue === true) {
66
+ if (value + "" === "1") {
67
+ value = true;
68
+ }
69
+ if (value + "" === "0") {
70
+ value = false;
71
+ }
72
+ } else {
73
+ value = value + "";
74
+ }
75
+ }
38
76
  setVariableValue(entity, dynamicFields, value);
39
77
  }
40
78
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.64",
3
+ "version": "2.1.67",
4
4
  "description": "AgileBuilder super page runtime",
5
5
  "license": "ISC",
6
6
  "main": "dist/es/index.js",
@@ -48,7 +48,7 @@
48
48
  "@vitejs/plugin-vue-jsx": "^3.1.0",
49
49
  "@vue/eslint-config-prettier": "^8.0.0",
50
50
  "@vue/test-utils": "^2.4.4",
51
- "agilebuilder-ui": "1.0.90",
51
+ "agilebuilder-ui": "1.0.91",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",