super-page-runtime 2.2.29-tmp1 → 2.2.29-tmp2

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 (165) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +7 -5
  2. package/dist/es/assets/chart-themes/theme1.js +6 -2
  3. package/dist/es/assets/chart-themes/theme2.js +6 -2
  4. package/dist/es/assets/chart-themes/theme3.js +6 -2
  5. package/dist/es/components/runtime/utils/api/api-util.js +7 -4
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
  7. package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
  8. package/dist/es/components/runtime/utils/barcode-util.js +33 -9
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -69
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -38
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +522 -226
  15. package/dist/es/components/runtime/utils/common-util.js +156 -76
  16. package/dist/es/components/runtime/utils/eventBus.js +8 -3
  17. package/dist/es/components/runtime/utils/events/event-util.js +775 -362
  18. package/dist/es/components/runtime/utils/events/print-label.js +140 -73
  19. package/dist/es/components/runtime/utils/events/standard-event.js +2320 -820
  20. package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
  22. package/dist/es/components/runtime/utils/form/scan-util.js +162 -62
  23. package/dist/es/components/runtime/utils/global-refs.js +84 -53
  24. package/dist/es/components/runtime/utils/i18n-util.js +20 -11
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
  26. package/dist/es/components/runtime/utils/page-helper-util.js +660 -280
  27. package/dist/es/components/runtime/utils/page-init-util.js +405 -144
  28. package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
  29. package/dist/es/components/runtime/utils/page-store.js +68 -23
  30. package/dist/es/components/runtime/utils/store-util.js +13 -9
  31. package/dist/es/components/runtime/utils/store.js +2 -2
  32. package/dist/es/components/runtime/utils/table-utils.js +81 -40
  33. package/dist/es/components/runtime/utils/tree-utils.js +37 -17
  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 +83 -21
  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 +46 -14
  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 +132 -36
  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 +18 -4
  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 +107 -17
  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 +198 -54
  46. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
  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 +60 -11
  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 +203 -54
  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/common/common-homepage-search.vue.js +4 -4
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
  54. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -33
  56. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -44
  58. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -33
  60. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -33
  62. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +599 -253
  63. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
  64. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
  68. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
  70. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -213
  73. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -33
  74. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  75. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
  76. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
  78. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  80. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
  81. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
  83. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
  85. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
  87. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
  89. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
  91. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
  93. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
  95. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -63
  97. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -305
  98. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  99. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -265
  100. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
  103. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
  105. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
  106. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  107. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  108. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -43
  109. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
  110. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
  113. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -70
  115. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
  117. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
  119. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
  121. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
  123. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +246 -59
  125. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -34
  127. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -29
  129. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  130. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
  131. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  132. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -65
  133. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -89
  135. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
  137. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
  139. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
  141. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
  143. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  144. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
  145. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
  146. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
  151. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
  153. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
  157. package/dist/es/components/runtime/views/home-chart.vue.js +160 -41
  158. package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
  159. package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -21
  160. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  161. package/dist/es/components/runtime/views/super-page.vue.js +756 -230
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +55 -2
  164. package/dist/es/i18n/langs/en.js +55 -2
  165. package/package.json +2 -2
@@ -1,99 +1,259 @@
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";
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";
5
5
  import "quill/dist/quill.snow.css";
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);
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";
28
49
  }
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;
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
+ }
41
108
  }
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());
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
+ });
71
147
  }
72
- }).catch((e6) => {
73
- console.error(e6, "上传图片失败");
74
- });
148
+ }
75
149
  }
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);
76
175
  }
77
- b(_, B, I.root.innerHTML);
78
- }), Z = I.container, Z.addEventListener("click", ee), function() {
79
- if (I && I.container) {
80
- const e4 = I.container.parentNode.getBoundingClientRect(), t2 = I.container.getBoundingClientRect();
81
- let l2 = e4.height - (t2.top - e4.top);
82
- l2 < 100 && (l2 = 100), I.container.style.height = l2 + "px";
176
+ if (editorContainer) {
177
+ editorContainer.removeEventListener("click", handleClick);
83
178
  }
84
- }(), i(() => {
85
- const e4 = C(_, B);
86
- 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 });
87
179
  });
88
- }), o(() => {
89
- z.value && z.value.removeEventListener("focusout", $), Z && Z.removeEventListener("click", ee);
90
- }), (e3, t2) => {
91
- const l2 = r("el-form-item"), n2 = r("el-image-viewer");
92
- 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] = () => {
93
- Q.value = false;
94
- }), "url-list": P.value }, null, 8, ["url-list"])) : p("", true)], 64);
95
- };
96
- } });
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
+ });
97
257
  export {
98
- S as default
258
+ _sfc_main as default
99
259
  };
@@ -1,4 +1,4 @@
1
- import e from "./select-runtime.vue2.js";
1
+ import _sfc_main from "./select-runtime.vue2.js";
2
2
  export {
3
- e as default
3
+ _sfc_main as default
4
4
  };