super-page-runtime 2.1.93 → 2.1.95

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