super-page-runtime 2.1.22 → 2.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/es/components/runtime/utils/api/api-util.js +10 -2
  2. package/dist/es/components/runtime/utils/api/page-expose-util.js +38 -0
  3. package/dist/es/components/runtime/utils/assemblys-config.js +13 -0
  4. package/dist/es/components/runtime/utils/events/standard-event.js +6 -2
  5. package/dist/es/components/runtime/utils/events/validator-util.js +27 -7
  6. package/dist/es/components/runtime/utils/page-helper-util.js +2 -1
  7. package/dist/es/components/runtime/utils/page-init-util.js +5 -1
  8. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +28 -7
  9. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +3 -1
  10. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +4 -2
  11. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +3 -1
  12. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +3 -1
  13. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +5 -3
  14. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +1 -0
  15. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +4 -0
  16. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +145 -0
  17. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +50 -7
  18. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
  19. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
  20. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +18 -8
  21. package/dist/es/components/runtime/views/super-page.vue.js +22 -10
  22. package/package.json +2 -2
@@ -4,8 +4,13 @@ import { isWorkflowPage, getBaseUrl, getListCode } from "../common-util.js";
4
4
  import { getAdditionalParamMap, dealCompleteTaskParam } from "../events/standard-event.js";
5
5
  import { packageCustomRules, getWorkflowRules } from "../events/validator-util.js";
6
6
  import { handleEvent } from "../events/event-util.js";
7
+ import { ElMessage, ElMessageBox } from "element-plus";
7
8
  import { functions } from "./page-expose-util.js";
8
9
  function refreshPage(pageContext, id) {
10
+ if (!pageContext.entity.page) {
11
+ pageContext.entity.page = {};
12
+ }
13
+ pageContext.entity.page["_isRefresh"] = true;
9
14
  getFormData(pageContext, id).then((commonEntity) => {
10
15
  pageContext.isRefresh = true;
11
16
  });
@@ -68,7 +73,7 @@ function getCommonFormData(pageContext, id) {
68
73
  param["taskId"] = taskId;
69
74
  }
70
75
  console.log("getCommonFormData---listCodesMap=", pageContext.listCodesMap);
71
- if (!pageContext.listCodesMap && pageContext.tableUuids) {
76
+ if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
72
77
  const listCodesMap = {};
73
78
  pageContext.tableUuids.forEach((tableUuid) => {
74
79
  const listCode = getListCode(pageCode, pageVersion, tableUuid);
@@ -292,11 +297,14 @@ function formatAdditionalParamMapIds(ids) {
292
297
  ids = ids.split(",");
293
298
  } else if (typeof ids === "number") {
294
299
  ids = [ids];
295
- } else ;
300
+ } else
301
+ ;
296
302
  }
297
303
  return ids;
298
304
  }
299
305
  window["$PageUtil"] = functions;
306
+ window["$message"] = ElMessage;
307
+ window["$messageBox"] = ElMessageBox;
300
308
  export {
301
309
  getFormData,
302
310
  refreshPage
@@ -4,6 +4,7 @@ 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
6
  import { i18nValidatePropRulesMessage } from "../events/validator-util.js";
7
+ import { getBaseUrl } from "../common-util.js";
7
8
  const functions = {
8
9
  /**
9
10
  * 展示页面中的某个组件元素
@@ -266,6 +267,43 @@ const functions = {
266
267
  } else {
267
268
  console.error("tableUUid is undefined");
268
269
  }
270
+ },
271
+ // 根据key获得serverConfig中配置的信息
272
+ getServerConfigValue(key) {
273
+ return window["$vueApp"].config.globalProperties[key];
274
+ },
275
+ // 获得当前系统的后端访问路径
276
+ getBackendUrl(pageContext) {
277
+ return getBaseUrl(pageContext.backendUrl, false);
278
+ },
279
+ // 获得平台后端访问路径
280
+ getPlateBackendUrl() {
281
+ return window["$vueApp"].config.globalProperties.baseAPI;
282
+ },
283
+ // 获得实体
284
+ getEntity(pageContext) {
285
+ return pageContext.entity.data;
286
+ },
287
+ // 获得实体属性值
288
+ getEntityValue(pageContext, key) {
289
+ return pageContext.entity.data ? pageContext.entity.data[key] : null;
290
+ },
291
+ // 获得页面变量
292
+ getPageData(pageContext) {
293
+ return pageContext.entity.page;
294
+ },
295
+ // 获得页面变量属性值
296
+ getPageDataValue(pageContext, key) {
297
+ return pageContext.entity.page ? pageContext.entity.page[key] : null;
298
+ },
299
+ // 获得附加参数对象
300
+ getAdditionalParams(pageContext) {
301
+ return getAdditionalParamMap(pageContext);
302
+ },
303
+ // 获得附加参数对象
304
+ getAdditionalParamValue(pageContext, key) {
305
+ const param = getAdditionalParamMap(pageContext);
306
+ return param ? param[key] : null;
269
307
  }
270
308
  };
271
309
  function packageAllFeildsRules(pageContext, item) {
@@ -330,6 +330,19 @@ const assemblyGroups = [
330
330
  })
331
331
  }
332
332
  ]
333
+ },
334
+ {
335
+ name: "other",
336
+ label: "其他",
337
+ items: [
338
+ {
339
+ name: "custom",
340
+ label: "自定义",
341
+ runtimeComponent: defineAsyncComponent(() => {
342
+ return import("../views/assemblys/form/custom/custom-runtime.vue.js");
343
+ })
344
+ }
345
+ ]
333
346
  }
334
347
  ];
335
348
  function getRuntimeComponentByName(name) {
@@ -773,6 +773,8 @@ function submitForm(params, isListButton, eventName, url) {
773
773
  if (successOperation && successOperation === "noOperation") {
774
774
  isUnControlVersion = true;
775
775
  }
776
+ const tableUuid = configureObj.props.base.tableUuid ? configureObj.props.base.tableUuid : params.tableUuid;
777
+ const tableName = getTableNameByTableUuid(pageContext, tableUuid);
776
778
  const request = getSubmitFormRequest(
777
779
  pageContext,
778
780
  configureObj,
@@ -781,7 +783,8 @@ function submitForm(params, isListButton, eventName, url) {
781
783
  mainDefaultValueColumns,
782
784
  dynamicColumnInfo,
783
785
  eventName,
784
- ids2
786
+ ids2,
787
+ tableName
785
788
  );
786
789
  if (request) {
787
790
  request.then((data) => {
@@ -801,7 +804,7 @@ function submitForm(params, isListButton, eventName, url) {
801
804
  }
802
805
  });
803
806
  }
804
- function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, eventName, ids2) {
807
+ function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, eventName, ids2, tableName) {
805
808
  return new Promise((resolve, reject) => {
806
809
  const buttonName = configureObj.props.base.title;
807
810
  const operationI18nTip = "superPageRuntimeMessage.whetherToConfirm" + upperFirstCase(eventName);
@@ -825,6 +828,7 @@ function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion
825
828
  ids2,
826
829
  null
827
830
  );
831
+ param.tableName = tableName;
828
832
  const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
829
833
  let path = baseUrl + url;
830
834
  path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
@@ -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;
@@ -216,7 +236,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
216
236
  if (customUuids) {
217
237
  customUuids.forEach((componentUuid) => {
218
238
  const customRef = getComponentRef(pageContext, componentUuid);
219
- if (customRef) {
239
+ if (customRef && customRef.validator) {
220
240
  validatorResult.push(customRef.validator());
221
241
  }
222
242
  });
@@ -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) {
@@ -80,7 +80,8 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
80
80
  }
81
81
  }
82
82
  }
83
- if (f.propValue) ;
83
+ if (f.propValue)
84
+ ;
84
85
  searchForm.push(tempObj);
85
86
  }
86
87
  infoObj.props.searchForm = searchForm;
@@ -138,7 +138,8 @@ function getRequestObject(pageRequest) {
138
138
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
139
139
  }
140
140
  }
141
- if (requestObj["_t_"]) ;
141
+ if (requestObj["_t_"])
142
+ ;
142
143
  return requestObj;
143
144
  }
144
145
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -323,6 +324,9 @@ function packageFormRules(pageContext, configure) {
323
324
  if (!allFieldsDisabled && configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
324
325
  const propEditPermission = pageContext.fieldPermissionMap.get(propName);
325
326
  console.log("packageFormRules-----prop=", prop, "--propEditPermission=", propEditPermission);
327
+ if (!configure.runtime.props) {
328
+ configure.runtime.props = {};
329
+ }
326
330
  if (propEditPermission) {
327
331
  if (propEditPermission["canEdit"] === false) {
328
332
  configure.runtime.props.state = "disabled";
@@ -34,6 +34,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  const enableDrill = props.configure.props ? props.configure.props.enableDrill : null;
35
35
  const drillEndTrigger = props.configure.props ? props.configure.props.drillEndTrigger : null;
36
36
  const linkPage = props.configure.props ? props.configure.props.linkPage : null;
37
+ const linkPageMap = {};
38
+ if (props.configure.items) {
39
+ for (const item of props.configure.items) {
40
+ if (linkPage && linkPage.jumpPageUrl) {
41
+ linkPageMap[item.uuid] = linkPage;
42
+ } else if (item.props && item.props.linkPage && item.props.linkPage.jumpPageUrl) {
43
+ linkPageMap[item.uuid] = item.props.linkPage;
44
+ }
45
+ }
46
+ }
37
47
  const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
38
48
  const runtimeStyle = runtimeInfo.style;
39
49
  const runtimeClass = runtimeInfo.class;
@@ -48,14 +58,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
58
  if (resultData) {
49
59
  updateChartDatas(resultData);
50
60
  }
51
- if (chartRef.value && (enableDrill || linkPage && linkPage.jumpPageUrl)) {
61
+ if (chartRef.value && (enableDrill || Object.keys(linkPageMap).length > 0)) {
52
62
  chartRef.value.chart.on("click", function(params) {
53
63
  if (enableDrill) {
54
64
  if (headerRef.value && headerRef.value.drill) {
55
65
  headerRef.value.drill(params, props.configure.cacheDatas);
56
66
  }
57
67
  } else {
58
- clickToLink();
68
+ clickToLink(params);
59
69
  }
60
70
  });
61
71
  }
@@ -69,11 +79,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
79
  headerRef.value.closeDrill(0);
70
80
  }
71
81
  } else if (drillEndTrigger === "clickEvent") {
72
- clickToLink();
82
+ clickToLink(params);
73
83
  }
74
84
  }
75
- function clickToLink() {
76
- if (!linkPage || !linkPage.jumpPageUrl) {
85
+ function clickToLink(clickParams) {
86
+ console.log("clik0", clickParams);
87
+ if (clickParams.seriesIndex >= chartOption.series.length) {
88
+ return;
89
+ }
90
+ console.log("clik1", clickParams);
91
+ const selSerieUuid = chartOption.series[clickParams.seriesIndex].uuid;
92
+ console.log("clik2", selSerieUuid);
93
+ const linkPage2 = linkPageMap[selSerieUuid];
94
+ console.log("clik3", linkPageMap, linkPage2);
95
+ if (!linkPage2) {
77
96
  return;
78
97
  }
79
98
  doClickJumpPageEvent(props.pageContext, props.configure, void 0);
@@ -84,14 +103,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
84
103
  return;
85
104
  }
86
105
  hisGroupValue = headerInfo.groupValue;
87
- refresh();
106
+ if (dataConfig) {
107
+ dataConfig.services[0].groupValue = headerInfo.groupValue;
108
+ }
109
+ refresh(false);
88
110
  });
89
111
  function refresh(isHandle) {
90
112
  if (!dataConfig) {
91
113
  console.log("无数据源配置,不需要查询!");
92
114
  return;
93
115
  }
94
- dataConfig.services[0].groupValue = headerInfo.groupValue;
95
116
  if (isHandle !== true) {
96
117
  dataConfig.autoRefresh = true;
97
118
  }
@@ -41,6 +41,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
41
41
  return;
42
42
  }
43
43
  hisGroupValue = headerInfo.groupValue;
44
+ if (dataConfig) {
45
+ dataConfig.services[0].groupValue = headerInfo.groupValue;
46
+ }
44
47
  refresh();
45
48
  });
46
49
  function refresh() {
@@ -48,7 +51,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
51
  console.log("无数据源配置,不需要查询!");
49
52
  return;
50
53
  }
51
- dataConfig.services[0].groupValue = headerInfo.groupValue;
52
54
  updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
53
55
  }
54
56
  const monitorFields = headerInfo.monitorFields;
@@ -82,14 +82,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
82
82
  return;
83
83
  }
84
84
  hisGroupValue = headerInfo.groupValue;
85
- refresh();
85
+ if (dataConfig) {
86
+ dataConfig.services[0].groupValue = headerInfo.groupValue;
87
+ }
88
+ refresh(false);
86
89
  });
87
90
  function refresh(isHandle) {
88
91
  if (!dataConfig) {
89
92
  console.log("无数据源配置,不需要查询!");
90
93
  return;
91
94
  }
92
- dataConfig.services[0].groupValue = headerInfo.groupValue;
93
95
  if (isHandle !== true) {
94
96
  dataConfig.autoRefresh = true;
95
97
  }
@@ -50,6 +50,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
50
50
  return;
51
51
  }
52
52
  hisGroupValue = headerInfo.groupValue;
53
+ if (dataConfig) {
54
+ dataConfig.services[0].groupValue = headerInfo.groupValue;
55
+ }
53
56
  refresh();
54
57
  });
55
58
  function refresh() {
@@ -57,7 +60,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
60
  console.log("无数据源配置,不需要查询!");
58
61
  return;
59
62
  }
60
- dataConfig.services[0].groupValue = headerInfo.groupValue;
61
63
  updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
62
64
  }
63
65
  const monitorFields = headerInfo.monitorFields;
@@ -51,6 +51,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
51
51
  return;
52
52
  }
53
53
  hisGroupValue = headerInfo.groupValue;
54
+ if (dataConfig) {
55
+ dataConfig.services[0].groupValue = headerInfo.groupValue;
56
+ }
54
57
  refresh();
55
58
  });
56
59
  function refresh() {
@@ -58,7 +61,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
61
  console.log("无数据源配置,不需要查询!");
59
62
  return;
60
63
  }
61
- dataConfig.services[0].groupValue = headerInfo.groupValue;
62
64
  updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
63
65
  }
64
66
  const monitorFields = headerInfo.monitorFields;
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeStyle, unref, normalizeClass, withCtx, createElementBlock, Fragment, renderList, createVNode } from "vue";
1
+ import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeStyle, unref, normalizeClass, withCtx, createElementBlock, Fragment, renderList, withDirectives, createVNode, vShow } from "vue";
2
2
  import _sfc_main$1 from "../../object-render.vue.js";
3
3
  import { PageDimensions } from "../../../../utils/interfaces/page-design-types.js";
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -46,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
46
  }, {
47
47
  default: withCtx(() => [
48
48
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.configure.items, (element, itemIndex) => {
49
- return openBlock(), createBlock(_component_el_col, {
49
+ return withDirectives((openBlock(), createBlock(_component_el_col, {
50
50
  key: element.uuid,
51
51
  style: normalizeStyle(element.itemStyle),
52
52
  span: element.flexSpan
@@ -58,7 +58,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
58
  }, null, 8, ["pageContext", "configure"])
59
59
  ]),
60
60
  _: 2
61
- }, 1032, ["style", "span"]);
61
+ }, 1032, ["style", "span"])), [
62
+ [vShow, element._dynamicShowFlag]
63
+ ]);
62
64
  }), 128))
63
65
  ]),
64
66
  _: 1
@@ -196,6 +196,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
196
196
  if (!options.operations) {
197
197
  options.operations = {};
198
198
  }
199
+ debugger;
199
200
  options.operations.operation = operationButtons;
200
201
  }
201
202
  }
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./custom-runtime.vue2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,145 @@
1
+ import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, resolveDynamicComponent } from "vue";
2
+ import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
+ import { getVariableValue, setVariableValue, getFormPropName, setVariableValueWithProp } from "../../../../utils/page-helper-util.js";
4
+ import "quill";
5
+ import "quill/dist/quill.snow.css";
6
+ import { handleEvent } from "../../../../utils/events/event-util.js";
7
+ import { packageCustomRules } from "../../../../utils/events/validator-util.js";
8
+ import { getListCode } from "../../../../utils/common-util.js";
9
+ import { getComponentRef } from "../../../../utils/global-refs.js";
10
+ import { getAdditionalParamMap } from "../../../../utils/events/standard-event.js";
11
+ const _hoisted_1 = {
12
+ key: 0,
13
+ style: { "width": "100%", "height": "100%" }
14
+ };
15
+ const _hoisted_2 = {
16
+ key: 1,
17
+ style: { "width": "100%", "height": "100%" },
18
+ class: "amb-widget-richtext-single"
19
+ };
20
+ const _sfc_main = /* @__PURE__ */ defineComponent({
21
+ __name: "custom-runtime",
22
+ props: {
23
+ pageContext: {},
24
+ configure: {}
25
+ },
26
+ setup(__props) {
27
+ const props = __props;
28
+ const entity = props.pageContext.entity ? props.pageContext.entity : {};
29
+ const dynamicFields = getFormModelFields(props.pageContext, props.configure);
30
+ const dynamicModelMethod = computed({
31
+ get() {
32
+ return getVariableValue(entity, dynamicFields);
33
+ },
34
+ set(value) {
35
+ setVariableValue(entity, dynamicFields, value);
36
+ }
37
+ });
38
+ const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
39
+ const runtimeStyle = runtimeInfo.style;
40
+ const runtimeClass = runtimeInfo.class;
41
+ const headerStyle = runtimeInfo.headerStyle;
42
+ const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
43
+ const customParams = runtimeInfo.customParams ? runtimeInfo.customParams : {};
44
+ const additionalParamMap = getAdditionalParamMap(props.pageContext);
45
+ const componentName = ref(props.configure.props && props.configure.props.base ? props.configure.props.base.name : null);
46
+ console.log("自定义控件----componentName=", componentName, "designProperty=", designProperty);
47
+ if (!props.pageContext.customValidatorUuids) {
48
+ props.pageContext.customValidatorUuids = [];
49
+ }
50
+ props.pageContext.customValidatorUuids.push(props.configure.uuid);
51
+ function customControlSetValue(prop, value) {
52
+ setVariableValueWithProp(entity, prop, value);
53
+ }
54
+ function setCustomvalidateRules(customRules) {
55
+ if (!customRules) {
56
+ return;
57
+ }
58
+ let rules = props.pageContext.rules ? props.pageContext.rules : {};
59
+ rules = packageCustomRules(customRules, rules);
60
+ props.pageContext.rules = rules;
61
+ let workflowRules = props.pageContext.workflowRules ? props.pageContext.workflowRules : {};
62
+ workflowRules = packageCustomRules(customRules, workflowRules);
63
+ props.pageContext.workflowRules = workflowRules;
64
+ }
65
+ function restoreGridEdit() {
66
+ const tableUuids = props.pageContext.tableUuids;
67
+ if (tableUuids) {
68
+ tableUuids.forEach((tableUuid) => {
69
+ const listCode = getListCode(props.pageContext.code, props.pageContext.version, props.configure.uuid);
70
+ const gridRef = getComponentRef(props.pageContext, tableUuid);
71
+ if (gridRef) {
72
+ gridRef.restoreGridEdit(listCode);
73
+ }
74
+ });
75
+ }
76
+ }
77
+ return (_ctx, _cache) => {
78
+ const _component_el_form_item = resolveComponent("el-form-item");
79
+ return designProperty.value.tittleShow ? (openBlock(), createBlock(_component_el_form_item, {
80
+ key: 0,
81
+ required: designProperty.value.required,
82
+ class: normalizeClass(unref(runtimeClass)),
83
+ "label-width": designProperty.value.labelWidth,
84
+ style: normalizeStyle(unref(runtimeStyle))
85
+ }, {
86
+ label: withCtx(() => [
87
+ designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
88
+ key: 0,
89
+ style: normalizeStyle({ ...unref(headerStyle) })
90
+ }, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
91
+ ]),
92
+ default: withCtx(() => [
93
+ componentName.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
94
+ (openBlock(), createBlock(resolveDynamicComponent(componentName.value), {
95
+ size: designProperty.value.size,
96
+ entity: _ctx.pageContext.entity.data,
97
+ pageData: _ctx.pageContext.entity.page,
98
+ pageContext: _ctx.pageContext,
99
+ configureObj: _ctx.configure,
100
+ prop: unref(getFormPropName)(_ctx.configure.props && _ctx.configure.props.base ? _ctx.configure.props.base.prop : null),
101
+ "custom-params": unref(customParams),
102
+ modelValue: dynamicModelMethod.value,
103
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dynamicModelMethod.value = $event),
104
+ disabled: designProperty.value.state === "disabled",
105
+ "additional-param-map": unref(additionalParamMap),
106
+ onSetEntityValue: customControlSetValue,
107
+ onSetCustomRules: setCustomvalidateRules,
108
+ onRestoreGridEdit: restoreGridEdit,
109
+ onInput: _cache[1] || (_cache[1] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "input")),
110
+ onChange: _cache[2] || (_cache[2] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "change")),
111
+ onClick: _cache[3] || (_cache[3] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "click")),
112
+ onBlur: _cache[4] || (_cache[4] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "blur")),
113
+ onFocus: _cache[5] || (_cache[5] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "focus"))
114
+ }, null, 40, ["size", "entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map"]))
115
+ ])) : createCommentVNode("", true)
116
+ ]),
117
+ _: 1
118
+ }, 8, ["required", "class", "label-width", "style"])) : componentName.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
119
+ (openBlock(), createBlock(resolveDynamicComponent(componentName.value), {
120
+ entity: _ctx.pageContext.entity.data,
121
+ pageData: _ctx.pageContext.entity.page,
122
+ pageContext: _ctx.pageContext,
123
+ configureObj: _ctx.configure,
124
+ prop: unref(getFormPropName)(_ctx.configure.props && _ctx.configure.props.base ? _ctx.configure.props.base.prop : null),
125
+ "custom-params": unref(customParams),
126
+ modelValue: dynamicModelMethod.value,
127
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => dynamicModelMethod.value = $event),
128
+ disabled: designProperty.value.state === "disabled",
129
+ "additional-param-map": unref(additionalParamMap),
130
+ onSetEntityValue: customControlSetValue,
131
+ onSetCustomRules: setCustomvalidateRules,
132
+ onRestoreGridEdit: restoreGridEdit,
133
+ onInput: _cache[7] || (_cache[7] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "input")),
134
+ onChange: _cache[8] || (_cache[8] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "change")),
135
+ onClick: _cache[9] || (_cache[9] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "click")),
136
+ onBlur: _cache[10] || (_cache[10] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "blur")),
137
+ onFocus: _cache[11] || (_cache[11] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "focus"))
138
+ }, null, 40, ["entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map"]))
139
+ ])) : createCommentVNode("", true);
140
+ };
141
+ }
142
+ });
143
+ export {
144
+ _sfc_main as default
145
+ };
@@ -4,6 +4,7 @@ import { getDateShortCuts } from "../../../../utils/form/date-shortcuts.js";
4
4
  import { getValueFromVariable, setVariableValue, getVariableValue } from "../../../../utils/page-helper-util.js";
5
5
  import { getCustomFunc, handleFormEvent } from "../../../../utils/events/event-util.js";
6
6
  import _sfc_main$1 from "../common/title-suffix-element.vue.js";
7
+ import dayjs from "dayjs";
7
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
9
  __name: "datepicker-runtime",
9
10
  props: {
@@ -19,6 +20,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
20
  const headerStyle = runtimeInfo.headerStyle;
20
21
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
21
22
  let dynamicFields = getFormModelFields(props.pageContext, props.configure);
23
+ console.log("designProperty", designProperty);
22
24
  let dynamicFields2 = null;
23
25
  let isRange = false;
24
26
  if (designProperty.value.dateType && designProperty.value.dateType.includes("range")) {
@@ -36,15 +38,57 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
38
  }
37
39
  }
38
40
  }
41
+ function formatDate(value, formatStr) {
42
+ if (!value) {
43
+ return value;
44
+ }
45
+ if (formatStr) {
46
+ console.log("formatStr", formatStr);
47
+ console.log("before", value);
48
+ try {
49
+ const convertValue = dayjs(value);
50
+ let value2 = null;
51
+ if (formatStr === "x") {
52
+ value2 = convertValue.toDate().getTime();
53
+ } else {
54
+ value2 = dayjs(value).format(formatStr);
55
+ }
56
+ console.log("after", value2);
57
+ return value2;
58
+ } catch (e) {
59
+ console.error("日期值格式化错误", e);
60
+ console.error(`value: ${value} ,valueFormat: ${designProperty.value.valueFormat}`);
61
+ return value;
62
+ }
63
+ }
64
+ return value;
65
+ }
66
+ if (dynamicFields) {
67
+ const hisValue = getVariableValue(entity, dynamicFields);
68
+ const newValue = formatDate(hisValue, designProperty.value.valueFormat);
69
+ if (hisValue !== newValue) {
70
+ setVariableValue(entity, dynamicFields, newValue);
71
+ }
72
+ }
73
+ if (dynamicFields2) {
74
+ const hisValue = getVariableValue(entity, dynamicFields2);
75
+ const newValue = formatDate(hisValue, designProperty.value.valueFormat);
76
+ if (hisValue !== newValue) {
77
+ setVariableValue(entity, dynamicFields2, newValue);
78
+ }
79
+ }
39
80
  const dynamicModelMethod = computed({
40
81
  get() {
41
82
  if (isRange) {
42
83
  const values = [];
43
- values.push(getVariableValue(entity, dynamicFields));
44
- values.push(getVariableValue(entity, dynamicFields2));
84
+ let value1 = getVariableValue(entity, dynamicFields);
85
+ values.push(value1);
86
+ let value2 = getVariableValue(entity, dynamicFields2);
87
+ values.push(value2);
45
88
  return values;
46
89
  } else {
47
- return getVariableValue(entity, dynamicFields);
90
+ let value1 = getVariableValue(entity, dynamicFields);
91
+ return value1;
48
92
  }
49
93
  },
50
94
  set(value) {
@@ -59,7 +103,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
59
103
  } else {
60
104
  setVariableValue(entity, dynamicFields, value);
61
105
  }
62
- console.log("entity", entity);
63
106
  }
64
107
  });
65
108
  const shortcuts = ref(
@@ -131,7 +174,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
131
174
  "start-placeholder": designProperty.value.placeholder,
132
175
  "end-placeholder": designProperty.value.endPlaceholder ? designProperty.value.endPlaceholder : designProperty.value.placeholder,
133
176
  format: designProperty.value.format,
134
- "value-format": designProperty.value.valueFormat ? designProperty.value.valueFormat : "x",
177
+ "value-format": designProperty.value.valueFormat,
135
178
  modelValue: dynamicModelMethod.value,
136
179
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dynamicModelMethod.value = $event),
137
180
  shortcuts: shortcuts.value,
@@ -153,18 +196,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
153
196
  "start-placeholder": designProperty.value.placeholder,
154
197
  "end-placeholder": designProperty.value.endPlaceholder ? designProperty.value.endPlaceholder : designProperty.value.placeholder,
155
198
  format: designProperty.value.format,
199
+ "value-format": designProperty.value.valueFormat,
156
200
  modelValue: dynamicModelMethod.value,
157
201
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => dynamicModelMethod.value = $event),
158
202
  shortcuts: shortcuts.value,
159
203
  type: designProperty.value.dateType,
160
- "value-format": designProperty.value.valueFormat ? designProperty.value.valueFormat : "x",
161
204
  onChange: _cache[8] || (_cache[8] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
162
205
  onBlur: _cache[9] || (_cache[9] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
163
206
  onFocus: _cache[10] || (_cache[10] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "focus")),
164
207
  onVisibleChange: _cache[11] || (_cache[11] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "visible-change")),
165
208
  onPanelChange: _cache[12] || (_cache[12] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "panel-change")),
166
209
  onClear: _cache[13] || (_cache[13] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "clear"))
167
- }, null, 8, ["clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "modelValue", "shortcuts", "type", "value-format"]))
210
+ }, null, 8, ["clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "value-format", "modelValue", "shortcuts", "type"]))
168
211
  ]),
169
212
  _: 1
170
213
  }, 8, ["required", "class", "label-width", "style"]);
@@ -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 {
@@ -19,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  props.configure.style = {};
20
20
  }
21
21
  const permissionCodes = getPermissionCodes(props.configure, props.pageContext);
22
+ console.log("Object-Render---permissionCodes=", permissionCodes);
22
23
  if (props.configure && props.configure.props && props.configure.props.base) {
23
24
  props.configure.props.base.functionCode = permissionCodes;
24
25
  }
@@ -36,15 +37,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
37
  }
37
38
  showFlag = computed(() => {
38
39
  var _a2;
40
+ let dynamicShowFlag = true;
39
41
  if (!handleShowFlag.value) {
40
- return false;
41
- }
42
- const state = (_a2 = props.configure.props.base) == null ? void 0 : _a2.state;
43
- if (state && state === "hidden") {
44
- return false;
42
+ dynamicShowFlag = false;
43
+ } else {
44
+ if (showConditions && showConditions.length > 0) {
45
+ dynamicShowFlag = caculateShowCondition(props.pageContext, props.configure, showConditions);
46
+ } else {
47
+ const state = (_a2 = props.configure.props.base) == null ? void 0 : _a2.state;
48
+ if (state && state === "hidden") {
49
+ dynamicShowFlag = false;
50
+ }
51
+ }
45
52
  }
46
- return caculateShowCondition(props.pageContext, props.configure, showConditions);
53
+ console.log("obj-render-dynamicShowFlag", dynamicShowFlag);
54
+ return dynamicShowFlag;
47
55
  });
56
+ const propConfigure = props.configure;
57
+ propConfigure._dynamicShowFlag = showFlag;
48
58
  if (props.configure.props.editConditions) {
49
59
  const editConditions = props.configure.props.editConditions;
50
60
  if (editConditions.length > 0) {
@@ -92,12 +102,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
92
102
  thisRef.value = el;
93
103
  if (el && !el.show) {
94
104
  el.show = function() {
95
- showFlag.value = true;
105
+ handleShowFlag.value = true;
96
106
  };
97
107
  }
98
108
  if (el && !el.hide) {
99
109
  el.hide = function() {
100
- showFlag.value = false;
110
+ handleShowFlag.value = false;
101
111
  };
102
112
  }
103
113
  if (el && !el.getConfigure) {
@@ -127,7 +127,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
127
127
  setTimeout(() => {
128
128
  console.log("pageDesign.initChartServiceConfigs", pageDesign.initChartServiceConfigs);
129
129
  initChartDatas(pageContext.value, pageDesign.initChartServiceConfigs);
130
- }, 0);
130
+ }, 200);
131
131
  pageContext.value.initDataSources = [];
132
132
  initComponentRefState(pageContext.value);
133
133
  pageItems.value = pageContext.value.items ? pageContext.value.items : [];
@@ -225,7 +225,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
225
225
  }
226
226
  function initChartDatas(pageContext2, chartConfigs) {
227
227
  if (!chartConfigs || chartConfigs.length == 0) {
228
- console.log("无需要初始化的选项组数据");
228
+ console.log("无需要初始化时统计的统计图数据");
229
229
  return;
230
230
  }
231
231
  pageContext2.initChartData = {};
@@ -349,7 +349,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
349
349
  if (!_selectFile_.value) {
350
350
  return;
351
351
  }
352
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
352
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
353
+ return;
353
354
  const fileObj = _selectFile_.value.files[0];
354
355
  if (fileObj) {
355
356
  _selectFile_.value.value = null;
@@ -397,14 +398,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
397
398
  const additionalParamMap = getAdditionalParamMap(pageContext);
398
399
  let dataId = eventParams ? eventParams.id : null;
399
400
  let ids = eventParams ? eventParams.ids : null;
400
- const dataModel = pageContext.value.entity.data;
401
- const pageModel = pageContext.value.entity.page;
401
+ let selections = eventParams ? eventParams.selections : [];
402
+ console.log(
403
+ "getPopPageSetting---selections=",
404
+ selections,
405
+ "parentPageContext.value=",
406
+ parentPageContext.value
407
+ );
402
408
  let entity = {};
403
- if (pageModel) {
404
- Object.assign(entity, pageModel);
405
- }
406
- if (dataModel) {
407
- Object.assign(entity, dataModel);
409
+ if (selections && selections.length > 0) {
410
+ entity = selections[0];
411
+ } else {
412
+ const dataModel = parentPageContext.value.entity.data;
413
+ const pageModel = parentPageContext.value.entity.page;
414
+ if (pageModel) {
415
+ Object.assign(entity, pageModel);
416
+ }
417
+ if (dataModel) {
418
+ Object.assign(entity, dataModel);
419
+ }
408
420
  }
409
421
  jumpToPage(myJumpPageSetting, null, dataId, entity, additionalParamMap, ids).then(
410
422
  (openPageParams) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.22",
3
+ "version": "2.1.27",
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.63",
51
+ "agilebuilder-ui": "1.0.66",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",