super-page-runtime 2.2.29-tmp2 → 2.2.32

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 (167) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +5 -7
  2. package/dist/es/assets/chart-themes/theme1.js +2 -6
  3. package/dist/es/assets/chart-themes/theme2.js +2 -6
  4. package/dist/es/assets/chart-themes/theme3.js +2 -6
  5. package/dist/es/components/runtime/utils/api/api-util.js +4 -7
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +135 -443
  7. package/dist/es/components/runtime/utils/assemblys-config.js +13 -369
  8. package/dist/es/components/runtime/utils/barcode-util.js +9 -33
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +122 -306
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -68
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +68 -152
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +46 -124
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +36 -99
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +224 -522
  15. package/dist/es/components/runtime/utils/common-util.js +76 -156
  16. package/dist/es/components/runtime/utils/eventBus.js +3 -8
  17. package/dist/es/components/runtime/utils/events/event-util.js +362 -775
  18. package/dist/es/components/runtime/utils/events/print-label.js +72 -140
  19. package/dist/es/components/runtime/utils/events/standard-event.js +808 -2320
  20. package/dist/es/components/runtime/utils/events/validator-util.js +224 -560
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +28 -88
  22. package/dist/es/components/runtime/utils/form/scan-util.js +61 -162
  23. package/dist/es/components/runtime/utils/global-refs.js +53 -84
  24. package/dist/es/components/runtime/utils/i18n-util.js +11 -20
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +6 -0
  26. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  27. package/dist/es/components/runtime/utils/page-helper-util.js +280 -660
  28. package/dist/es/components/runtime/utils/page-init-util.js +141 -406
  29. package/dist/es/components/runtime/utils/page-permission-util.js +22 -531
  30. package/dist/es/components/runtime/utils/page-store.js +23 -68
  31. package/dist/es/components/runtime/utils/store-util.js +9 -13
  32. package/dist/es/components/runtime/utils/store.js +2 -2
  33. package/dist/es/components/runtime/utils/table-utils.d.ts +4 -0
  34. package/dist/es/components/runtime/utils/table-utils.js +40 -81
  35. package/dist/es/components/runtime/utils/tree-utils.js +17 -37
  36. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  37. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +21 -83
  38. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  39. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  40. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +36 -132
  42. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  44. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  46. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  47. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +50 -198
  48. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +52 -203
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  54. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
  55. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +46 -162
  56. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -109
  58. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -166
  60. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -117
  62. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  63. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -118
  64. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +246 -597
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  68. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +29 -160
  70. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  73. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  74. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +212 -594
  75. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  76. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +21 -125
  78. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  80. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  81. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  83. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  85. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  87. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  89. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  91. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  93. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  95. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  97. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  98. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  99. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +317 -810
  100. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +262 -635
  102. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  103. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +40 -115
  105. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -215
  107. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  108. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  110. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +42 -154
  111. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +34 -98
  112. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  113. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +52 -200
  115. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +68 -239
  117. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +31 -109
  119. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +21 -59
  121. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +56 -188
  123. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  125. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +57 -245
  127. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +32 -174
  129. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  130. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  131. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  132. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  133. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +64 -194
  135. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +88 -249
  137. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +80 -263
  139. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  141. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  143. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  144. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +40 -129
  145. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  146. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  147. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +89 -188
  148. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +133 -272
  150. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +18 -46
  153. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  154. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +21 -49
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +20 -58
  157. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  158. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  159. package/dist/es/components/runtime/views/home-chart.vue.js +41 -160
  160. package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
  161. package/dist/es/components/runtime/views/super-page-dialog.vue.js +20 -139
  162. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  163. package/dist/es/components/runtime/views/super-page.vue.js +226 -754
  164. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  165. package/dist/es/i18n/langs/cn.js +2 -55
  166. package/dist/es/i18n/langs/en.js +2 -55
  167. package/package.json +2 -2
@@ -1,259 +1,98 @@
1
- import { defineComponent, ref, watch, onMounted, nextTick, onBeforeUnmount, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, normalizeStyle, normalizeClass, unref, withCtx, createElementVNode, toDisplayString } from "vue";
2
- import { getFormModelFields } from "../../../../utils/page-init-util.js";
3
- import { formatVariableValue, setVariableValue, getVariableValue } from "../../../../utils/page-helper-util.js";
4
- import Quill from "quill";
1
+ import { defineComponent as e, ref as t, watch as l, onMounted as n, nextTick as i, onBeforeUnmount as o, resolveComponent as r, createElementBlock as a, openBlock as u, Fragment as s, createBlock as c, createCommentVNode as p, normalizeStyle as d, normalizeClass as g, unref as m, withCtx as f, createElementVNode as v, toDisplayString as h } from "vue";
2
+ import { getFormModelFields as x } from "../../../../utils/page-init-util.js";
3
+ import { formatVariableValue as y, setVariableValue as b, getVariableValue as C } from "../../../../utils/page-helper-util.js";
4
+ import w from "quill";
5
5
  import "quill/dist/quill.snow.css";
6
- import { handleAfterInitEvent, handleFormEvent } from "../../../../utils/events/event-util.js";
7
- import http from "agilebuilder-ui/src/utils/request";
8
- import { $t } from "../../../../utils/i18n-util.js";
9
- import { getToken } from "agilebuilder-ui/src/utils/auth";
10
- import { getBaseUrl } from "../../../../utils/common-util.js";
11
- const _hoisted_1 = { style: { "width": "100%", "height": "100%" } };
12
- const _sfc_main = /* @__PURE__ */ defineComponent({
13
- __name: "richtext-runtime",
14
- props: {
15
- pageContext: {},
16
- configure: {}
17
- },
18
- setup(__props) {
19
- const props = __props;
20
- const entity = props.pageContext.entity ? props.pageContext.entity : {};
21
- const dynamicFields = getFormModelFields(props.pageContext, props.configure);
22
- const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
23
- const runtimeStyle = runtimeInfo.style;
24
- const runtimeClass = runtimeInfo.class;
25
- const headerStyle = runtimeInfo.headerStyle;
26
- const titleExceedStyle = runtimeInfo.titleExceedStyle;
27
- const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
28
- let contentVariable = designProperty.value.value;
29
- const initValue = formatVariableValue(props.pageContext, contentVariable);
30
- const quillEditorRef = ref(null);
31
- let quill = null;
32
- ref(null);
33
- const fontSize = [
34
- "12px",
35
- "13px",
36
- "14px",
37
- "15px",
38
- "16px",
39
- "18px",
40
- "20px",
41
- "24px",
42
- "28px",
43
- "32px",
44
- "36px"
45
- ];
46
- let hisState = designProperty.value.state;
47
- function checkReadonly(state) {
48
- return state == "readonly" || state == "disabled";
6
+ import { handleAfterInitEvent as k, handleFormEvent as q } from "../../../../utils/events/event-util.js";
7
+ import T from "agilebuilder-ui/src/utils/request";
8
+ import { $t as E } from "../../../../utils/i18n-util.js";
9
+ import { getToken as L } from "agilebuilder-ui/src/utils/auth";
10
+ import { getBaseUrl as j } from "../../../../utils/common-util.js";
11
+ const R = { style: { width: "100%", height: "100%" } }, S = e({ __name: "richtext-runtime", props: { pageContext: {}, configure: {} }, setup(e2) {
12
+ const S2 = e2, _ = S2.pageContext.entity ? S2.pageContext.entity : {}, B = x(S2.pageContext, S2.configure), H = S2.configure.runtime ? S2.configure.runtime : {}, M = H.style, N = H.class, A = H.headerStyle, D = H.titleExceedStyle, F = t(H.props ? H.props : {});
13
+ let U = F.value.value;
14
+ const W = y(S2.pageContext, U), z = t(null);
15
+ let I = null;
16
+ t(null);
17
+ let O = F.value.state;
18
+ function G(e3) {
19
+ return "readonly" == e3 || "disabled" == e3;
20
+ }
21
+ const J = G(O), K = t({ modules: { toolbar: [["bold", "italic", "underline", "strike"], ["blockquote", "code-block"], [{ list: "ordered" }, { list: "bullet" }], [{ script: "sub" }, { script: "super" }], [{ indent: "-1" }, { indent: "+1" }], [{ direction: "rtl" }], [{ size: ["12px", "13px", "14px", "15px", "16px", "18px", "20px", "24px", "28px", "32px", "36px"] }], [{ header: [1, 2, 3, 4, 5, 6, false] }], [{ color: [] }, { background: [] }], [{ font: [] }], [{ align: [] }], ["clean"], ["link", "image"]] }, theme: "snow", placeholder: J ? "" : F.value.placeholder, readOnly: J });
22
+ l(F.value, () => {
23
+ const e3 = F.value.state;
24
+ if (null != e3 && e3 !== O) {
25
+ O = e3;
26
+ const t2 = G(O);
27
+ I && (I.enable(!t2), I.root.dataset.placeholder = t2 ? "" : F.value.placeholder);
49
28
  }
50
- const initReadonly = checkReadonly(hisState);
51
- const option = ref({
52
- modules: {
53
- toolbar: [
54
- ["bold", "italic", "underline", "strike"],
55
- // 加粗 斜体 下划线 删除线
56
- ["blockquote", "code-block"],
57
- // 引用
58
- [{ list: "ordered" }, { list: "bullet" }],
59
- // 有序、无序列表
60
- [{ script: "sub" }, { script: "super" }],
61
- // 上标/下标
62
- [{ indent: "-1" }, { indent: "+1" }],
63
- // 缩进
64
- [{ direction: "rtl" }],
65
- // 文本方向
66
- [{ size: fontSize }],
67
- // 字体大小
68
- [{ header: [1, 2, 3, 4, 5, 6, false] }],
69
- // 标题
70
- [{ color: [] }, { background: [] }],
71
- // 字体颜色、字体背景颜色
72
- [{ font: [] }],
73
- // 字体种类
74
- [{ align: [] }],
75
- // 对齐方式
76
- ["clean"],
77
- // 清除文本格式
78
- ["link", "image"]
79
- // 链接、图片、视频
80
- ]
81
- },
82
- theme: "snow",
83
- placeholder: initReadonly ? "" : designProperty.value.placeholder,
84
- readOnly: initReadonly
85
- });
86
- watch(designProperty.value, () => {
87
- const newState = designProperty.value.state;
88
- if (newState != void 0 && newState !== hisState) {
89
- hisState = newState;
90
- const isReadonly = checkReadonly(hisState);
91
- if (quill) {
92
- quill.enable(!isReadonly);
93
- quill.root.dataset.placeholder = isReadonly ? "" : designProperty.value.placeholder;
94
- }
95
- }
96
- });
97
- function updateEditorHeight() {
98
- if (quill && quill.container) {
99
- const parentNode = quill.container.parentNode;
100
- const parentRect = parentNode.getBoundingClientRect();
101
- const thisRect = quill.container.getBoundingClientRect();
102
- let newHeight = parentRect.height - (thisRect.top - parentRect.top);
103
- if (newHeight < 100) {
104
- newHeight = 100;
105
- }
106
- quill.container.style.height = newHeight + "px";
107
- }
29
+ });
30
+ const P = t([]), Q = t(false), V = t(null), X = t(null), Y = t(null);
31
+ let Z;
32
+ function $(e3) {
33
+ var _a;
34
+ null !== e3.relatedTarget && ((_a = z.value) == null ? void 0 : _a.contains(e3.relatedTarget)) || q(I.root.innerHTML, S2.pageContext, S2.configure, "change", { entity: _ });
35
+ }
36
+ function ee(e3) {
37
+ if ("img" === e3.target.localName) {
38
+ P.value = [];
39
+ let t2 = e3.target.src;
40
+ P.value.push(t2), Q.value = true;
108
41
  }
109
- const previewList = ref([]);
110
- const showViewer = ref(false);
111
- const formItemRef = ref(null);
112
- const componentRef = ref(null);
113
- const titleRef = ref(null);
114
- let editorContainer;
115
- onMounted(() => {
116
- var _a;
117
- quill = new Quill(quillEditorRef.value, option.value);
118
- const delta = quill.clipboard.convertHTML(initValue);
119
- quill.setContents(delta.ops);
120
- (_a = quillEditorRef.value) == null ? void 0 : _a.addEventListener("focusout", handleFocusOut);
121
- quill.on("text-change", async function(delta2, oldDelta, source) {
122
- if (delta2.ops && delta2.ops.length > 0) {
123
- for (let i = 0; i < delta2.ops.length; i++) {
124
- const ops = delta2.ops[i];
125
- if (ops.insert && ops.insert.image) {
126
- const dataurl = ops.insert.image;
127
- if (!dataurl.startsWith("data:image")) {
128
- return;
129
- }
130
- const file = dataURLtoFile(dataurl, "image.png");
131
- await uploadImage(file).then((res) => {
132
- if (!quill) {
133
- return;
134
- }
135
- const images = quill.root.getElementsByTagName("img");
136
- if (images && images.length > 0) {
137
- for (let i2 = 0; i2 < images.length; i2++) {
138
- const img = images[i2];
139
- if (img.src === dataurl) {
140
- img.src = res.url + "&jwt=" + getToken();
141
- }
142
- }
143
- }
144
- }).catch((err) => {
145
- console.error(err, "上传图片失败");
146
- });
42
+ }
43
+ function te(e3) {
44
+ const t2 = new FormData();
45
+ t2.append("file", e3);
46
+ const l2 = S2.pageContext.backendUrl, n2 = j(l2, S2.pageContext.isTest);
47
+ return T.post(n2 + "/common/fs-upload/rich-editor-image", t2, { headers: { "Content-Type": "multipart/form-data" } });
48
+ }
49
+ function le(e3, t2) {
50
+ let l2 = e3.split(","), n2 = l2[0].match(/:(.*?);/)[1], i2 = atob(l2[1]), o2 = i2.length, r2 = new Uint8Array(o2);
51
+ for (; o2--; ) r2[o2] = i2.charCodeAt(o2);
52
+ return new File([r2], t2, { type: n2 });
53
+ }
54
+ return n(() => {
55
+ var _a;
56
+ I = new w(z.value, K.value);
57
+ const e3 = I.clipboard.convertHTML(W);
58
+ I.setContents(e3.ops), (_a = z.value) == null ? void 0 : _a.addEventListener("focusout", $), I.on("text-change", async function(e4, t2, l2) {
59
+ if (e4.ops && e4.ops.length > 0) for (let t3 = 0; t3 < e4.ops.length; t3++) {
60
+ const l3 = e4.ops[t3];
61
+ if (l3.insert && l3.insert.image) {
62
+ const e5 = l3.insert.image;
63
+ if (!e5.startsWith("data:image")) return;
64
+ const t4 = le(e5, "image.png");
65
+ await te(t4).then((t5) => {
66
+ if (!I) return;
67
+ const l4 = I.root.getElementsByTagName("img");
68
+ if (l4 && l4.length > 0) for (let n2 = 0; n2 < l4.length; n2++) {
69
+ const i2 = l4[n2];
70
+ i2.src === e5 && (i2.src = t5.url + "&jwt=" + L());
147
71
  }
148
- }
72
+ }).catch((e6) => {
73
+ });
149
74
  }
150
- setVariableValue(entity, dynamicFields, quill.root.innerHTML);
151
- });
152
- editorContainer = quill.container;
153
- editorContainer.addEventListener("click", handleClick);
154
- updateEditorHeight();
155
- nextTick(() => {
156
- const value = getVariableValue(entity, dynamicFields);
157
- handleAfterInitEvent(
158
- value,
159
- props.pageContext,
160
- props.configure,
161
- {
162
- formItemRef: formItemRef.value,
163
- componentRef: componentRef.value,
164
- titleRef: titleRef.value,
165
- value,
166
- entity: props.pageContext.entity.data,
167
- pageData: props.pageContext.entity.page
168
- }
169
- );
170
- });
171
- });
172
- onBeforeUnmount(() => {
173
- if (quillEditorRef.value) {
174
- quillEditorRef.value.removeEventListener("focusout", handleFocusOut);
175
75
  }
176
- if (editorContainer) {
177
- editorContainer.removeEventListener("click", handleClick);
76
+ b(_, B, I.root.innerHTML);
77
+ }), Z = I.container, Z.addEventListener("click", ee), function() {
78
+ if (I && I.container) {
79
+ const e4 = I.container.parentNode.getBoundingClientRect(), t2 = I.container.getBoundingClientRect();
80
+ let l2 = e4.height - (t2.top - e4.top);
81
+ l2 < 100 && (l2 = 100), I.container.style.height = l2 + "px";
178
82
  }
83
+ }(), i(() => {
84
+ const e4 = C(_, B);
85
+ k(e4, S2.pageContext, S2.configure, { formItemRef: V.value, componentRef: X.value, titleRef: Y.value, value: e4, entity: S2.pageContext.entity.data, pageData: S2.pageContext.entity.page });
179
86
  });
180
- function handleFocusOut(event) {
181
- var _a;
182
- if (event.relatedTarget === null || !((_a = quillEditorRef.value) == null ? void 0 : _a.contains(event.relatedTarget))) {
183
- handleFormEvent(quill.root.innerHTML, props.pageContext, props.configure, "change", {
184
- entity
185
- });
186
- }
187
- }
188
- function handleClick(event) {
189
- if (event.target.localName === "img") {
190
- previewList.value = [];
191
- let imgSrc = event.target.src;
192
- previewList.value.push(imgSrc);
193
- showViewer.value = true;
194
- }
195
- }
196
- function uploadImage(blob) {
197
- const params = new FormData();
198
- params.append("file", blob);
199
- const config = {
200
- headers: {
201
- "Content-Type": "multipart/form-data"
202
- }
203
- };
204
- const backendUrl = props.pageContext.backendUrl;
205
- const baseUrl = getBaseUrl(backendUrl, props.pageContext.isTest);
206
- return http.post(baseUrl + "/common/fs-upload/rich-editor-image", params, config);
207
- }
208
- function dataURLtoFile(dataurl, filename) {
209
- let arr = dataurl.split(",");
210
- let mime = arr[0].match(/:(.*?);/)[1];
211
- let bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
212
- while (n--) {
213
- u8arr[n] = bstr.charCodeAt(n);
214
- }
215
- return new File([u8arr], filename, { type: mime });
216
- }
217
- return (_ctx, _cache) => {
218
- const _component_el_form_item = resolveComponent("el-form-item");
219
- const _component_el_image_viewer = resolveComponent("el-image-viewer");
220
- return openBlock(), createElementBlock(Fragment, null, [
221
- designProperty.value.tittleShow ? (openBlock(), createBlock(_component_el_form_item, {
222
- key: 0,
223
- required: designProperty.value.required,
224
- class: normalizeClass(unref(runtimeClass)),
225
- "label-width": designProperty.value.labelWidth,
226
- style: normalizeStyle(unref(runtimeStyle))
227
- }, {
228
- label: withCtx(() => [
229
- designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
230
- key: 0,
231
- style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
232
- }, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
233
- ]),
234
- default: withCtx(() => [
235
- createElementVNode("div", _hoisted_1, [
236
- createElementVNode("div", {
237
- ref_key: "quillEditorRef",
238
- ref: quillEditorRef,
239
- style: { "width": "100%" }
240
- }, null, 512)
241
- ])
242
- ]),
243
- _: 1
244
- }, 8, ["required", "class", "label-width", "style"])) : createCommentVNode("", true),
245
- showViewer.value ? (openBlock(), createBlock(_component_el_image_viewer, {
246
- key: 1,
247
- "hide-on-click-modal": "",
248
- onClose: _cache[0] || (_cache[0] = () => {
249
- showViewer.value = false;
250
- }),
251
- "url-list": previewList.value
252
- }, null, 8, ["url-list"])) : createCommentVNode("", true)
253
- ], 64);
254
- };
255
- }
256
- });
87
+ }), o(() => {
88
+ z.value && z.value.removeEventListener("focusout", $), Z && Z.removeEventListener("click", ee);
89
+ }), (e3, t2) => {
90
+ const l2 = r("el-form-item"), n2 = r("el-image-viewer");
91
+ return u(), a(s, null, [F.value.tittleShow ? (u(), c(l2, { key: 0, required: F.value.required, class: g(m(N)), "label-width": F.value.labelWidth, style: d(m(M)) }, { label: f(() => [F.value.tittleShow ? (u(), a("div", { key: 0, style: d({ ...m(A), ...m(D) }) }, h(m(E)(F.value.title)), 5)) : p("", true)]), default: f(() => [v("div", R, [v("div", { ref_key: "quillEditorRef", ref: z, style: { width: "100%" } }, null, 512)])]), _: 1 }, 8, ["required", "class", "label-width", "style"])) : p("", true), Q.value ? (u(), c(n2, { key: 1, "hide-on-click-modal": "", onClose: t2[0] || (t2[0] = () => {
92
+ Q.value = false;
93
+ }), "url-list": P.value }, null, 8, ["url-list"])) : p("", true)], 64);
94
+ };
95
+ } });
257
96
  export {
258
- _sfc_main as default
97
+ S as default
259
98
  };
@@ -1,4 +1,4 @@
1
- import _sfc_main from "./select-runtime.vue2.js";
1
+ import e from "./select-runtime.vue2.js";
2
2
  export {
3
- _sfc_main as default
3
+ e as default
4
4
  };