epic-designer-gold 0.0.38 → 0.0.40

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 (43) hide show
  1. package/dist/{attributeView-CWoguTGM.cjs → attributeView-BjvAO4_R.cjs} +1 -1
  2. package/dist/{attributeView-CGtxobMF.js → attributeView-PbDEjn8T.js} +1 -1
  3. package/dist/form-2lbtG-zj.js +74 -0
  4. package/dist/form-BM53wx9g.cjs +1 -0
  5. package/dist/{index-DBRz4gi5.js → index-5datIIzJ.js} +1 -1
  6. package/dist/{index-DCoUYKRW.cjs → index-BUBtVoa0.cjs} +1 -1
  7. package/dist/{index-Bj6zKw82.js → index-BZQLip5V.js} +443 -440
  8. package/dist/{index-B7Uy532l.cjs → index-C2ioP4Qy.cjs} +1 -1
  9. package/dist/{index-BBNxCX9U.cjs → index-C3hWImRT.cjs} +1 -1
  10. package/dist/{index-DFP-9KaA.js → index-C95DVYrN.js} +1 -1
  11. package/dist/{index-wxDrmXkw.js → index-CE7JKdc3.js} +1 -1
  12. package/dist/index-Cpm-oLdy.js +4 -0
  13. package/dist/{index-F-tQsU_8.cjs → index-CzOycR7-.cjs} +1 -1
  14. package/dist/index-D3RJLUGU.cjs +10 -0
  15. package/dist/{index-Dan8DnTn.cjs → index-DHHX2mwy.cjs} +1 -1
  16. package/dist/{index-ChGNJr_v.cjs → index-DQjDcBV5.cjs} +1 -1
  17. package/dist/{index-DU0OYNvy.cjs → index-Da3mrdHZ.cjs} +1 -1
  18. package/dist/{index-CDzXkVHK.js → index-Da8OPaOM.js} +2 -2
  19. package/dist/{index-C7VY8nRX.js → index-DxkPriDk.js} +1 -1
  20. package/dist/{index-DWKirflC.js → index-l1DO3QH_.js} +1 -1
  21. package/dist/{index-9xlsE_Mf.cjs → index-l4brKgI9.cjs} +1 -1
  22. package/dist/{index-BALf0q8e.js → index-laQFS5Nd.js} +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/sign-BS8owiJT.cjs +1 -0
  26. package/dist/sign-DZvUIxel.js +155 -0
  27. package/dist/style.css +1 -1
  28. package/dist/{styleView-BHaWjsLQ.js → styleView-LX_E7EFf.js} +1 -1
  29. package/dist/{styleView-BgoSZRkZ.cjs → styleView-oaDQbGne.cjs} +1 -1
  30. package/dist/ui/antd/index.cjs +2 -2
  31. package/dist/ui/antd/index.js +2 -2
  32. package/dist/ui/elementPlus/index.cjs +1 -1
  33. package/dist/ui/elementPlus/index.js +14 -14
  34. package/dist/ui/naiveUi/index.cjs +1 -1
  35. package/dist/ui/naiveUi/index.js +13 -13
  36. package/dist/{uploadImage-CYV7X1sG.js → uploadImage-tLXX1j6A.js} +12 -12
  37. package/package.json +1 -1
  38. package/dist/form-6cUK-Ari.js +0 -72
  39. package/dist/form-CthzLIgs.cjs +0 -1
  40. package/dist/index-9eiypGfJ.cjs +0 -10
  41. package/dist/index-By5d6rRB.js +0 -4
  42. package/dist/sign-BCmA2v-3.cjs +0 -1
  43. package/dist/sign-CSv8hClp.js +0 -149
@@ -0,0 +1,155 @@
1
+ import { inject as A, watch as O, nextTick as U, ref as a, onMounted as H, onUnmounted as I, openBlock as N, createElementBlock as E, normalizeStyle as F, createElementVNode as r, createVNode as P, unref as v, withCtx as x, createTextVNode as w } from "vue";
2
+ import { p as q, a as L } from "./axios-ITY6Uw7A.js";
3
+ import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const J = { class: "btn" }, K = { class: "btns" }, Q = {
5
+ __name: "sign",
6
+ props: {
7
+ componentSchema: {
8
+ type: Object,
9
+ require: !0,
10
+ default: () => ({})
11
+ },
12
+ modelValue: {
13
+ type: String,
14
+ default: ""
15
+ }
16
+ },
17
+ emits: ["update:modelValue"],
18
+ setup(k, { expose: _, emit: T }) {
19
+ const g = q.getComponent("button"), C = T, o = k, u = A("disabled", { value: !1 });
20
+ O(
21
+ () => o.componentSchema,
22
+ () => {
23
+ U(() => {
24
+ console.log("%c [ ]-23", "font-size:13px; background:pink; color:#bf2c9f;", o.componentSchema), f();
25
+ });
26
+ },
27
+ { deep: !0, immediate: !0 }
28
+ );
29
+ const D = new ResizeObserver((t) => {
30
+ for (const e of t)
31
+ e.target && e.target.clientWidth && e.target.clientHeight && f();
32
+ }), l = a(null), s = a(null), n = a(), V = a("");
33
+ function f() {
34
+ var t, e;
35
+ if (s.value && ((t = s.value) != null && t.clientHeight) && ((e = s.value) != null && e.clientWidth)) {
36
+ if (l.value.height = s.value.clientHeight, l.value.width = s.value.clientWidth, n.value = l.value.getContext("2d"), o.modelValue) {
37
+ let c = new Image();
38
+ c.src = o.modelValue, c.setAttribute("crossOrigin", "anonymous"), c.onload = () => {
39
+ n.value.fillStyle = n.value.createPattern(c, "repeat"), n.value.fillRect(0, 0, 1e3, 550);
40
+ };
41
+ }
42
+ n.value.lineWidth = o.componentSchema.componentProps.lineWidth || 4, o.componentSchema && o.componentSchema.componentProps && o.componentSchema.componentProps.style && o.componentSchema.componentProps.style.color && (n.value.strokeStyle = o.componentSchema.componentProps.style.color), V.value = l.value.getBoundingClientRect();
43
+ }
44
+ }
45
+ const p = a(""), m = a(""), W = a(""), z = a(""), i = a([]), h = a(!1);
46
+ function B(t) {
47
+ if (u.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled)
48
+ return;
49
+ t = t || event, t.preventDefault();
50
+ let e = {
51
+ x: t.offsetX,
52
+ y: t.offsetY
53
+ };
54
+ p.value = e.x, m.value = e.y, n.value.beginPath(), n.value.moveTo(e.x, e.y), n.value.lineTo(e.x, e.y), n.value.stroke(), n.value.closePath(), i.value.push(e), h.value = !0;
55
+ }
56
+ function M(t) {
57
+ if (!(u.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled) && (t = t || event, t.preventDefault(), h.value)) {
58
+ let e = {
59
+ x: t.offsetX,
60
+ y: t.offsetY
61
+ };
62
+ W.value = e.x, z.value = e.y, n.value.beginPath(), n.value.moveTo(p.value, m.value), n.value.lineTo(e.x, e.y), n.value.stroke(), n.value.closePath(), p.value = e.x, m.value = e.y, i.value.push(e);
63
+ }
64
+ }
65
+ function j(t) {
66
+ if (u.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled)
67
+ return;
68
+ t = t || event, t.preventDefault();
69
+ let e = {
70
+ x: t.offsetX,
71
+ y: t.offsetY
72
+ };
73
+ n.value.beginPath(), n.value.moveTo(p.value, m.value), n.value.lineTo(e.x, e.y), n.value.stroke(), n.value.closePath(), i.value.push(e), i.value.push({ x: -1, y: -1 }), h.value = !1;
74
+ }
75
+ function b() {
76
+ n.value.clearRect(0, 0, l.value.width, l.value.height), i.value = [];
77
+ }
78
+ async function y() {
79
+ let t = await R(l.value.toDataURL("image/png"));
80
+ C("update:modelValue", t);
81
+ }
82
+ async function R(t) {
83
+ let e = atob(t.split(",")[1]), c = new ArrayBuffer(e.length), X = new Uint8Array(c);
84
+ for (let d = 0; d < e.length; d++)
85
+ X[d] = e.charCodeAt(d);
86
+ let Y = new Blob([c], { type: "image/png" }), S = new FormData();
87
+ return S.append("file", Y, Date.now() + "png"), (await L({
88
+ method: "post",
89
+ url: "https://ess-ds.com/prod-api/center-file/file/upload",
90
+ data: S,
91
+ headers: {
92
+ "Content-Type": "multipart/form-data"
93
+ }
94
+ })).data.data.url;
95
+ }
96
+ return H(() => {
97
+ f(), D.observe(s.value);
98
+ }), I(() => {
99
+ }), _({
100
+ surewrite: y
101
+ }), (t, e) => (N(), E("div", {
102
+ class: "sign",
103
+ style: F({
104
+ height: o.componentSchema.componentProps.style.height,
105
+ width: o.componentSchema.componentProps.style.width || "100%"
106
+ })
107
+ }, [
108
+ r("div", {
109
+ class: "canvas",
110
+ ref_key: "canvasWrap",
111
+ ref: s
112
+ }, [
113
+ r("canvas", {
114
+ ref_key: "canvas",
115
+ ref: l,
116
+ onMousedown: B,
117
+ onMousemove: M,
118
+ onMouseup: j
119
+ }, null, 544)
120
+ ], 512),
121
+ r("div", J, [
122
+ e[2] || (e[2] = r("div", { class: "remark" }, null, -1)),
123
+ r("div", K, [
124
+ P(v(g), {
125
+ disabled: v(u) || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled,
126
+ type: "info",
127
+ size: "mini",
128
+ onClick: b,
129
+ onTouch: b
130
+ }, {
131
+ default: x(() => e[0] || (e[0] = [
132
+ w("重写")
133
+ ])),
134
+ _: 1
135
+ }, 8, ["disabled"]),
136
+ P(v(g), {
137
+ disabled: v(u) || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled,
138
+ type: "primary",
139
+ size: "mini",
140
+ onClick: y,
141
+ onTouch: y
142
+ }, {
143
+ default: x(() => e[1] || (e[1] = [
144
+ w("确定")
145
+ ])),
146
+ _: 1
147
+ }, 8, ["disabled"])
148
+ ])
149
+ ])
150
+ ], 4));
151
+ }
152
+ }, oe = /* @__PURE__ */ G(Q, [["__scopeId", "data-v-932b902a"]]);
153
+ export {
154
+ oe as default
155
+ };