super-page-runtime 2.0.86 → 2.0.91

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.
@@ -296,7 +296,8 @@ function formatAdditionalParamMapIds(ids) {
296
296
  ids = ids.split(",");
297
297
  } else if (typeof ids === "number") {
298
298
  ids = [ids];
299
- } else ;
299
+ } else
300
+ ;
300
301
  }
301
302
  return ids;
302
303
  }
@@ -1204,18 +1204,17 @@ function workflowSaveFunc(params) {
1204
1204
  function dealCompleteTaskParam(commonEntity, isInit, pageContext, params, operationResult) {
1205
1205
  const pageCode = pageContext.code;
1206
1206
  const pageVersion = pageContext.version;
1207
- const formParam = commonEntity;
1208
1207
  let taskId;
1209
- if (formParam) {
1210
- if (isInit && formParam.entity) {
1211
- pageContext.entity.data = formParam.entity;
1208
+ if (commonEntity) {
1209
+ if (isInit) {
1212
1210
  pageContext.initFormNo = commonEntity.formNo;
1213
1211
  pageContext.emailTemplateCode = commonEntity.emailTemplateCode;
1214
1212
  }
1215
- if (formParam.entity) {
1216
- cacheFormDataId(formParam.entity.id || formParam.entity.ID, pageContext);
1213
+ if (commonEntity.entity) {
1214
+ pageContext.entity.data = commonEntity.entity;
1215
+ cacheFormDataId(commonEntity.entity.id || commonEntity.entity.ID, pageContext);
1217
1216
  }
1218
- const completeTaskResult = formParam.completeTaskResult;
1217
+ const completeTaskResult = commonEntity.completeTaskResult;
1219
1218
  if (completeTaskResult) {
1220
1219
  const completeTaskTipType = completeTaskResult.completeTaskTipType;
1221
1220
  if (completeTaskTipType && completeTaskTipType === "MESSAGE") {
@@ -1228,8 +1227,8 @@ function dealCompleteTaskParam(commonEntity, isInit, pageContext, params, operat
1228
1227
  return false;
1229
1228
  }
1230
1229
  }
1231
- if (formParam.completeTaskParam) {
1232
- const completeTaskParam = formParam.completeTaskParam;
1230
+ if (commonEntity.completeTaskParam) {
1231
+ const completeTaskParam = commonEntity.completeTaskParam;
1233
1232
  taskId = completeTaskParam.taskId;
1234
1233
  if (params) {
1235
1234
  params.taskId = taskId;
@@ -1243,8 +1242,8 @@ function dealCompleteTaskParam(commonEntity, isInit, pageContext, params, operat
1243
1242
  if (!pageContext.entity) {
1244
1243
  pageContext.entity = {};
1245
1244
  }
1246
- pageContext.entity.task = formParam.taskParamMap;
1247
- setStoreInfo(pageCode, pageVersion, "_currentActivityName", formParam.taskName);
1245
+ pageContext.entity.task = commonEntity.taskParamMap;
1246
+ setStoreInfo(pageCode, pageVersion, "_currentActivityName", commonEntity.taskName);
1248
1247
  }
1249
1248
  if (params) {
1250
1249
  params.operationResult = operationResult;
@@ -75,10 +75,25 @@ function getEndObjectRule(rule, props, currentProp) {
75
75
  }
76
76
  function getValidator(columns) {
77
77
  const rules = {};
78
+ if (columns) {
79
+ columns.forEach((editField) => {
80
+ const prop = editField.model;
81
+ if (prop && editField.validations) {
82
+ const validations = editField.validations;
83
+ if (prop.indexOf(".") > 0) {
84
+ setObjectPropRule(editField.prop, rules, validations);
85
+ } else {
86
+ if (validations && validations.length > 0) {
87
+ rules[prop] = [...validations];
88
+ }
89
+ }
90
+ }
91
+ });
92
+ }
78
93
  return rules;
79
94
  }
80
95
  function validator(entity, rules, columns, rowIndex, isSql) {
81
- return validatorEntity(entity, rules, columns, rowIndex, true);
96
+ return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
82
97
  }
83
98
  function sublistVerify(rules) {
84
99
  if (!rules) {
@@ -104,7 +119,7 @@ function sublistVerify(rules) {
104
119
  function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
105
120
  let validateRules = sublistVerify(rules);
106
121
  if ((!rules || rules === null) && columns) {
107
- validateRules = getValidator();
122
+ validateRules = getValidator(columns);
108
123
  }
109
124
  if (!validateRules || Object.keys(validateRules).length === 0) {
110
125
  entity["validateErrorField"] = "";
@@ -122,6 +137,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
122
137
  if (errors) {
123
138
  result = errors[0].message;
124
139
  fieldName = errors[0]["field"];
140
+ if (typeof rowIndex !== "undefined" && rowIndex !== null) {
141
+ result = getI18n().t("superPageRuntimeMessage.recordLine", {
142
+ row: rowIndex + 1
143
+ }) + "," + result;
144
+ }
125
145
  ElMessage({
126
146
  message: result,
127
147
  showClose: true,
@@ -134,11 +154,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
134
154
  }
135
155
  if (fieldName && isShouldRepeateValdate === true) {
136
156
  const reg1 = /[A-Z]+/;
137
- if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
157
+ if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
138
158
  const copyEntity = JSON.parse(JSON.stringify(entity));
139
159
  copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
140
160
  delete copyEntity[fieldName.toLowerCase()];
141
- result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
161
+ result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
142
162
  }
143
163
  }
144
164
  }
@@ -186,7 +206,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
186
206
  if (!rules || Object.keys(rules).length === 0) {
187
207
  result = true;
188
208
  } else {
189
- result = validator(handleModels, rules, null, null);
209
+ result = validator(handleModels, rules, null, null, true);
190
210
  }
191
211
  if (result === true) {
192
212
  const workflowFieldPermissionRules = pageContext.workflowRules;
@@ -250,7 +270,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
250
270
  if (!rules || Object.keys(rules).length === 0) {
251
271
  resolve(handleModels);
252
272
  } else {
253
- const validateEntityResult = validator(handleModels, rules, null, null);
273
+ const validateEntityResult = validator(handleModels, rules, null, null, true);
254
274
  if (validateEntityResult === true) {
255
275
  const validateResult = validateSubTables(pageContext);
256
276
  if (validateResult === true) {
@@ -77,7 +77,8 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
77
77
  }
78
78
  }
79
79
  }
80
- if (f.propValue) ;
80
+ if (f.propValue)
81
+ ;
81
82
  searchForm.push(tempObj);
82
83
  }
83
84
  infoObj.props.searchForm = searchForm;
@@ -33,7 +33,7 @@ function convertToPageContext(pageDesign, pageRequest) {
33
33
  // 当前页面中表格对应的数据表名集合,后台保存子表记录时需要
34
34
  formNoRuleCode: pageDesign.props ? pageDesign.props.formNoRuleCode : null,
35
35
  // 表单编号规则
36
- judgeHeavyList: pageDesign.props && pageDesign.props.judgeHeavyList.length > 0 ? pageDesign.props.judgeHeavyList : null,
36
+ judgeHeavyList: getJudgeHeavyList(pageDesign),
37
37
  // 判重组合字段集合配置
38
38
  // conversionCodes: pageDesign.conversionCodes, // 数据转换规则。按钮上配置的,此处不需要
39
39
  pageType: pageDesign.pageType,
@@ -84,6 +84,27 @@ function convertToPageContext(pageDesign, pageRequest) {
84
84
  pageContext.events = pageDesign.runtime && pageDesign.runtime.events ? pageDesign.runtime.events : [];
85
85
  return pageContext;
86
86
  }
87
+ function getJudgeHeavyList(pageDesign) {
88
+ try {
89
+ if (pageDesign.props && pageDesign.props.judgeHeavyList.length > 0) {
90
+ pageDesign.props.judgeHeavyList.forEach((item) => {
91
+ if (item.duplicateFieldList && item.duplicateFieldList.length > 0) {
92
+ item.duplicateFieldList = item.duplicateFieldList.map((field) => {
93
+ if (typeof field === "string") {
94
+ return { propDbName: field };
95
+ }
96
+ return field;
97
+ });
98
+ }
99
+ });
100
+ return pageDesign.props.judgeHeavyList;
101
+ } else {
102
+ return null;
103
+ }
104
+ } catch (e) {
105
+ console.error("getJudgeHeavyList error:", e);
106
+ }
107
+ }
87
108
  function getPageDimensions() {
88
109
  const winWidth = window.outerWidth;
89
110
  if (!winWidth) {
@@ -116,7 +137,8 @@ function getRequestObject(pageRequest) {
116
137
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
117
138
  }
118
139
  }
119
- if (requestObj["_t_"]) ;
140
+ if (requestObj["_t_"])
141
+ ;
120
142
  return requestObj;
121
143
  }
122
144
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -89,16 +89,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
89
  if (!configure.props || !configure.props.otherSettings) {
90
90
  return;
91
91
  }
92
- if (configure.props.otherSettings.subtableSetting && configure.props.otherSettings.timeToInitializeSubTable && configure.props.otherSettings.subtableSetting.timeToInitializeSubTable.length > 0) {
92
+ if (configure.props.otherSettings.sourceQueryTableData && configure.props.otherSettings.timeToInitializeSubTable && configure.props.otherSettings.sourceQueryTableData.timeToInitializeSubTable.length > 0) {
93
93
  let flag = false;
94
- if (configure.props.otherSettings.subtableSetting.timeToInitializeSubTable.indexOf("create") !== -1) {
94
+ if (configure.props.otherSettings.sourceQueryTableData.timeToInitializeSubTable.indexOf("create") !== -1) {
95
95
  if (dataModel.id || dataModel.ID) {
96
96
  flag = false;
97
97
  } else {
98
98
  flag = true;
99
99
  }
100
100
  }
101
- if (configure.props.otherSettings.subtableSetting.timeToInitializeSubTable.indexOf("noData") !== -1) {
101
+ if (configure.props.otherSettings.sourceQueryTableData.timeToInitializeSubTable.indexOf("noData") !== -1) {
102
102
  const tableData = dataModel[prop];
103
103
  if (!tableData || tableData.length <= 0) {
104
104
  flag = true;
@@ -120,9 +120,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
120
120
  listViewOptions.value["isPageInfo"] = false;
121
121
  listViewOptions.value["subTableData"] = getValue();
122
122
  listViewOptions.value.extraParam["subTableListViewCode"] = listCode;
123
- listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings.subtableSetting) : null;
123
+ listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings) : null;
124
124
  listViewOptions.value.extraParam["additionalParamMap"] = additionalParamMap;
125
125
  listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
126
+ listViewOptions.value.extraParam["contextMap"] = pageContext.entity.context;
127
+ listViewOptions.value.extraParam["taskMap"] = pageContext.entity.task;
126
128
  setGridDataEventOptions();
127
129
  listViewShowFlag.value = false;
128
130
  setTimeout(() => {
@@ -52,6 +52,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
52
  if (Array.isArray(value)) {
53
53
  setVariableValue(entity, dynamicFields, value[0]);
54
54
  setVariableValue(entity, dynamicFields2, value[1]);
55
+ } else if (value === null) {
56
+ setVariableValue(entity, dynamicFields, null);
57
+ setVariableValue(entity, dynamicFields2, null);
55
58
  }
56
59
  } else {
57
60
  setVariableValue(entity, dynamicFields, value);
@@ -125,9 +128,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
125
128
  size: designProperty.value.size,
126
129
  placeholder: designProperty.value.placeholder,
127
130
  "start-placeholder": designProperty.value.placeholder,
128
- "end-placeholder": designProperty.value.endPlaceholder,
131
+ "end-placeholder": designProperty.value.endPlaceholder ? designProperty.value.endPlaceholder : designProperty.value.placeholder,
129
132
  format: designProperty.value.format,
130
- "value-format": designProperty.value.valueFormat ? "x" : designProperty.value.valueFormat,
133
+ "value-format": designProperty.value.valueFormat ? designProperty.value.valueFormat : "x",
131
134
  modelValue: dynamicModelMethod.value,
132
135
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dynamicModelMethod.value = $event),
133
136
  shortcuts: shortcuts.value,
@@ -136,7 +139,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
136
139
  onBlur: _cache[2] || (_cache[2] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
137
140
  onFocus: _cache[3] || (_cache[3] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "focus")),
138
141
  onVisibleChange: _cache[4] || (_cache[4] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "visible-change")),
139
- onPanelChange: _cache[5] || (_cache[5] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "panel-change"))
142
+ onPanelChange: _cache[5] || (_cache[5] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "panel-change")),
143
+ onClear: _cache[6] || (_cache[6] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "clear"))
140
144
  }, null, 8, ["is-range", "clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "value-format", "modelValue", "shortcuts", "type"])) : (openBlock(), createBlock(_component_el_date_picker, {
141
145
  key: 1,
142
146
  clearable: designProperty.value.clearable,
@@ -145,18 +149,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
145
149
  size: designProperty.value.size,
146
150
  placeholder: designProperty.value.placeholder,
147
151
  "start-placeholder": designProperty.value.placeholder,
148
- "end-placeholder": designProperty.value.endPlaceholder,
152
+ "end-placeholder": designProperty.value.endPlaceholder ? designProperty.value.endPlaceholder : designProperty.value.placeholder,
149
153
  format: designProperty.value.format,
150
154
  modelValue: dynamicModelMethod.value,
151
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => dynamicModelMethod.value = $event),
155
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => dynamicModelMethod.value = $event),
152
156
  shortcuts: shortcuts.value,
153
157
  type: designProperty.value.dateType,
154
- "value-format": designProperty.value.valueFormat ? "x" : designProperty.value.valueFormat,
155
- onChange: _cache[7] || (_cache[7] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
156
- onBlur: _cache[8] || (_cache[8] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
157
- onFocus: _cache[9] || (_cache[9] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "focus")),
158
- onVisibleChange: _cache[10] || (_cache[10] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "visible-change")),
159
- onPanelChange: _cache[11] || (_cache[11] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "panel-change"))
158
+ "value-format": designProperty.value.valueFormat ? designProperty.value.valueFormat : "x",
159
+ onChange: _cache[8] || (_cache[8] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
160
+ onBlur: _cache[9] || (_cache[9] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
161
+ onFocus: _cache[10] || (_cache[10] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "focus")),
162
+ onVisibleChange: _cache[11] || (_cache[11] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "visible-change")),
163
+ onPanelChange: _cache[12] || (_cache[12] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "panel-change")),
164
+ onClear: _cache[13] || (_cache[13] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "clear"))
160
165
  }, null, 8, ["clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "modelValue", "shortcuts", "type", "value-format"]))
161
166
  ]),
162
167
  _: 1
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from "./placeholder-runtime.vue2.js";
2
- /* empty css */
2
+ import "./placeholder-runtime.vue3.js";
3
3
  import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const placeholderRuntime = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a0860ff0"]]);
5
5
  export {
@@ -18,12 +18,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  const dynamicModelMethod = computed({
19
19
  get() {
20
20
  let val = getVariableValue(entity, dynamicFields);
21
+ console.log("select组件----dynamicModelMethod---get-111-val", val);
21
22
  if (val !== void 0 && val !== null) {
22
23
  val = val + "";
23
24
  }
25
+ console.log("select组件----dynamicModelMethod---get222--val", val);
24
26
  return val;
25
27
  },
26
28
  set(value) {
29
+ console.log("select组件----dynamicModelMethod---set--value", value);
27
30
  setVariableValue(entity, dynamicFields, value);
28
31
  }
29
32
  });
@@ -37,6 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
40
  if (cacheOptions.length > 0) {
38
41
  listOptions.value = cacheOptions;
39
42
  }
43
+ console.log("select组件----listOptions.value=", listOptions.value);
40
44
  const queryLoadingFlag = ref(false);
41
45
  const dataOrigin = props.configure.props && props.configure.props.dataOrigin ? props.configure.props.dataOrigin : {};
42
46
  const valueType = dataOrigin.optionValueSetType;
@@ -21,18 +21,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  designProperty.value.activeValue = "1";
22
22
  }
23
23
  if (designProperty.value.inactiveValue === void 0 || designProperty.value.inactiveValue === null) {
24
- designProperty.value.activeValue = "0";
24
+ designProperty.value.inactiveValue = "0";
25
25
  }
26
26
  const switchStyle = runtimeInfo.switchStyle;
27
27
  const dynamicModelMethod = computed({
28
28
  get() {
29
+ debugger;
29
30
  let val = getVariableValue(entity, dynamicFields);
30
31
  if (val !== void 0 && val !== null) {
31
- val = val = "";
32
+ val = val + "";
32
33
  }
33
34
  return val;
34
35
  },
35
36
  set(value) {
37
+ debugger;
36
38
  setVariableValue(entity, dynamicFields, value);
37
39
  }
38
40
  });
@@ -336,7 +336,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
336
336
  if (!_selectFile_.value) {
337
337
  return;
338
338
  }
339
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
339
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
340
+ return;
340
341
  const fileObj = _selectFile_.value.files[0];
341
342
  if (fileObj) {
342
343
  _selectFile_.value.value = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.0.86",
3
+ "version": "2.0.91",
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.58",
51
+ "agilebuilder-ui": "1.0.59",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",