super-page-runtime 2.1.37-temp6 → 2.1.38

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 (37) hide show
  1. package/dist/es/components/runtime/utils/api/api-util.js +2 -1
  2. package/dist/es/components/runtime/utils/assemblys-config.js +7 -0
  3. package/dist/es/components/runtime/utils/events/validator-util.js +26 -6
  4. package/dist/es/components/runtime/utils/i18n-util.js +23 -0
  5. package/dist/es/components/runtime/utils/page-helper-util.js +2 -1
  6. package/dist/es/components/runtime/utils/page-init-util.js +2 -1
  7. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +3 -2
  8. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +4 -3
  9. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +5 -4
  10. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +4 -0
  11. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +126 -0
  12. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +2 -1
  13. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +2 -1
  14. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +2 -2
  15. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +2 -1
  16. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +10 -0
  17. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +10 -0
  18. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +7 -3
  19. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +42 -9
  20. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +4 -2
  21. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +4 -7
  22. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +21 -10
  23. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +4 -2
  24. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +90 -19
  25. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +6 -4
  26. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +2 -1
  27. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
  28. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
  29. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +7 -3
  30. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +4 -2
  31. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +4 -2
  32. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +2 -1
  33. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +4 -2
  34. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +4 -2
  35. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +4 -2
  36. package/dist/es/components/runtime/views/super-page.vue.js +45 -23
  37. package/package.json +4 -4
@@ -1,13 +1,13 @@
1
- import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, resolveDynamicComponent } from "vue";
1
+ import { defineComponent, computed, ref, onMounted, onUnmounted, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, resolveDynamicComponent } from "vue";
2
2
  import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
3
  import { getVariableValue, setVariableValue, getFormPropName, setVariableValueWithProp } from "../../../../utils/page-helper-util.js";
4
- import "quill";
5
- import "quill/dist/quill.snow.css";
6
4
  import { handleEvent } from "../../../../utils/events/event-util.js";
7
5
  import { packageCustomRules } from "../../../../utils/events/validator-util.js";
8
6
  import { getListCode } from "../../../../utils/common-util.js";
9
7
  import { getComponentRef } from "../../../../utils/global-refs.js";
10
8
  import { getAdditionalParamMap } from "../../../../utils/events/standard-event.js";
9
+ import { $t } from "../../../../utils/i18n-util.js";
10
+ import eventBus from "../../../../utils/eventBus.js";
11
11
  const _hoisted_1 = {
12
12
  key: 0,
13
13
  style: { "width": "100%", "height": "100%" }
@@ -42,7 +42,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
43
43
  const customParams = runtimeInfo.customParams ? runtimeInfo.customParams : {};
44
44
  const additionalParamMap = getAdditionalParamMap(props.pageContext);
45
- const componentName = ref(props.configure.props && props.configure.props.base ? props.configure.props.base.name : null);
45
+ const componentName = ref(
46
+ props.configure.props && props.configure.props.base ? props.configure.props.base.name : null
47
+ );
46
48
  console.log("自定义控件----componentName=", componentName, "designProperty=", designProperty);
47
49
  if (!props.pageContext.customValidatorUuids) {
48
50
  props.pageContext.customValidatorUuids = [];
@@ -66,7 +68,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
68
  const tableUuids = props.pageContext.tableUuids;
67
69
  if (tableUuids) {
68
70
  tableUuids.forEach((tableUuid) => {
69
- const listCode = getListCode(props.pageContext.code, props.pageContext.version, props.configure.uuid);
71
+ const listCode = getListCode(
72
+ props.pageContext.code,
73
+ props.pageContext.version,
74
+ props.configure.uuid
75
+ );
70
76
  const gridRef = getComponentRef(props.pageContext, tableUuid);
71
77
  if (gridRef) {
72
78
  gridRef.restoreGridEdit(listCode);
@@ -74,6 +80,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
80
  });
75
81
  }
76
82
  }
83
+ const pageCode = props.pageContext.code;
84
+ const componentId = ref(
85
+ dynamicFields && dynamicFields.length > 0 ? pageCode + "__" + dynamicFields.join("__") : null
86
+ );
87
+ const customRef = ref(null);
88
+ onMounted(() => {
89
+ eventBus.$on(componentId.value + "-scanDone", (data) => {
90
+ const value = data.result;
91
+ setVariableValue(entity, dynamicFields, value);
92
+ });
93
+ eventBus.$on(componentId.value + "-pickFileDone", (data) => {
94
+ console.log("superPage4444---pickFileDone--componentId.value=", componentId.value, "data=", data);
95
+ customRef.value.pickFileDone(data);
96
+ });
97
+ });
98
+ onUnmounted(() => {
99
+ eventBus.$off(componentId.value + "-scanDone");
100
+ eventBus.$off(componentId.value + "-pickFileDone");
101
+ });
77
102
  return (_ctx, _cache) => {
78
103
  const _component_el_form_item = resolveComponent("el-form-item");
79
104
  return designProperty.value.tittleShow ? (openBlock(), createBlock(_component_el_form_item, {
@@ -87,22 +112,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
87
112
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
88
113
  key: 0,
89
114
  style: normalizeStyle({ ...unref(headerStyle) })
90
- }, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
115
+ }, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
91
116
  ]),
92
117
  default: withCtx(() => [
93
118
  componentName.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
94
119
  (openBlock(), createBlock(resolveDynamicComponent(componentName.value), {
120
+ ref_key: "customRef",
121
+ ref: customRef,
95
122
  size: designProperty.value.size,
96
123
  entity: _ctx.pageContext.entity.data,
97
124
  pageData: _ctx.pageContext.entity.page,
98
125
  pageContext: _ctx.pageContext,
99
126
  configureObj: _ctx.configure,
100
- prop: unref(getFormPropName)(_ctx.configure.props && _ctx.configure.props.base ? _ctx.configure.props.base.prop : null),
127
+ prop: unref(getFormPropName)(
128
+ _ctx.configure.props && _ctx.configure.props.base ? _ctx.configure.props.base.prop : null
129
+ ),
101
130
  "custom-params": unref(customParams),
102
131
  modelValue: dynamicModelMethod.value,
103
132
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dynamicModelMethod.value = $event),
104
133
  disabled: designProperty.value.state === "disabled",
105
134
  "additional-param-map": unref(additionalParamMap),
135
+ "component-id": componentId.value,
106
136
  onSetEntityValue: customControlSetValue,
107
137
  onSetCustomRules: setCustomvalidateRules,
108
138
  onRestoreGridEdit: restoreGridEdit,
@@ -111,12 +141,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
111
141
  onClick: _cache[3] || (_cache[3] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "click")),
112
142
  onBlur: _cache[4] || (_cache[4] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "blur")),
113
143
  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"]))
144
+ }, null, 40, ["size", "entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))
115
145
  ])) : createCommentVNode("", true)
116
146
  ]),
117
147
  _: 1
118
148
  }, 8, ["required", "class", "label-width", "style"])) : componentName.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
119
149
  (openBlock(), createBlock(resolveDynamicComponent(componentName.value), {
150
+ ref_key: "customRef",
151
+ ref: customRef,
120
152
  entity: _ctx.pageContext.entity.data,
121
153
  pageData: _ctx.pageContext.entity.page,
122
154
  pageContext: _ctx.pageContext,
@@ -127,6 +159,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
127
159
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => dynamicModelMethod.value = $event),
128
160
  disabled: designProperty.value.state === "disabled",
129
161
  "additional-param-map": unref(additionalParamMap),
162
+ "component-id": componentId.value,
130
163
  onSetEntityValue: customControlSetValue,
131
164
  onSetCustomRules: setCustomvalidateRules,
132
165
  onRestoreGridEdit: restoreGridEdit,
@@ -135,7 +168,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
135
168
  onClick: _cache[9] || (_cache[9] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "click")),
136
169
  onBlur: _cache[10] || (_cache[10] = ($event) => unref(handleEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "blur")),
137
170
  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"]))
171
+ }, null, 40, ["entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))
139
172
  ])) : createCommentVNode("", true);
140
173
  };
141
174
  }
@@ -5,6 +5,7 @@ import { getValueFromVariable, setVariableValue, getVariableValue } from "../../
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
7
  import dayjs from "dayjs";
8
+ import { $t } from "../../../../utils/i18n-util.js";
8
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
10
  __name: "datepicker-runtime",
10
11
  props: {
@@ -18,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
19
  const runtimeStyle = runtimeInfo.style;
19
20
  const runtimeClass = runtimeInfo.class;
20
21
  const headerStyle = runtimeInfo.headerStyle;
22
+ const titleExceedStyle = runtimeInfo.titleExceedStyle;
21
23
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
22
24
  let dynamicFields = getFormModelFields(props.pageContext, props.configure);
23
25
  console.log("designProperty", designProperty);
@@ -149,14 +151,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
149
151
  label: withCtx(() => [
150
152
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
151
153
  key: 0,
152
- style: normalizeStyle({ ...unref(headerStyle) })
154
+ style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
153
155
  }, [
154
156
  designProperty.value.prefixType ? (openBlock(), createBlock(_sfc_main$1, {
155
157
  key: 0,
156
158
  pageContext: _ctx.pageContext,
157
159
  property: designProperty.value
158
160
  }, null, 8, ["pageContext", "property"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
159
- createTextVNode(toDisplayString(designProperty.value.title), 1)
161
+ createTextVNode(toDisplayString(unref($t)(designProperty.value.title)), 1)
160
162
  ], 64))
161
163
  ], 4)) : createCommentVNode("", true)
162
164
  ]),
@@ -1,11 +1,8 @@
1
1
  import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, Fragment, createTextVNode, toDisplayString, createCommentVNode, createVNode } from "vue";
2
2
  import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
- import "agilebuilder-ui/src/utils/request";
4
- import "dayjs";
5
- import "agilebuilder-ui/src/utils/calculator/calculator-util";
6
- import "../../../../utils/global-refs.js";
7
3
  import { handleFormEvent } from "../../../../utils/events/event-util.js";
8
4
  import _sfc_main$1 from "../common/title-suffix-element.vue.js";
5
+ import { $t } from "../../../../utils/i18n-util.js";
9
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
7
  __name: "depttree-runtime",
11
8
  props: {
@@ -26,6 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
23
  const runtimeStyle = runtimeInfo.style;
27
24
  const runtimeClass = runtimeInfo.class;
28
25
  const headerStyle = runtimeInfo.headerStyle;
26
+ const titleExceedStyle = runtimeInfo.titleExceedStyle;
29
27
  const autoSetFields = designProperty.value.autoSetFields ? designProperty.value.autoSetFields : [];
30
28
  function changeValue(value) {
31
29
  handleFormEvent(value, props.pageContext, props.configure, "change");
@@ -45,14 +43,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
43
  label: withCtx(() => [
46
44
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
47
45
  key: 0,
48
- style: normalizeStyle({ ...unref(headerStyle) })
46
+ style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
49
47
  }, [
50
48
  designProperty.value.prefixType ? (openBlock(), createBlock(_sfc_main$1, {
51
49
  key: 0,
52
50
  pageContext: _ctx.pageContext,
53
51
  property: designProperty.value
54
52
  }, null, 8, ["pageContext", "property"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
55
- createTextVNode(toDisplayString(designProperty.value.title), 1)
53
+ createTextVNode(toDisplayString(unref($t)(designProperty.value.title)), 1)
56
54
  ], 64))
57
55
  ], 4)) : createCommentVNode("", true)
58
56
  ]),
@@ -65,7 +63,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
65
63
  models: unref(dataModel),
66
64
  fields: unref(autoSetFields),
67
65
  size: designProperty.value.size,
68
- placeholder: "请选择",
69
66
  separator: designProperty.value.separator,
70
67
  onChange: changeValue,
71
68
  onShowTree: showTree
@@ -1,9 +1,10 @@
1
- import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode } from "vue";
1
+ import { defineComponent, ref, onMounted, onUnmounted, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode } from "vue";
2
2
  import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
3
3
  import { fileUploadBeforeUpload } from "../../../../utils/events/event-util.js";
4
4
  import http from "agilebuilder-ui/src/utils/request";
5
5
  import { FsUploadNew } from "agilebuilder-ui";
6
6
  import eventBus from "../../../../utils/eventBus.js";
7
+ import { $t } from "../../../../utils/i18n-util.js";
7
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
9
  __name: "fileupload-runtime",
9
10
  props: {
@@ -17,12 +18,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
18
  const runtimeStyle = runtimeInfo.style;
18
19
  const runtimeClass = runtimeInfo.class;
19
20
  const headerStyle = runtimeInfo.headerStyle;
21
+ const titleExceedStyle = runtimeInfo.titleExceedStyle;
20
22
  const entity = props.pageContext.entity ? props.pageContext.entity : {};
21
23
  const propsBase = props.configure.props.base ? props.configure.props.base : {};
22
24
  const pathFields = getFieldsByVariable(propsBase.prop);
23
25
  const nameFields = getFieldsByVariable(propsBase.propName);
24
26
  const pageCode = props.pageContext.code;
27
+ console.log("pathFields-----", pathFields, "pageCode=", pageCode, "propsBase.prop=", propsBase.prop);
25
28
  const componentId = ref(pathFields ? pageCode + "__" + pathFields.join("__") : null);
29
+ console.log("componentId-----", componentId.value);
26
30
  const initPaths = getVariableValue(entity, pathFields);
27
31
  const fileUploadRef = ref(null);
28
32
  const fileList = ref([]);
@@ -73,9 +77,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
77
  setVariableValue(props.pageContext.entity, pathFields, uuids.join(","));
74
78
  setVariableValue(props.pageContext.entity, nameFields, names.join(","));
75
79
  };
76
- eventBus.$on(componentId.value + "-pickFileDone", (data) => {
77
- console.log("superPage4444---pickFileDone--componentId.value=", componentId.value, "data=", data);
78
- fileUploadRef.value.pickFileDone(data);
80
+ onMounted(() => {
81
+ eventBus.$on(componentId.value + "-pickFileDone", (data) => {
82
+ console.log("superPage4444---pickFileDone--componentId.value=", componentId.value, "data=", data);
83
+ fileUploadRef.value.pickFileDone(data);
84
+ });
85
+ });
86
+ onUnmounted(() => {
87
+ eventBus.$off(componentId.value + "-pickFileDone");
79
88
  });
80
89
  return (_ctx, _cache) => {
81
90
  const _component_el_form_item = resolveComponent("el-form-item");
@@ -89,8 +98,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
98
  label: withCtx(() => [
90
99
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
91
100
  key: 0,
92
- style: normalizeStyle({ ...unref(headerStyle) })
93
- }, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
101
+ style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
102
+ }, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
94
103
  ]),
95
104
  default: withCtx(() => [
96
105
  createVNode(unref(FsUploadNew), {
@@ -104,15 +113,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
104
113
  placeholder: designProperty.value.placeholder,
105
114
  limit: designProperty.value.limit,
106
115
  "limit-file-size": designProperty.value.limitFileSize,
116
+ openCameraOrChoosePhoto: designProperty.value.openCameraOrChoosePhoto,
107
117
  "file-info": fileInfo.value,
108
118
  "file-list": fileList.value,
109
119
  "system-code": _ctx.pageContext.systemCode,
110
- "component-id": componentId.value,
120
+ componentId: componentId.value,
111
121
  "on-success": onSuccess,
112
122
  "on-remove": onRemove,
113
123
  "before-upload": beforeUpload,
114
124
  pageContext: _ctx.pageContext
115
- }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "file-info", "file-list", "system-code", "component-id", "pageContext"])
125
+ }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "openCameraOrChoosePhoto", "file-info", "file-list", "system-code", "componentId", "pageContext"])
116
126
  ]),
117
127
  _: 1
118
128
  }, 8, ["required", "class", "label-width", "style"])) : (openBlock(), createBlock(unref(FsUploadNew), {
@@ -127,15 +137,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
127
137
  placeholder: designProperty.value.placeholder,
128
138
  limit: designProperty.value.limit,
129
139
  "limit-file-size": designProperty.value.limitFileSize,
140
+ openCameraOrChoosePhoto: designProperty.value.openCameraOrChoosePhoto,
130
141
  "file-info": fileInfo.value,
131
142
  "file-list": fileList.value,
132
143
  "system-code": _ctx.pageContext.systemCode,
133
- "component-id": componentId.value,
144
+ componentId: componentId.value,
134
145
  "on-success": onSuccess,
135
146
  "on-remove": onRemove,
136
147
  "before-upload": beforeUpload,
137
148
  pageContext: _ctx.pageContext
138
- }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "file-info", "file-list", "system-code", "component-id", "pageContext"]));
149
+ }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "openCameraOrChoosePhoto", "file-info", "file-list", "system-code", "componentId", "pageContext"]));
139
150
  };
140
151
  }
141
152
  });
@@ -3,6 +3,7 @@ import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
3
  import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
4
4
  import { handleFormEvent } from "../../../../utils/events/event-util.js";
5
5
  import _sfc_main$1 from "../common/title-suffix-element.vue.js";
6
+ import { $t } from "../../../../utils/i18n-util.js";
6
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
8
  __name: "input-number-runtime",
8
9
  props: {
@@ -25,6 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
26
  const runtimeStyle = runtimeInfo.style;
26
27
  const runtimeClass = runtimeInfo.class;
27
28
  const headerStyle = runtimeInfo.headerStyle;
29
+ const titleExceedStyle = runtimeInfo.titleExceedStyle;
28
30
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
29
31
  return (_ctx, _cache) => {
30
32
  const _component_el_input_number = resolveComponent("el-input-number");
@@ -38,14 +40,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
40
  label: withCtx(() => [
39
41
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
40
42
  key: 0,
41
- style: normalizeStyle({ ...unref(headerStyle) })
43
+ style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
42
44
  }, [
43
45
  designProperty.value.prefixType ? (openBlock(), createBlock(_sfc_main$1, {
44
46
  key: 0,
45
47
  pageContext: _ctx.pageContext,
46
48
  property: designProperty.value
47
49
  }, null, 8, ["pageContext", "property"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
48
- createTextVNode(toDisplayString(designProperty.value.title), 1)
50
+ createTextVNode(toDisplayString(unref($t)(designProperty.value.title)), 1)
49
51
  ], 64))
50
52
  ], 4)) : createCommentVNode("", true)
51
53
  ]),
@@ -1,10 +1,13 @@
1
- import { defineComponent, computed, ref, watch, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, Fragment, createTextVNode, toDisplayString, createCommentVNode, createVNode, createSlots } from "vue";
1
+ import { defineComponent, ref, computed, onMounted, onUnmounted, watch, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, Fragment, createTextVNode, toDisplayString, createCommentVNode, createVNode, createSlots } from "vue";
2
2
  import { SuperIcon } from "agilebuilder-ui";
3
3
  import { getFormModelFields } from "../../../../utils/page-init-util.js";
4
4
  import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
5
5
  import { handleFormEvent } from "../../../../utils/events/event-util.js";
6
6
  import { formatScanRuleSets, analysisScanValue, setScanAnalysisValue } from "../../../../utils/form/scan-util.js";
7
7
  import _sfc_main$1 from "../common/title-suffix-element.vue.js";
8
+ import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
9
+ import eventBus from "../../../../utils/eventBus.js";
10
+ import { $t } from "../../../../utils/i18n-util.js";
8
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
12
  __name: "inputtext-runtime",
10
13
  props: {
@@ -12,10 +15,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
15
  configure: {}
13
16
  },
14
17
  setup(__props, { expose: __expose }) {
15
- var _a, _b;
18
+ var _a, _b, _c;
16
19
  const props = __props;
17
20
  const entity = props.pageContext.entity ? props.pageContext.entity : {};
18
21
  let dynamicFields = getFormModelFields(props.pageContext, props.configure);
22
+ const isMobile = ref(isMobileBrowser());
23
+ const pageCode = props.pageContext.code;
24
+ console.log(
25
+ "pathFields-----",
26
+ dynamicFields,
27
+ "pageCode=",
28
+ pageCode,
29
+ "props.configure=",
30
+ props.configure
31
+ );
32
+ const componentId = ref(
33
+ dynamicFields && dynamicFields.length > 0 ? pageCode + "__" + dynamicFields.join("__") : null
34
+ );
35
+ console.log("componentId-----", componentId.value);
19
36
  const dynamicModelMethod = computed({
20
37
  get() {
21
38
  return getVariableValue(entity, dynamicFields);
@@ -24,16 +41,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
41
  setVariableValue(entity, dynamicFields, value);
25
42
  }
26
43
  });
44
+ onMounted(() => {
45
+ eventBus.$on(componentId.value + "-scanDone", (data) => {
46
+ console.log(
47
+ "superPage4444---scanDone--componentId.value=",
48
+ componentId.value,
49
+ "data=",
50
+ JSON.stringify(data)
51
+ );
52
+ setValue(data.result);
53
+ });
54
+ });
55
+ onUnmounted(() => {
56
+ eventBus.$off(componentId.value + "-scanDone");
57
+ });
27
58
  const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
28
59
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
60
+ const scanEnable = ref(((_a = designProperty.value.scan) == null ? void 0 : _a.enable) ? true : false);
61
+ let userAgent;
62
+ const userAgentOrg = navigator.userAgent;
63
+ if (userAgentOrg.indexOf(" uni-app ") > 0) {
64
+ userAgent = "app";
65
+ } else {
66
+ userAgent = "browser";
67
+ }
68
+ console.log("window.location.protocol---", window.location.protocol);
69
+ const isShowScanIcon = ref(isMobile.value && scanEnable.value && window.location.protocol === "https:" ? true : false);
70
+ const isApk = isMobile.value && userAgent && userAgent === "app" ? true : false;
29
71
  let scanRuleSets = {};
30
- if (((_a = designProperty.value.scan) == null ? void 0 : _a.enable) && ((_b = designProperty.value.scan.ruleList) == null ? void 0 : _b.length) > 0) {
72
+ if (((_b = designProperty.value.scan) == null ? void 0 : _b.enable) && ((_c = designProperty.value.scan.ruleList) == null ? void 0 : _c.length) > 0) {
31
73
  setScanRuleSets();
32
74
  watchScanValueChange();
33
75
  }
34
76
  const runtimeStyle = runtimeInfo.style;
35
77
  const runtimeClass = runtimeInfo.class;
36
78
  const headerStyle = runtimeInfo.headerStyle;
79
+ const titleExceedStyle = runtimeInfo.titleExceedStyle;
37
80
  function getValue() {
38
81
  return getVariableValue(entity, dynamicFields);
39
82
  }
@@ -56,12 +99,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
99
  }
57
100
  );
58
101
  }
102
+ const isShowBrowserScan = ref(false);
103
+ function scanClick() {
104
+ console.log("scanClick----userAgent=", userAgent);
105
+ if (isApk) {
106
+ const message = {
107
+ type: "scan",
108
+ componentId: componentId.value,
109
+ systemCode: props.pageContext.systemCode
110
+ };
111
+ window.parent.postMessage(JSON.stringify(message), "*");
112
+ } else {
113
+ isShowBrowserScan.value = true;
114
+ }
115
+ }
116
+ function closeBrowserScan(value) {
117
+ isShowBrowserScan.value = false;
118
+ setValue(value);
119
+ }
59
120
  __expose({
60
121
  getValue,
61
122
  setValue
62
123
  });
63
124
  return (_ctx, _cache) => {
64
125
  const _component_el_input = resolveComponent("el-input");
126
+ const _component_scan_code_input_browser = resolveComponent("scan-code-input-browser");
65
127
  const _component_el_form_item = resolveComponent("el-form-item");
66
128
  return openBlock(), createBlock(_component_el_form_item, {
67
129
  required: designProperty.value.required ? true : false,
@@ -72,14 +134,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
72
134
  label: withCtx(() => [
73
135
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
74
136
  key: 0,
75
- style: normalizeStyle({ ...unref(headerStyle) })
137
+ style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
76
138
  }, [
77
139
  designProperty.value.prefixType ? (openBlock(), createBlock(_sfc_main$1, {
78
140
  key: 0,
79
141
  pageContext: _ctx.pageContext,
80
142
  property: designProperty.value
81
143
  }, null, 8, ["pageContext", "property"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
82
- createTextVNode(toDisplayString(designProperty.value.title), 1)
144
+ createTextVNode(toDisplayString(unref($t)(designProperty.value.title)), 1)
83
145
  ], 64))
84
146
  ], 4)) : createCommentVNode("", true)
85
147
  ]),
@@ -93,12 +155,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
93
155
  maxlength: designProperty.value.maxLength,
94
156
  "show-word-limit": designProperty.value.showInputNum,
95
157
  modelValue: dynamicModelMethod.value,
96
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dynamicModelMethod.value = $event),
97
- onInput: _cache[5] || (_cache[5] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "input")),
98
- onChange: _cache[6] || (_cache[6] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
99
- onBlur: _cache[7] || (_cache[7] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
100
- onFocus: _cache[8] || (_cache[8] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "focus")),
101
- onClick: _cache[9] || (_cache[9] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "click"))
158
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => dynamicModelMethod.value = $event),
159
+ onInput: _cache[6] || (_cache[6] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "input")),
160
+ onChange: _cache[7] || (_cache[7] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "change")),
161
+ onBlur: _cache[8] || (_cache[8] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "blur")),
162
+ onFocus: _cache[9] || (_cache[9] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "focus")),
163
+ onClick: _cache[10] || (_cache[10] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "click"))
102
164
  }, createSlots({ _: 2 }, [
103
165
  designProperty.value.iconPosition != "outer" && (designProperty.value.preIconType && designProperty.value.preIconValue || designProperty.value.preText) ? {
104
166
  name: "prefix",
@@ -109,7 +171,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
171
  iconValue: designProperty.value.preIconValue,
110
172
  onClick: _cache[0] || (_cache[0] = ($event) => unref(handleFormEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "prefixClick"))
111
173
  }, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
112
- createTextVNode(" " + toDisplayString(designProperty.value.preText), 1)
174
+ createTextVNode(" " + toDisplayString(unref($t)(designProperty.value.preText)), 1)
113
175
  ]),
114
176
  key: "0"
115
177
  } : void 0,
@@ -122,7 +184,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
122
184
  iconValue: designProperty.value.preIconValue,
123
185
  onClick: _cache[1] || (_cache[1] = ($event) => unref(handleFormEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "prefixClick"))
124
186
  }, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
125
- createTextVNode(" " + toDisplayString(designProperty.value.preText), 1)
187
+ createTextVNode(" " + toDisplayString(unref($t)(designProperty.value.preText)), 1)
126
188
  ]),
127
189
  key: "1"
128
190
  } : void 0,
@@ -135,24 +197,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
135
197
  iconValue: designProperty.value.sufIconValue,
136
198
  onClick: _cache[2] || (_cache[2] = ($event) => unref(handleFormEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "suffixClick"))
137
199
  }, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
138
- createTextVNode(" " + toDisplayString(designProperty.value.sufText), 1)
200
+ createTextVNode(" " + toDisplayString(unref($t)(designProperty.value.sufText)), 1)
139
201
  ]),
140
202
  key: "2"
141
203
  } : void 0,
142
- designProperty.value.iconPosition == "outer" && (designProperty.value.sufIconType && designProperty.value.sufIconValue || designProperty.value.sufText) ? {
204
+ isShowScanIcon.value || designProperty.value.iconPosition == "outer" && (designProperty.value.sufIconType && designProperty.value.sufIconValue || designProperty.value.sufText) ? {
143
205
  name: "append",
144
206
  fn: withCtx(() => [
145
- designProperty.value.sufIconType && designProperty.value.sufIconValue ? (openBlock(), createBlock(unref(SuperIcon), {
207
+ isShowScanIcon.value ? (openBlock(), createBlock(unref(SuperIcon), {
146
208
  key: 0,
209
+ iconValue: "fa-barcode",
210
+ onClick: _cache[3] || (_cache[3] = ($event) => scanClick())
211
+ })) : createCommentVNode("", true),
212
+ designProperty.value.sufIconType && designProperty.value.sufIconValue ? (openBlock(), createBlock(unref(SuperIcon), {
213
+ key: 1,
147
214
  iconType: designProperty.value.sufIconType,
148
215
  iconValue: designProperty.value.sufIconValue,
149
- onClick: _cache[3] || (_cache[3] = ($event) => unref(handleFormEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "suffixClick"))
216
+ onClick: _cache[4] || (_cache[4] = ($event) => unref(handleFormEvent)(dynamicModelMethod.value, _ctx.pageContext, _ctx.configure, "suffixClick"))
150
217
  }, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
151
- createTextVNode(" " + toDisplayString(designProperty.value.sufText), 1)
218
+ createTextVNode(" " + toDisplayString(unref($t)(designProperty.value.sufText)), 1)
152
219
  ]),
153
220
  key: "3"
154
221
  } : void 0
155
- ]), 1032, ["disabled", "readonly", "size", "clearable", "placeholder", "maxlength", "show-word-limit", "modelValue"])
222
+ ]), 1032, ["disabled", "readonly", "size", "clearable", "placeholder", "maxlength", "show-word-limit", "modelValue"]),
223
+ isShowBrowserScan.value ? (openBlock(), createBlock(_component_scan_code_input_browser, {
224
+ key: 0,
225
+ onClose: closeBrowserScan
226
+ })) : createCommentVNode("", true)
156
227
  ]),
157
228
  _: 1
158
229
  }, 8, ["required", "class", "label-width", "style"]);
@@ -3,6 +3,7 @@ import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
3
  import { getVariableValue, formatValueByType } from "../../../../utils/page-helper-util.js";
4
4
  import { SuperIcon } from "agilebuilder-ui";
5
5
  import { getCustomFunc, handleFormEvent } from "../../../../utils/events/event-util.js";
6
+ import { $t } from "../../../../utils/i18n-util.js";
6
7
  const _hoisted_1 = { style: { "width": "100%", "text-align": "center", "font-weight": "700", "font-size": "24px", "margin-bottom": "20px" } };
7
8
  const _hoisted_2 = { style: { "overflow": "hidden", "white-space": "nowrap" } };
8
9
  const _hoisted_3 = ["title"];
@@ -22,6 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
23
  const headerStyle = runtimeInfo.headerStyle;
23
24
  const appendClass = runtimeInfo.appendClass;
24
25
  const appendStyle = runtimeInfo.appendStyle;
26
+ const titleExceedStyle = runtimeInfo.titleExceedStyle;
25
27
  const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
26
28
  const listOptions = ref(designProperty.value.options ? designProperty.value.options : []);
27
29
  const formatType = designProperty.value.formatType;
@@ -81,8 +83,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
83
  label: withCtx(() => [
82
84
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
83
85
  key: 0,
84
- style: normalizeStyle({ ...unref(headerStyle) })
85
- }, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
86
+ style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
87
+ }, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
86
88
  ]),
87
89
  default: withCtx(() => [
88
90
  createElementVNode("div", {
@@ -103,7 +105,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
105
  iconType: designProperty.value.preIconType,
104
106
  iconValue: designProperty.value.preIconValue
105
107
  }, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
106
- createTextVNode(" " + toDisplayString(designProperty.value.preText), 1)
108
+ createTextVNode(" " + toDisplayString(unref($t)(designProperty.value.preText)), 1)
107
109
  ], 6)) : createCommentVNode("", true),
108
110
  createTextVNode("  " + toDisplayString(dynamicValue.value), 1)
109
111
  ]),
@@ -120,7 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
120
122
  iconType: designProperty.value.sufIconType,
121
123
  iconValue: designProperty.value.sufIconValue
122
124
  }, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
123
- createElementVNode("span", null, " " + toDisplayString(designProperty.value.sufText), 1)
125
+ createElementVNode("span", null, " " + toDisplayString(unref($t)(designProperty.value.sufText)), 1)
124
126
  ], 2)) : createCommentVNode("", true)
125
127
  ])
126
128
  ]),
@@ -2,6 +2,7 @@ import { defineComponent, ref, computed, resolveComponent, openBlock, createBloc
2
2
  import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
3
  import { getVariableValue } from "../../../../utils/page-helper-util.js";
4
4
  import { handleEvent } from "../../../../utils/events/event-util.js";
5
+ import { $t } from "../../../../utils/i18n-util.js";
5
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
7
  __name: "link-runtime",
7
8
  props: {
@@ -49,7 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
50
  designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
50
51
  key: 0,
51
52
  style: normalizeStyle({ ...unref(headerStyle) })
52
- }, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
53
+ }, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
53
54
  ]),
54
55
  default: withCtx(() => [
55
56
  createVNode(_component_el_tooltip, {
@@ -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 {