epic-designer-gold 0.0.47 → 0.0.49

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 (34) hide show
  1. package/dist/{attributeView-CA-6yB0k.cjs → attributeView-CMbZBZIS.cjs} +1 -1
  2. package/dist/{attributeView-C75ra3CN.js → attributeView-DvYRuXDB.js} +1 -1
  3. package/dist/{index-9VqDmCT_.cjs → index-2_PG24En.cjs} +1 -1
  4. package/dist/{index-Bdnc9TGH.cjs → index-3oFTJubt.cjs} +1 -1
  5. package/dist/{index-B-Uox2mn.cjs → index-BIfS14i1.cjs} +1 -1
  6. package/dist/{index-M3HldxkA.js → index-BizWKLWZ.js} +1 -1
  7. package/dist/{index-DwDY6KkH.js → index-Bjj1uygU.js} +1 -1
  8. package/dist/{index-BGT2-jZP.cjs → index-BsyFZeFI.cjs} +1 -1
  9. package/dist/{index-0RqJEjlH.cjs → index-C8eSqkwT.cjs} +1 -1
  10. package/dist/index-CqirvAEP.js +4 -0
  11. package/dist/index-CtK_8YxJ.cjs +10 -0
  12. package/dist/{index-CML-aVic.js → index-D0xByXxW.js} +1 -1
  13. package/dist/{index-CvIjQtJw.js → index-DiYy4kUz.js} +1 -1
  14. package/dist/{index-Bgvfahgd.js → index-Dy65ngnp.js} +223 -223
  15. package/dist/{index-baUE53XK.cjs → index-FUj4O0Wm.cjs} +1 -1
  16. package/dist/{index-C32P7cCc.js → index-SmoMBzHL.js} +1 -1
  17. package/dist/{index-BgTlZ9gW.js → index-WBW2xl-M.js} +1 -1
  18. package/dist/{index-BbCEtCJA.cjs → index-YV7i1gyI.cjs} +1 -1
  19. package/dist/{index-BHWJ1KwT.js → index-ijn3b5rF.js} +1 -1
  20. package/dist/{index-Bmo9n7ut.cjs → index-zyeRTxj7.cjs} +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/sign-BJBURbHk.js +218 -0
  24. package/dist/sign-Cn6LXVcp.cjs +1 -0
  25. package/dist/style.css +1 -1
  26. package/dist/{styleView-cuoX6XX4.js → styleView-BbQxI-Nr.js} +1 -1
  27. package/dist/{styleView-CXdgqy6O.cjs → styleView-CF34Ddn9.cjs} +1 -1
  28. package/dist/ui/elementPlus/index.cjs +1 -1
  29. package/dist/ui/elementPlus/index.js +42 -44
  30. package/package.json +1 -1
  31. package/dist/index-BRZDZuxE.js +0 -4
  32. package/dist/index-ETJEJKM_.cjs +0 -10
  33. package/dist/sign-BRchUdJt.js +0 -156
  34. package/dist/sign-CnQtsTLr.cjs +0 -1
@@ -1,156 +0,0 @@
1
- import { inject as Y, 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 S, unref as v, withCtx as x, createTextVNode as w } from "vue";
2
- import { p as q, a as L, b as G } from "./js.cookie-oHpRFPCO.js";
3
- import { _ as J } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const K = { class: "btn" }, Q = { class: "btns" }, Z = {
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, n = k, i = Y("disabled", { value: !1 });
20
- O(
21
- () => n.componentSchema,
22
- () => {
23
- U(() => {
24
- 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), o = 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, o.value = l.value.getContext("2d"), n.modelValue) {
37
- let c = new Image();
38
- c.src = n.modelValue, c.setAttribute("crossOrigin", "anonymous"), c.onload = () => {
39
- o.value.fillStyle = o.value.createPattern(c, "repeat"), o.value.fillRect(0, 0, 1e3, 550);
40
- };
41
- }
42
- o.value.lineWidth = n.componentSchema.componentProps.lineWidth || 4, n.componentSchema && n.componentSchema.componentProps && n.componentSchema.componentProps.style && n.componentSchema.componentProps.style.color && (o.value.strokeStyle = n.componentSchema.componentProps.style.color), V.value = l.value.getBoundingClientRect();
43
- }
44
- }
45
- const p = a(""), m = a(""), B = a(""), W = a(""), u = a([]), h = a(!1);
46
- function z(t) {
47
- if (i.value || n.componentSchema.componentProps.readonly || n.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, o.value.beginPath(), o.value.moveTo(e.x, e.y), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), h.value = !0;
55
- }
56
- function A(t) {
57
- if (!(i.value || n.componentSchema.componentProps.readonly || n.componentSchema.componentProps.disabled) && (t = t || event, t.preventDefault(), h.value)) {
58
- let e = {
59
- x: t.offsetX,
60
- y: t.offsetY
61
- };
62
- B.value = e.x, W.value = e.y, o.value.beginPath(), o.value.moveTo(p.value, m.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), p.value = e.x, m.value = e.y, u.value.push(e);
63
- }
64
- }
65
- function M(t) {
66
- if (i.value || n.componentSchema.componentProps.readonly || n.componentSchema.componentProps.disabled)
67
- return;
68
- t = t || event, t.preventDefault();
69
- let e = {
70
- x: t.offsetX,
71
- y: t.offsetY
72
- };
73
- o.value.beginPath(), o.value.moveTo(p.value, m.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), u.value.push({ x: -1, y: -1 }), h.value = !1;
74
- }
75
- function b() {
76
- o.value.clearRect(0, 0, l.value.width, l.value.height), u.value = [];
77
- }
78
- async function y() {
79
- let t = await j(l.value.toDataURL("image/png"));
80
- C("update:modelValue", t);
81
- }
82
- async function j(t) {
83
- let e = atob(t.split(",")[1]), c = new ArrayBuffer(e.length), R = new Uint8Array(c);
84
- for (let d = 0; d < e.length; d++)
85
- R[d] = e.charCodeAt(d);
86
- let X = new Blob([c], { type: "image/png" }), P = new FormData();
87
- return P.append("file", X, Date.now() + "png"), (await L({
88
- method: "post",
89
- url: "https://ess-ds.com/prod-api/center-file/file/upload",
90
- data: P,
91
- headers: {
92
- "Content-Type": "multipart/form-data",
93
- Authorization: "Bearer " + G.get("Admin-Token")
94
- }
95
- })).data.data.url;
96
- }
97
- return H(() => {
98
- f(), D.observe(s.value);
99
- }), I(() => {
100
- }), _({
101
- surewrite: y
102
- }), (t, e) => (N(), E("div", {
103
- class: "sign",
104
- style: F({
105
- height: n.componentSchema.componentProps.style.height,
106
- width: n.componentSchema.componentProps.style.width || "100%"
107
- })
108
- }, [
109
- r("div", {
110
- class: "canvas",
111
- ref_key: "canvasWrap",
112
- ref: s
113
- }, [
114
- r("canvas", {
115
- ref_key: "canvas",
116
- ref: l,
117
- onMousedown: z,
118
- onMousemove: A,
119
- onMouseup: M
120
- }, null, 544)
121
- ], 512),
122
- r("div", K, [
123
- e[2] || (e[2] = r("div", { class: "remark" }, null, -1)),
124
- r("div", Q, [
125
- S(v(g), {
126
- disabled: v(i) || n.componentSchema.componentProps.readonly || n.componentSchema.componentProps.disabled,
127
- type: "info",
128
- size: "mini",
129
- onClick: b,
130
- onTouch: b
131
- }, {
132
- default: x(() => e[0] || (e[0] = [
133
- w("重写")
134
- ])),
135
- _: 1
136
- }, 8, ["disabled"]),
137
- S(v(g), {
138
- disabled: v(i) || n.componentSchema.componentProps.readonly || n.componentSchema.componentProps.disabled,
139
- type: "primary",
140
- size: "mini",
141
- onClick: y,
142
- onTouch: y
143
- }, {
144
- default: x(() => e[1] || (e[1] = [
145
- w("确定")
146
- ])),
147
- _: 1
148
- }, 8, ["disabled"])
149
- ])
150
- ])
151
- ], 4));
152
- }
153
- }, ne = /* @__PURE__ */ J(Z, [["__scopeId", "data-v-ee5237db"]]);
154
- export {
155
- ne as default
156
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),h=require("./js.cookie-BH1G_HRi.cjs"),W=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),z={class:"btn"},A={class:"btns"},E={__name:"sign",props:{componentSchema:{type:Object,require:!0,default:()=>({})},modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(S,{expose:P,emit:x}){const y=h.pluginManager.getComponent("button"),w=x,a=S,c=t.inject("disabled",{value:!1});t.watch(()=>a.componentSchema,()=>{t.nextTick(()=>{d()})},{deep:!0,immediate:!0});const V=new ResizeObserver(o=>{for(const e of o)e.target&&e.target.clientWidth&&e.target.clientHeight&&d()}),l=t.ref(null),s=t.ref(null),n=t.ref(),_=t.ref("");function d(){var o,e;if(s.value&&((o=s.value)!=null&&o.clientHeight)&&((e=s.value)!=null&&e.clientWidth)){if(l.value.height=s.value.clientHeight,l.value.width=s.value.clientWidth,n.value=l.value.getContext("2d"),a.modelValue){let r=new Image;r.src=a.modelValue,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{n.value.fillStyle=n.value.createPattern(r,"repeat"),n.value.fillRect(0,0,1e3,550)}}n.value.lineWidth=a.componentSchema.componentProps.lineWidth||4,a.componentSchema&&a.componentSchema.componentProps&&a.componentSchema.componentProps.style&&a.componentSchema.componentProps.style.color&&(n.value.strokeStyle=a.componentSchema.componentProps.style.color),_.value=l.value.getBoundingClientRect()}}const i=t.ref(""),p=t.ref(""),k=t.ref(""),T=t.ref(""),u=t.ref([]),v=t.ref(!1);function C(o){if(c.value||a.componentSchema.componentProps.readonly||a.componentSchema.componentProps.disabled)return;o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};i.value=e.x,p.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(),u.value.push(e),v.value=!0}function N(o){if(!(c.value||a.componentSchema.componentProps.readonly||a.componentSchema.componentProps.disabled)&&(o=o||event,o.preventDefault(),v.value)){let e={x:o.offsetX,y:o.offsetY};k.value=e.x,T.value=e.y,n.value.beginPath(),n.value.moveTo(i.value,p.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),i.value=e.x,p.value=e.y,u.value.push(e)}}function D(o){if(c.value||a.componentSchema.componentProps.readonly||a.componentSchema.componentProps.disabled)return;o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};n.value.beginPath(),n.value.moveTo(i.value,p.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),u.value.push(e),u.value.push({x:-1,y:-1}),v.value=!1}function g(){n.value.clearRect(0,0,l.value.width,l.value.height),u.value=[]}async function f(){let o=await j(l.value.toDataURL("image/png"));w("update:modelValue",o)}async function j(o){let e=atob(o.split(",")[1]),r=new ArrayBuffer(e.length),B=new Uint8Array(r);for(let m=0;m<e.length;m++)B[m]=e.charCodeAt(m);let M=new Blob([r],{type:"image/png"}),b=new FormData;return b.append("file",M,Date.now()+"png"),(await h.axios({method:"post",url:"https://ess-ds.com/prod-api/center-file/file/upload",data:b,headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+h.api.get("Admin-Token")}})).data.data.url}return t.onMounted(()=>{d(),V.observe(s.value)}),t.onUnmounted(()=>{}),P({surewrite:f}),(o,e)=>(t.openBlock(),t.createElementBlock("div",{class:"sign",style:t.normalizeStyle({height:a.componentSchema.componentProps.style.height,width:a.componentSchema.componentProps.style.width||"100%"})},[t.createElementVNode("div",{class:"canvas",ref_key:"canvasWrap",ref:s},[t.createElementVNode("canvas",{ref_key:"canvas",ref:l,onMousedown:C,onMousemove:N,onMouseup:D},null,544)],512),t.createElementVNode("div",z,[e[2]||(e[2]=t.createElementVNode("div",{class:"remark"},null,-1)),t.createElementVNode("div",A,[t.createVNode(t.unref(y),{disabled:t.unref(c)||a.componentSchema.componentProps.readonly||a.componentSchema.componentProps.disabled,type:"info",size:"mini",onClick:g,onTouch:g},{default:t.withCtx(()=>e[0]||(e[0]=[t.createTextVNode("重写")])),_:1},8,["disabled"]),t.createVNode(t.unref(y),{disabled:t.unref(c)||a.componentSchema.componentProps.readonly||a.componentSchema.componentProps.disabled,type:"primary",size:"mini",onClick:f,onTouch:f},{default:t.withCtx(()=>e[1]||(e[1]=[t.createTextVNode("确定")])),_:1},8,["disabled"])])])],4))}},O=W._export_sfc(E,[["__scopeId","data-v-ee5237db"]]);exports.default=O;