super-page-runtime 2.1.23 → 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 (19) hide show
  1. package/dist/es/components/runtime/utils/api/api-util.js +7 -0
  2. package/dist/es/components/runtime/utils/api/page-expose-util.js +25 -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 +1 -1
  6. package/dist/es/components/runtime/utils/page-init-util.js +3 -0
  7. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +28 -7
  8. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +3 -1
  9. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +4 -2
  10. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +3 -1
  11. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +3 -1
  12. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +5 -3
  13. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +1 -0
  14. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +4 -0
  15. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +145 -0
  16. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +50 -7
  17. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +18 -8
  18. package/dist/es/components/runtime/views/super-page.vue.js +8 -3
  19. 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
  });
@@ -298,6 +303,8 @@ function formatAdditionalParamMapIds(ids) {
298
303
  return ids;
299
304
  }
300
305
  window["$PageUtil"] = functions;
306
+ window["$message"] = ElMessage;
307
+ window["$messageBox"] = ElMessageBox;
301
308
  export {
302
309
  getFormData,
303
310
  refreshPage
@@ -279,6 +279,31 @@ const functions = {
279
279
  // 获得平台后端访问路径
280
280
  getPlateBackendUrl() {
281
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;
282
307
  }
283
308
  };
284
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);
@@ -236,7 +236,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
236
236
  if (customUuids) {
237
237
  customUuids.forEach((componentUuid) => {
238
238
  const customRef = getComponentRef(pageContext, componentUuid);
239
- if (customRef) {
239
+ if (customRef && customRef.validator) {
240
240
  validatorResult.push(customRef.validator());
241
241
  }
242
242
  });
@@ -324,6 +324,9 @@ function packageFormRules(pageContext, configure) {
324
324
  if (!allFieldsDisabled && configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
325
325
  const propEditPermission = pageContext.fieldPermissionMap.get(propName);
326
326
  console.log("packageFormRules-----prop=", prop, "--propEditPermission=", propEditPermission);
327
+ if (!configure.runtime.props) {
328
+ configure.runtime.props = {};
329
+ }
327
330
  if (propEditPermission) {
328
331
  if (propEditPermission["canEdit"] === false) {
329
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"]);
@@ -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 = {};
@@ -399,7 +399,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
399
399
  let dataId = eventParams ? eventParams.id : null;
400
400
  let ids = eventParams ? eventParams.ids : null;
401
401
  let selections = eventParams ? eventParams.selections : [];
402
- console.log("getPopPageSetting---selections=", selections, "parentPageContext.value=", parentPageContext.value);
402
+ console.log(
403
+ "getPopPageSetting---selections=",
404
+ selections,
405
+ "parentPageContext.value=",
406
+ parentPageContext.value
407
+ );
403
408
  let entity = {};
404
409
  if (selections && selections.length > 0) {
405
410
  entity = selections[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.23",
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.64",
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",