super-page-runtime 2.1.40 → 2.1.42

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.
@@ -1,9 +1,9 @@
1
1
  import { setValueForVariableName } from "../page-helper-util.js";
2
- import { getComponentRefByCode, getAllComponentRefs } from "../global-refs.js";
2
+ import { getComponentRefByCode } 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 } from "../events/standard-event.js";
6
- import { i18nValidatePropRulesMessage } from "../events/validator-util.js";
6
+ import { updateFormItemEditState, dsiabledAllFields } from "../events/validator-util.js";
7
7
  import { getBaseUrl } from "../common-util.js";
8
8
  import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
9
9
  const functions = {
@@ -168,29 +168,27 @@ const functions = {
168
168
  }
169
169
  ]
170
170
  */
171
- dynamicControlFormEdit: function(pageContext, settings, isInit) {
171
+ dynamicControlFormEdit: function(pageContext, rules, isInit) {
172
172
  if (isInit) {
173
- packageInitInfo(pageContext, "dynamicControlFormEdit", settings);
173
+ packageInitInfo(pageContext, "dynamicControlFormEdit", rules);
174
174
  } else {
175
- if (!pageContext.customRules) {
176
- pageContext.customRules = {};
177
- }
178
- for (let i = 0; i < settings.length; i++) {
179
- const item = settings[i];
180
- if (!item.name) {
181
- continue;
182
- }
183
- const allFields = "_all_fields";
184
- if (item.name === allFields) {
185
- packageAllFeildsRules(pageContext, item);
186
- break;
187
- } else {
188
- const ref = getComponentRefByCode(pageContext, item.name);
189
- packageOneFeildRules(pageContext, item, item.name, ref);
190
- }
191
- }
175
+ updateFormItemEditState(pageContext, rules);
192
176
  }
193
177
  },
178
+ /**
179
+ * 禁用所有字段
180
+ * @param pageContext 页面上下文
181
+ */
182
+ dsiabledAllFields(pageContext) {
183
+ dsiabledAllFields(pageContext);
184
+ },
185
+ /**
186
+ * 控制表格编辑权限
187
+ * @param pageContext 页面上下文
188
+ * @param rules
189
+ */
190
+ dynamicControlTableEdit(pageContext, rules) {
191
+ },
194
192
  /**
195
193
  * 调用服务流,
196
194
  * @param pageContext
@@ -227,8 +225,9 @@ const functions = {
227
225
  openPage: function(pageContext, openParam) {
228
226
  eventBus.$emit(pageContext.code + "_open-dialog", {
229
227
  pageContext,
230
- eventParams: {},
231
- configureObj: { props: { linkPage: openParam } }
228
+ eventParams: openParam.eventParams,
229
+ configureObj: { props: { linkPage: openParam } },
230
+ jumpPageSetting: openParam.jumpPageSetting
232
231
  });
233
232
  },
234
233
  /**
@@ -309,43 +308,12 @@ const functions = {
309
308
  // 是否是移动端
310
309
  isMobile() {
311
310
  return isMobileBrowser();
311
+ },
312
+ // 根据编码获取组件引用对象
313
+ getComponentRefByCode(pageContext, code) {
314
+ return getComponentRefByCode(pageContext, code);
312
315
  }
313
316
  };
314
- function packageAllFeildsRules(pageContext, item) {
315
- const allComponetRefs = getAllComponentRefs(pageContext);
316
- if (allComponetRefs) {
317
- const props = Object.keys(allComponetRefs);
318
- props.forEach((propName) => {
319
- const componentRef = allComponetRefs[propName];
320
- packageOneFeildRules(pageContext, item, propName, componentRef);
321
- });
322
- }
323
- }
324
- function packageOneFeildRules(pageContext, item, propName, ref) {
325
- if (propName) {
326
- if (item.rules) {
327
- i18nValidatePropRulesMessage(item.rules, false);
328
- pageContext.customRules[propName] = item.rules;
329
- } else {
330
- pageContext.customRules[propName] = [];
331
- }
332
- }
333
- if (ref) {
334
- const configure = ref.getConfigure();
335
- if (item.show !== void 0) {
336
- item.show ? ref.show() : ref.hide();
337
- }
338
- if (item.required !== void 0) {
339
- configure.runtime.props.required = item.required;
340
- }
341
- if (item.readonly !== void 0) {
342
- item.readonly ? configure.runtime.props.state = "readonly" : configure.runtime.props.state = "enabled";
343
- }
344
- if (item.disabled !== void 0) {
345
- item.disabled ? configure.runtime.props.state = "disabled" : configure.runtime.props.state = "enabled";
346
- }
347
- }
348
- }
349
317
  function packageInitInfo(pageContext, type, settings) {
350
318
  if (!pageContext.initInfo) {
351
319
  pageContext.initInfo = {};
@@ -1,3 +1,5 @@
1
+ import { PageContext } from '../interfaces/page-design-types';
2
+
1
3
  export declare function setObjectPropRule(prop: any, rules: any, leafRule: any): {};
2
4
  export declare function validator(entity: any, rules: any, columns: any, rowIndex: any, isSql: any): any;
3
5
  export declare function validateDataModelFunc(pageContext: any, configureObj: any, isEnableRequired: any): Promise<unknown>;
@@ -11,3 +13,7 @@ export declare function packageCustomRules(orgCustomRules: any, orgRules: any):
11
13
  export declare function i18nValidateRulesMessage(rules: any): {};
12
14
  export declare function i18nValidatePropRulesMessage(propRules: any, isResetMessage: boolean): void;
13
15
  export declare function getWorkflowRules(pageContext: any): any;
16
+ export declare function updateFormItemEditState(pageContext: PageContext, customRules: any[]): void;
17
+ export declare function dsiabledAllFields(pageContext: PageContext): void;
18
+ export declare function dynamicControlTableEdit(pageContext: PageContext, customRules: any[]): void;
19
+ export declare function updateComponentDisplayState(ref: any, item: any): void;
@@ -1,6 +1,6 @@
1
1
  import Validator from "async-validator";
2
2
  import { ElMessage } from "element-plus";
3
- import { getComponentRef } from "../global-refs.js";
3
+ import { getComponentRef, getComponentRefByCode, getAllComponentRefs } from "../global-refs.js";
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";
@@ -183,7 +183,7 @@ function validateDataModel(isEnableRequired, dataModel, rules, pageContext) {
183
183
  if (isEnableRequired) {
184
184
  const isWorkflow = pageContext.workflowCode ? true : false;
185
185
  if (isWorkflow) {
186
- return validateWorkflowFormDataModel(dataModel, pageContext);
186
+ return validateWorkflowFormDataModel(dataModel, pageContext, rules);
187
187
  } else {
188
188
  return validateCommonFormDataModel(dataModel, pageContext, rules);
189
189
  }
@@ -193,101 +193,103 @@ function validateDataModel(isEnableRequired, dataModel, rules, pageContext) {
193
193
  });
194
194
  }
195
195
  }
196
- function validateWorkflowFormDataModel(dataModel, pageContext) {
196
+ function validateWorkflowFormDataModel(dataModel, pageContext, rules) {
197
197
  return new Promise((resolve, reject) => {
198
198
  const additionalParamMap = getAdditionalParamMap(pageContext);
199
199
  const contextParameter = pageContext.entity.context;
200
200
  const taskParamMap = pageContext.entity.task;
201
201
  const isSql = true;
202
202
  const subTablePageInfo = pageContext.subTablePageInfo;
203
- let result = false;
204
- const handleModels = JSON.parse(JSON.stringify(dataModel));
205
- const rules = pageContext.rules;
206
- if (!rules || Object.keys(rules).length === 0) {
207
- result = true;
208
- } else {
209
- result = validator(handleModels, rules, null, null, true);
210
- }
211
- if (result === true) {
212
- const workflowFieldPermissionRules = pageContext.workflowRules;
213
- if (!workflowFieldPermissionRules) {
214
- result = true;
215
- } else {
216
- result = window["$vueApp"].config.globalProperties.$formValidator(
217
- dataModel,
218
- workflowFieldPermissionRules,
219
- isSql,
220
- additionalParamMap,
221
- taskParamMap,
222
- contextParameter,
223
- subTablePageInfo
224
- );
225
- }
226
- if (result !== true) {
227
- ElMessage({
228
- showClose: true,
229
- message: result + "",
230
- type: "warning"
231
- });
232
- resolve(false);
233
- } else {
234
- const validatorResult = [];
235
- const customUuids = pageContext.customValidatorUuids;
236
- if (customUuids) {
237
- customUuids.forEach((componentUuid) => {
238
- const customRef = getComponentRef(pageContext, componentUuid);
239
- if (customRef && customRef.validator) {
240
- validatorResult.push(customRef.validator());
241
- }
242
- });
203
+ validateCommon(dataModel, pageContext, rules).then((validateResult) => {
204
+ if (validateResult) {
205
+ let result = validateResult;
206
+ const workflowFieldPermissionRules = pageContext.workflowRules;
207
+ if (!workflowFieldPermissionRules) {
208
+ result = true;
209
+ } else {
210
+ result = window["$vueApp"].config.globalProperties.$formValidator(
211
+ dataModel,
212
+ workflowFieldPermissionRules,
213
+ isSql,
214
+ additionalParamMap,
215
+ taskParamMap,
216
+ contextParameter,
217
+ subTablePageInfo
218
+ );
243
219
  }
244
- if (validatorResult && validatorResult.length > 0) {
245
- Promise.all(validatorResult).then((values) => {
246
- if (values.includes(false)) {
247
- resolve(false);
248
- } else {
249
- if (Object.keys(dataModel).indexOf("validateErrorField") >= 0) {
250
- delete dataModel.validateErrorField;
251
- }
252
- resolve(dataModel);
253
- }
220
+ if (result !== true) {
221
+ ElMessage({
222
+ showClose: true,
223
+ message: result + "",
224
+ type: "warning"
254
225
  });
226
+ resolve(false);
255
227
  } else {
256
228
  if (Object.keys(dataModel).indexOf("validateErrorField") >= 0) {
257
229
  delete dataModel.validateErrorField;
258
230
  }
259
231
  resolve(dataModel);
260
232
  }
233
+ } else {
234
+ reject(
235
+ new Error(getI18n().t("superPageRuntimeMessage.formDataVerificationFailed")).message
236
+ );
261
237
  }
238
+ }).catch((error) => {
239
+ reject(error);
240
+ });
241
+ });
242
+ }
243
+ function validateCustomRefValidator(pageContext) {
244
+ return new Promise((resolve, reject) => {
245
+ const validatorResult = [];
246
+ const customUuids = pageContext.customValidatorUuids;
247
+ if (customUuids) {
248
+ customUuids.forEach((componentUuid) => {
249
+ const customRef = getComponentRef(pageContext, componentUuid);
250
+ if (customRef && customRef.validator) {
251
+ validatorResult.push(customRef.validator());
252
+ }
253
+ });
254
+ }
255
+ if (validatorResult && validatorResult.length > 0) {
256
+ Promise.all(validatorResult).then((values) => {
257
+ if (values.includes(false)) {
258
+ resolve(false);
259
+ } else {
260
+ resolve(true);
261
+ }
262
+ });
262
263
  } else {
263
- reject(new Error(getI18n().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
264
+ resolve(true);
264
265
  }
265
266
  });
266
267
  }
267
- function validateCommonFormDataModel(dataModel, pageContext, rules) {
268
+ function validateCommon(dataModel, pageContext, rules) {
268
269
  return new Promise((resolve, reject) => {
269
270
  const handleModels = JSON.parse(JSON.stringify(dataModel));
270
271
  if (!rules || Object.keys(rules).length === 0) {
271
- resolve(handleModels);
272
+ resolve(true);
272
273
  } else {
273
274
  const validateEntityResult = validator(handleModels, rules, null, null, true);
274
275
  if (validateEntityResult === true) {
275
276
  const validateResult = validateSubTables(pageContext);
276
277
  if (validateResult === true) {
277
- if (Object.keys(handleModels).indexOf("validateErrorField") >= 0) {
278
- delete handleModels.validateErrorField;
279
- }
280
278
  const customRuleResult = validateCustomRuleEvents(pageContext);
281
279
  if (customRuleResult && isPromise(customRuleResult)) {
282
280
  customRuleResult.then((result) => {
283
281
  if (result) {
284
- resolve(handleModels);
282
+ validateCustomRefValidator(pageContext).then((customRefValidResult) => {
283
+ resolve(customRefValidResult);
284
+ });
285
285
  } else {
286
286
  resolve(false);
287
287
  }
288
288
  });
289
289
  } else {
290
- resolve(handleModels);
290
+ validateCustomRefValidator(pageContext).then((customRefValidResult) => {
291
+ resolve(customRefValidResult);
292
+ });
291
293
  }
292
294
  } else {
293
295
  reject(
@@ -302,6 +304,23 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
302
304
  }
303
305
  });
304
306
  }
307
+ function validateCommonFormDataModel(dataModel, pageContext, rules) {
308
+ return new Promise((resolve, reject) => {
309
+ validateCommon(dataModel, pageContext, rules).then((validateResult) => {
310
+ if (validateResult) {
311
+ const handleModels = JSON.parse(JSON.stringify(dataModel));
312
+ if (Object.keys(handleModels).indexOf("validateErrorField") >= 0) {
313
+ delete handleModels.validateErrorField;
314
+ }
315
+ resolve(handleModels);
316
+ } else {
317
+ resolve(false);
318
+ }
319
+ }).catch((error) => {
320
+ reject(error);
321
+ });
322
+ });
323
+ }
305
324
  function packageCustomRules(orgCustomRules, orgRules) {
306
325
  if (!orgCustomRules) {
307
326
  return orgRules;
@@ -467,12 +486,57 @@ function validateCustomRuleEvents(pageContext) {
467
486
  }
468
487
  return null;
469
488
  }
489
+ function updateFormItemEditState(pageContext, customRules) {
490
+ if (!customRules) {
491
+ return;
492
+ }
493
+ const formatCustomRules = {};
494
+ customRules.forEach((rule) => {
495
+ const { name, rules: rules2 } = rule;
496
+ formatCustomRules[name] = rules2;
497
+ });
498
+ let rules = pageContext.rules ? pageContext.rules : {};
499
+ rules = packageCustomRules(formatCustomRules, rules);
500
+ pageContext.rules = rules;
501
+ let workflowRules = pageContext.workflowRules ? pageContext.workflowRules : {};
502
+ workflowRules = packageCustomRules(formatCustomRules, workflowRules);
503
+ pageContext.workflowRules = workflowRules;
504
+ customRules.forEach((item) => {
505
+ const ref = getComponentRefByCode(pageContext, item.name);
506
+ updateComponentDisplayState(ref, item);
507
+ });
508
+ }
509
+ function dsiabledAllFields(pageContext) {
510
+ getAllComponentRefs(pageContext).forEach((ref) => {
511
+ updateComponentDisplayState(ref, { disabled: true });
512
+ });
513
+ }
514
+ function updateComponentDisplayState(ref, item) {
515
+ if (ref) {
516
+ const configure = ref.getConfigure();
517
+ if (item.show !== void 0) {
518
+ item.show ? ref.show() : ref.hide();
519
+ }
520
+ if (item.required !== void 0) {
521
+ configure.runtime.props.required = item.required;
522
+ }
523
+ if (item.readonly !== void 0) {
524
+ item.readonly ? configure.runtime.props.state = "readonly" : configure.runtime.props.state = "enabled";
525
+ }
526
+ if (item.disabled !== void 0) {
527
+ item.disabled ? configure.runtime.props.state = "disabled" : configure.runtime.props.state = "enabled";
528
+ }
529
+ }
530
+ }
470
531
  export {
532
+ dsiabledAllFields,
471
533
  getWorkflowRules,
472
534
  i18nValidatePropRulesMessage,
473
535
  i18nValidateRulesMessage,
474
536
  packageCustomRules,
475
537
  setObjectPropRule,
538
+ updateComponentDisplayState,
539
+ updateFormItemEditState,
476
540
  validateDataModelFunc,
477
541
  validator
478
542
  };
@@ -88,7 +88,7 @@ export interface PageContext extends Component {
88
88
  tableAlias?: string;
89
89
  workflowCode?: string;
90
90
  workflowVersion?: number;
91
- rules?: object;
91
+ rules?: any;
92
92
  tableUuids?: Array<any>;
93
93
  listCodesMap?: object;
94
94
  formNoRuleCode?: string;
@@ -303,12 +303,6 @@ function packageFormRules(pageContext, configure) {
303
303
  allFieldsDisabled = true;
304
304
  }
305
305
  }
306
- const requiredRules = configure.props && configure.props.rules ? configure.props.rules.filter((item) => item.required) : null;
307
- if (requiredRules && requiredRules.length > 0) {
308
- requiredRules.forEach((item) => {
309
- item.required = false;
310
- });
311
- }
312
306
  }
313
307
  if (prop) {
314
308
  const propName = getFormPropName(prop);
@@ -1,6 +1,7 @@
1
- import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx } from "vue";
1
+ import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock } from "vue";
2
2
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
3
3
  import { getChartDatasFromPage } from "../../../../utils/page-helper-util.js";
4
+ import { getCustomFunc } from "../../../../utils/events/event-util.js";
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  __name: "table-runtime",
6
7
  props: {
@@ -19,37 +20,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
20
  },
20
21
  setup(__props, { expose: __expose }) {
21
22
  const props = __props;
22
- const tableData = [
23
- {
24
- date: "2016-05-03",
25
- name: "Tom",
26
- address: "No. 189, Grove St, Los Angeles"
27
- },
28
- {
29
- date: "2016-05-02",
30
- name: "Tom",
31
- address: "No. 189, Grove St, Los Angeles"
32
- },
33
- {
34
- date: "2016-05-04",
35
- name: "Tom",
36
- address: "No. 189, Grove St, Los Angeles"
37
- },
38
- {
39
- date: "2016-05-01",
40
- name: "Tom",
41
- address: "No. 189, Grove St, Los Angeles"
42
- }
43
- ];
44
23
  const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
24
+ debugger;
45
25
  const runtimeStyle = runtimeInfo.style;
46
26
  const runtimeClass = runtimeInfo.class;
47
27
  const dataConfig = runtimeInfo.dataConfig;
48
28
  const headerInfo = runtimeInfo.headerInfo ? runtimeInfo.headerInfo : {};
49
- props.configure.props ? props.configure.props.drillEndTrigger : null;
50
29
  const headerRef = ref(null);
51
- runtimeInfo.chartOption;
52
- debugger;
30
+ const tableData = ref([]);
31
+ const tableColumns = ref([]);
32
+ const customColumnModels = ref(false);
33
+ if (props.configure.props.modelCustom) {
34
+ customColumnModels.value = true;
35
+ } else {
36
+ tableColumns.value = props.configure.items;
37
+ }
53
38
  onMounted(() => {
54
39
  const resultData = getChartDatasFromPage(props.pageContext, props.configure);
55
40
  if (resultData) {
@@ -69,6 +54,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
54
  console.log("重复更新!", resultData);
70
55
  return;
71
56
  }
57
+ if (customColumnModels.value) {
58
+ const func = getCustomFunc(props.pageContext, props.configure.props.modelCustom);
59
+ if (func) {
60
+ func.apply(func, [
61
+ {
62
+ pageContext: props.pageContext,
63
+ configureObj: props.configure,
64
+ value: resultData
65
+ }
66
+ ]);
67
+ }
68
+ }
69
+ if (props.configure.serviceDataField && resultData.result) {
70
+ tableData.value = resultData.result[props.configure.serviceDataField];
71
+ } else {
72
+ tableData.value = [];
73
+ }
72
74
  resultData.hasRender = true;
73
75
  dataConfig.autoRefresh = false;
74
76
  }
@@ -96,27 +98,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
98
  [vShow, unref(headerInfo).showHeader]
97
99
  ]),
98
100
  createVNode(_component_el_table, {
99
- data: tableData,
101
+ data: tableData.value,
100
102
  style: { "width": "100%" }
101
103
  }, {
102
104
  default: withCtx(() => [
103
- createVNode(_component_el_table_column, {
104
- prop: "date",
105
- label: "Date",
106
- width: "180"
107
- }),
108
- createVNode(_component_el_table_column, {
109
- prop: "name",
110
- label: "Name",
111
- width: "180"
112
- }),
113
- createVNode(_component_el_table_column, {
114
- prop: "address",
115
- label: "Address"
116
- })
105
+ (openBlock(true), createElementBlock(Fragment, null, renderList(tableColumns.value, (column, index) => {
106
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
107
+ column.props.base.prop === "$index" ? (openBlock(), createBlock(_component_el_table_column, {
108
+ key: 0,
109
+ label: column.props.base.name,
110
+ type: "index",
111
+ align: "center",
112
+ "header-align": "center",
113
+ width: "80"
114
+ }, null, 8, ["label"])) : (openBlock(), createBlock(_component_el_table_column, {
115
+ key: 1,
116
+ prop: column.props.base.prop,
117
+ width: column.props.base.width ? column.props.base.width : "200",
118
+ label: column.props.base.name,
119
+ "header-align": column.props.base.headerAlign,
120
+ align: column.props.base.align,
121
+ fixed: column.props.base.fixed ? column.props.base.fixed : false
122
+ }, null, 8, ["prop", "width", "label", "header-align", "align", "fixed"]))
123
+ ], 64);
124
+ }), 128))
117
125
  ]),
118
126
  _: 1
119
- })
127
+ }, 8, ["data"])
120
128
  ], 6);
121
129
  };
122
130
  }
@@ -200,6 +200,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
200
200
  }
201
201
  }
202
202
  myButtonProps.label = myButtonProps.title;
203
+ myButtonProps.sourceButton = { uuid: buttonConfigure.uuid };
203
204
  myButtonSet["props"] = myButtonProps;
204
205
  myButtonSet["onClick"] = getOperationButtonClickEvent(buttonConfigure);
205
206
  operationButtons.push(myButtonSet);
@@ -207,7 +208,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
207
208
  if (!options.operations) {
208
209
  options.operations = {};
209
210
  }
210
- debugger;
211
211
  options.operations.operation = operationButtons;
212
212
  }
213
213
  }
@@ -297,13 +297,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
297
297
  onClick = editRow;
298
298
  } else if (eventName === "lineEditDelete") {
299
299
  onClick = deleteRow;
300
- } else {
301
- onClick = customButtonClick;
302
300
  }
303
301
  if (!onClick) {
304
302
  onClick = function() {
305
303
  };
306
304
  }
305
+ } else {
306
+ operationButtonObj.value[buttonConfigure.uuid] = buttonConfigure;
307
+ onClick = customButtonClick;
307
308
  }
308
309
  return onClick;
309
310
  }
@@ -584,7 +585,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
584
585
  rowIndex,
585
586
  button
586
587
  };
587
- const buttonConfigure = operationButtonObj.value["xxx"];
588
+ debugger;
589
+ const buttonConfigure = operationButtonObj.value[button.sourceButton.uuid];
588
590
  const tableConfigure = configure;
589
591
  buttonConfigure.props.base.tableUuid = tableConfigure.uuid;
590
592
  getHandleEvent(null, pageContext, buttonConfigure, "click", otherParams);
@@ -2,7 +2,7 @@ import { defineComponent, computed, ref, onMounted, onUnmounted, resolveComponen
2
2
  import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
3
  import { getVariableValue, setVariableValue, getFormPropName, setVariableValueWithProp } from "../../../../utils/page-helper-util.js";
4
4
  import { handleEvent } from "../../../../utils/events/event-util.js";
5
- import { packageCustomRules } from "../../../../utils/events/validator-util.js";
5
+ import { updateFormItemEditState } from "../../../../utils/events/validator-util.js";
6
6
  import { getListCode } from "../../../../utils/common-util.js";
7
7
  import { getComponentRef } from "../../../../utils/global-refs.js";
8
8
  import { getAdditionalParamMap } from "../../../../utils/events/standard-event.js";
@@ -46,23 +46,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
46
  props.configure.props && props.configure.props.base ? props.configure.props.base.name : null
47
47
  );
48
48
  console.log("自定义控件----componentName=", componentName, "designProperty=", designProperty);
49
- if (!props.pageContext.customValidatorUuids) {
50
- props.pageContext.customValidatorUuids = [];
49
+ if (props.configure.props.verification.custom && props.configure.props.verification.custom.enabled) {
50
+ if (!props.pageContext.customValidatorUuids) {
51
+ props.pageContext.customValidatorUuids = [];
52
+ }
53
+ props.pageContext.customValidatorUuids.push(props.configure.uuid);
51
54
  }
52
- props.pageContext.customValidatorUuids.push(props.configure.uuid);
53
55
  function customControlSetValue(prop, value) {
54
56
  setVariableValueWithProp(entity, prop, value);
55
57
  }
56
58
  function setCustomvalidateRules(customRules) {
57
- if (!customRules) {
58
- return;
59
- }
60
- let rules = props.pageContext.rules ? props.pageContext.rules : {};
61
- rules = packageCustomRules(customRules, rules);
62
- props.pageContext.rules = rules;
63
- let workflowRules = props.pageContext.workflowRules ? props.pageContext.workflowRules : {};
64
- workflowRules = packageCustomRules(customRules, workflowRules);
65
- props.pageContext.workflowRules = workflowRules;
59
+ updateFormItemEditState(props.pageContext, customRules);
66
60
  }
67
61
  function restoreGridEdit() {
68
62
  const tableUuids = props.pageContext.tableUuids;
@@ -91,10 +85,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
91
85
  setVariableValue(entity, dynamicFields, value);
92
86
  });
93
87
  eventBus.$on(componentId.value + "-pickFileDone", (data) => {
94
- console.log("superPage4444---pickFileDone--componentId.value=", componentId.value, "data=", data);
88
+ console.log(
89
+ "superPage4444---pickFileDone--componentId.value=",
90
+ componentId.value,
91
+ "data=",
92
+ data
93
+ );
95
94
  customRef.value.pickFileDone(data);
96
95
  });
97
96
  });
97
+ function handleCustomEvent(eventType) {
98
+ handleEvent(dynamicModelMethod.value, props.pageContext, props.configure, eventType);
99
+ }
98
100
  onUnmounted(() => {
99
101
  eventBus.$off(componentId.value + "-scanDone");
100
102
  eventBus.$off(componentId.value + "-pickFileDone");
@@ -136,11 +138,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
136
138
  onSetEntityValue: customControlSetValue,
137
139
  onSetCustomRules: setCustomvalidateRules,
138
140
  onRestoreGridEdit: restoreGridEdit,
139
- onInput: _cache[1] || (_cache[1] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "input")),
140
- onChange: _cache[2] || (_cache[2] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "change")),
141
- onClick: _cache[3] || (_cache[3] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "click")),
142
- onBlur: _cache[4] || (_cache[4] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "blur")),
143
- onFocus: _cache[5] || (_cache[5] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "focus"))
141
+ onHandleEvent: handleCustomEvent,
142
+ onChange: _cache[1] || (_cache[1] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "change"))
144
143
  }, null, 40, ["size", "entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))
145
144
  ])) : createCommentVNode("", true)
146
145
  ]),
@@ -156,18 +155,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
156
155
  prop: unref(getFormPropName)(_ctx.configure.props && _ctx.configure.props.base ? _ctx.configure.props.base.prop : null),
157
156
  "custom-params": unref(customParams),
158
157
  modelValue: dynamicModelMethod.value,
159
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => dynamicModelMethod.value = $event),
158
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => dynamicModelMethod.value = $event),
160
159
  disabled: designProperty.value.state === "disabled",
161
160
  "additional-param-map": unref(additionalParamMap),
162
161
  "component-id": componentId.value,
163
162
  onSetEntityValue: customControlSetValue,
164
163
  onSetCustomRules: setCustomvalidateRules,
165
164
  onRestoreGridEdit: restoreGridEdit,
166
- onInput: _cache[7] || (_cache[7] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "input")),
167
- onChange: _cache[8] || (_cache[8] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "change")),
168
- onClick: _cache[9] || (_cache[9] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "click")),
169
- onBlur: _cache[10] || (_cache[10] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "blur")),
170
- onFocus: _cache[11] || (_cache[11] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "focus"))
165
+ onHandleEvent: handleCustomEvent,
166
+ onChange: _cache[3] || (_cache[3] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "change"))
171
167
  }, null, 40, ["entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))
172
168
  ])) : createCommentVNode("", true);
173
169
  };
@@ -132,16 +132,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
132
132
  }, 200);
133
133
  }
134
134
  function optionChange(value) {
135
+ let selItems = null;
136
+ if (listOptions.value && value != void 0 && value != null) {
137
+ selItems = listOptions.value.filter((item) => {
138
+ return Array.isArray(value) ? value.includes(item.value) : value === item.value;
139
+ });
140
+ }
135
141
  if (autoSets.length > 0) {
136
- let selItems = null;
137
- if (listOptions.value && value != void 0 && value != null) {
138
- selItems = listOptions.value.filter((item) => {
139
- return Array.isArray(value) ? value.includes(item.value) : value === item.value;
140
- });
141
- }
142
142
  autoSetAfterSelect(props.configure, props.pageContext, autoSets, selItems);
143
143
  }
144
- handleFormEvent(value, props.pageContext, props.configure, "change");
144
+ let selectItem;
145
+ if (selItems && selItems.length > 0) {
146
+ selectItem = selItems[0];
147
+ }
148
+ let otherParams = {};
149
+ if (selectItem) {
150
+ otherParams = { extendParams: selectItem };
151
+ }
152
+ handleFormEvent(value, props.pageContext, props.configure, "change", otherParams);
145
153
  }
146
154
  function updateOptions(newOptions) {
147
155
  listOptions.value = newOptions ? newOptions : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.40",
3
+ "version": "2.1.42",
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.76",
51
+ "agilebuilder-ui": "1.0.82",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",