epic-designer-gold 1.0.5 → 1.0.6
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.
- package/dist/{attributeView-B2dWB_U2.cjs → attributeView-CEFjPemt.cjs} +1 -1
- package/dist/{attributeView-Cu_tjo9A.js → attributeView-C_rnFDGo.js} +3 -3
- package/dist/{axios-B8aFvCWj.cjs → axios-B5oA4AjJ.cjs} +1 -1
- package/dist/{axios-Bb3STC1u.js → axios-awtfJhsA.js} +1 -1
- package/dist/index-AH-Lj15r.js +107 -0
- package/dist/{index-VblxMq6V.js → index-B0rUZfG_.js} +2 -2
- package/dist/{index-CMbBKMQU.js → index-BEMPXyNN.js} +2 -2
- package/dist/{index-BhcwWM1G.cjs → index-BOUKAGKU.cjs} +1 -1
- package/dist/index-B_BKVTct.cjs +1 -0
- package/dist/{index-Bn8pwpgq.cjs → index-Ba8KVYrQ.cjs} +1 -1
- package/dist/{index-D0kQz_zt.js → index-BfdYrl-Q.js} +1 -1
- package/dist/{index-21c4Pe3i.cjs → index-BnLI5N3M.cjs} +1 -1
- package/dist/index-BpROfyMH.cjs +1 -0
- package/dist/index-BxCrqMkz.cjs +1 -0
- package/dist/{index-DeZ09CHf.cjs → index-CBBK4Aze.cjs} +1 -1
- package/dist/index-CDTcUcwY.cjs +1 -0
- package/dist/{index-CgwN4ucQ.js → index-CFZioB1O.js} +2 -2
- package/dist/{index-BLJT8e0Q.js → index-Ce470l1n.js} +4 -4
- package/dist/{index-CHCOxt3B.js → index-CeVV_SOj.js} +3 -3
- package/dist/{index-DxNdcsD-.js → index-CoCyrWM2.js} +124 -120
- package/dist/{index-CYAKMqdR.cjs → index-Cq5wbnmA.cjs} +1 -1
- package/dist/index-D8olMR4m.cjs +10 -0
- package/dist/index-DENcRmIy.js +47 -0
- package/dist/{index-CqeRfqUw.cjs → index-DK4PrvRF.cjs} +1 -1
- package/dist/{index-Dg7MK40D.js → index-DWxy0GSJ.js} +6 -2
- package/dist/{index-DeFAvWuV.cjs → index-DaJuXp0q.cjs} +1 -1
- package/dist/index-DfRZtELz.js +4 -0
- package/dist/{index-Bybwt7-u.js → index-DpF9E6J8.js} +1 -1
- package/dist/{index-DUMEtCCN.cjs → index-J9twEwWw.cjs} +1 -1
- package/dist/{index-CjIIhZdV.js → index-P13z5c0g.js} +3 -3
- package/dist/{index-CEDIwmNK.js → index-cElDeAm2.js} +2 -2
- package/dist/{index-BULuVnVl.js → index-oMkqg9Zb.js} +194 -186
- package/dist/{index-BV9SE7wG.cjs → index-tR-Y01R8.cjs} +1 -1
- package/dist/{index-Bxi3JLms.cjs → index-vzxiD3pz.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/locale/lang/en-US.d.ts +2 -0
- package/dist/locale/lang/zh-cn.d.ts +2 -0
- package/dist/{outline-DxCKINRN.js → outline-DQ8wgGyH.js} +2 -2
- package/dist/{outline-CK-jNomF.cjs → outline-JJ0IbSzs.cjs} +1 -1
- package/dist/sign-BBoshwS_.cjs +1 -0
- package/dist/{sign-B-FCN_7O.js → sign-Dfqcv4Fg.js} +52 -48
- package/dist/style.css +1 -1
- package/dist/{styleView-CRUqDcCl.cjs → styleView-CZEOSq2l.cjs} +1 -1
- package/dist/{styleView-ClMjCfMk.js → styleView-CajgzMOm.js} +3 -3
- package/dist/tree.vue_vue_type_script_setup_true_lang-B-8wkdQS.js +243 -0
- package/dist/tree.vue_vue_type_script_setup_true_lang-BS6Anq-8.cjs +1 -0
- package/dist/ui/elementPlus/index.cjs +1 -1
- package/dist/ui/elementPlus/index.js +4 -4
- package/dist/ui/naiveUi/index.cjs +1 -1
- package/dist/ui/naiveUi/index.js +1 -1
- package/dist/{uploadFile-oB2-NP-v.cjs → uploadFile-BHn9oVA8.cjs} +1 -1
- package/dist/{uploadFile-Bc5Rxk0b.js → uploadFile-D_0_6ghp.js} +1 -1
- package/dist/{uploadImage-CGXm3zNQ.js → uploadImage-4U4YGGfK.js} +1 -1
- package/dist/{uploadImage-CF7fobUP.cjs → uploadImage-B3tV49Mm.cjs} +1 -1
- package/dist/{uploadImage-4tgp3t7X.cjs → uploadImage-C-OyUMFn.cjs} +1 -1
- package/dist/{uploadImage-COCC3pxH.js → uploadImage-Z6Y6KN1R.js} +1 -1
- package/package.json +1 -1
- package/dist/index-B553TaXm.js +0 -44
- package/dist/index-CEvDmc0a.js +0 -104
- package/dist/index-CI3dhGXT.cjs +0 -1
- package/dist/index-Cq6eLpKZ.cjs +0 -1
- package/dist/index-CrV5FaWU.cjs +0 -10
- package/dist/index-DR80h8IU.js +0 -4
- package/dist/index-DddTXMY9.cjs +0 -1
- package/dist/index-DzxQG0o7.cjs +0 -1
- package/dist/sign-Dho4kHTC.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-B9rWLveX.js +0 -242
- package/dist/tree.vue_vue_type_script_setup_true_lang-DDDqMedP.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./axios-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./axios-B5oA4AjJ.cjs"),b=require("./index-BpROfyMH.cjs"),V=e.defineComponent({__name:"index",props:{modelValue:{}},emits:["update:modelValue"],setup(v,{emit:i}){const{t:p}=b.useLocale(),s=r.pluginManager.getComponent("input"),d=r.pluginManager.getComponent("select"),m=v,c=i,l=e.ref(null),t=e.ref("px"),f=[{label:"px",value:"px"},{label:"%",value:"%"},{label:"vw",value:"vw"},{label:"vh",value:"vh"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"pt",value:"pt"}];e.watch(()=>m.modelValue,n=>{if(!n)return;if(typeof n=="number"){l.value=String(n),t.value="px";return}const u=parseFloat(n);if(isNaN(u))return l.value=null,!1;const a=/^(\d+(\.\d+)?)(px|%|vw|vh|rem|em|pt){1}$/,o=n.trim().match(a);l.value=(o==null?void 0:o[1])??null,t.value=(o==null?void 0:o[3])??""},{immediate:!0}),e.watch(()=>t.value+l.value,()=>{x()});function x(){e.nextTick(()=>c("update:modelValue",l.value?l.value+t.value:void 0))}return(n,u)=>(e.openBlock(),e.createBlock(e.unref(s),{class:"epic-input-size",modelValue:l.value,"onUpdate:modelValue":u[2]||(u[2]=a=>l.value=a),value:l.value,"onUpdate:value":u[3]||(u[3]=a=>l.value=a),type:"number",min:"0",placeholder:e.unref(p)("pleaseEnter")},{suffix:e.withCtx(()=>[e.createVNode(e.unref(d),{value:t.value,"onUpdate:value":u[0]||(u[0]=a=>t.value=a),modelValue:t.value,"onUpdate:modelValue":u[1]||(u[1]=a=>t.value=a),style:{width:"68px"},options:f},null,8,["value","modelValue"])]),_:1},8,["modelValue","value","placeholder"]))}});exports.default=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./axios-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./axios-B5oA4AjJ.cjs"),m=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),f={class:"epic-breadcrumb pl-4 py-2 truncate h-40px flex items-center"},h={key:0,class:"flex items-center"},v={key:0},k=["onClick","onMouseenter"],g=e.defineComponent({__name:"breadcrumb",setup(_){const t=e.inject("designer");function i(r){t.setCheckedNode(r)}return(r,n)=>(e.openBlock(),e.createElementBlock("div",f,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).state.matched,(l,c)=>{var a;return e.openBlock(),e.createElementBlock("span",{key:c},[c>e.unref(t).state.matched.length-4?(e.openBlock(),e.createElementBlock("span",h,[e.unref(t).state.matched.length>3&&c===e.unref(t).state.matched.length-3?(e.openBlock(),e.createElementBlock("span",v,"...")):e.createCommentVNode("",!0),c!==0?(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:1,class:"m-1",name:"icon--epic--arrow-forward-ios-rounded"})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"node-item cursor-pointer",onClick:o=>i(l),onMouseenter:e.withModifiers(o=>e.unref(t).setHoverNode(l),["stop"]),onMouseleave:n[0]||(n[0]=e.withModifiers(o=>e.unref(t).setHoverNode(null),["stop"]))},e.toDisplayString(l.label??((a=e.unref(p.pluginManager).getComponentConfingByType(l.type))==null?void 0:a.defaultSchema.label)),41,k)])):e.createCommentVNode("",!0)])}),128))]))}}),B={key:0,class:"epic-right-sidebar-container relative"},C={class:"w-308px"},b={class:"epic-actions-container"},y=["title","onClick"],N={class:"epic-sidebar-content"},E=e.defineComponent({__name:"index",setup(_){var a;const t=e.ref(!1),i=e.computed(()=>p.pluginManager.viewsContainers.rightSidebars.value.filter(o=>o.visible)),r=e.ref(0),n=e.shallowRef(null);n.value=(a=i.value[0])==null?void 0:a.component;function l(){t.value=!t.value}function c(o,s){if(r.value===s)return!1;n.value=o.component,r.value=s}return(o,s)=>n.value?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",{class:"epic-right-sidebar-hide-btn absolute left--18px top-80px cursor-pointer rounded-full flex justify-center items-center w-28px h-28px z-9",onClick:l},[e.createVNode(e.unref(m._sfc_main),{class:e.normalizeClass(["transition-all",{"rotate-180":t.value}]),name:"icon--epic--arrow-forward-ios-rounded"},null,8,["class"])]),s[0]||(s[0]=e.createElementVNode("div",{class:"w-10px"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["epic-right-sidebar w-308px",{hide:t.value}])},[e.createElementVNode("div",C,[e.createVNode(g),e.createElementVNode("ul",b,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(u,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(["epic-action-item",{checked:r.value===d}]),title:u.title,onClick:V=>c(u,d)},e.toDisplayString(u.title),11,y))),128))]),e.createElementVNode("div",N,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value)))])])],2)])):e.createCommentVNode("",!0)}});exports.default=E;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-D8olMR4m.cjs"),e=require("./axios-B5oA4AjJ.cjs");exports.EBuilder=a._sfc_main$1;exports.EDesigner=a._sfc_main$2;exports.ENode=a._sfc_main;exports.debounce=a.debounce;exports.getDarkState=a.getDarkState;exports.initStore=a.initStore;exports.useDark=a.useDark;exports.useElementDrag=a.useElementDrag;exports.useElementZoom=a.useElementZoom;exports.useKeyPress=a.useKeyPress;exports.usePageManager=a.usePageManager;exports.useRevoke=a.useRevoke;exports.useStore=a.useStore;exports.useTheme=a.useTheme;exports.useTimedQuery=a.useTimedQuery;exports.EventBus=e.EventBus;exports.PluginManager=e.PluginManager;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.convertKFormData=e.convertKFormData;exports.deepClone=e.deepClone;exports.deepCompareAndModify=e.deepCompareAndModify;exports.deepEqual=e.deepEqual;exports.findSchemaById=e.findSchemaById;exports.findSchemaInfoById=e.findSchemaInfoById;exports.findSchemas=e.findSchemas;exports.generateNewSchema=e.generateNewSchema;exports.getFormFields=e.getFormFields;exports.getFormSchemas=e.getFormSchemas;exports.getMatchedById=e.getMatchedById;exports.getUUID=e.getUUID;exports.getValueByPath=e.getValueByPath;exports.loadAsyncComponent=e.loadAsyncComponent;exports.mapSchemas=e.mapSchemas;exports.pluginManager=e.pluginManager;exports.recursionConvertedNode=e.recursionConvertedNode;exports.setValueByPath=e.setValueByPath;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as s, j as t, _ as r, f as o, o as n, p as d, n as m, c as u, e as i, m as g, k as c, l, u as h, h as p, a as f } from "./index-
|
|
2
|
-
import { E as S, P as E, c as B, r as D, a as P, d as k, b as F, o as I, q as M, f as v, i as C, k as N, m as b, h as j, g as q, j as x, l as A, n as K, p as T, t as U, s as V } from "./axios-
|
|
1
|
+
import { i as s, j as t, _ as r, f as o, o as n, p as d, n as m, c as u, e as i, m as g, k as c, l, u as h, h as p, a as f } from "./index-oMkqg9Zb.js";
|
|
2
|
+
import { E as S, P as E, c as B, r as D, a as P, d as k, b as F, o as I, q as M, f as v, i as C, k as N, m as b, h as j, g as q, j as x, l as A, n as K, p as T, t as U, s as V } from "./axios-awtfJhsA.js";
|
|
3
3
|
export {
|
|
4
4
|
s as EBuilder,
|
|
5
5
|
t as EDesigner,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as g, inject as l, computed as k, openBlock as p, createElementBlock as v, createVNode as N, unref as e, withCtx as x, createElementVNode as i, normalizeClass as C, withModifiers as m, createBlock as M, createCommentVNode as S, createTextVNode as b, toDisplayString as u } from "vue";
|
|
2
|
-
import { _ as w } from "./tree.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { p as B } from "./axios-
|
|
2
|
+
import { _ as w } from "./tree.vue_vue_type_script_setup_true_lang-B-8wkdQS.js";
|
|
3
|
+
import { p as B } from "./axios-awtfJhsA.js";
|
|
4
4
|
import { _ as V } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
const $ = { class: "epic-outline" }, E = ["onMouseenter"], H = { class: "max-w-full truncate" }, P = { class: "epic-node-type-text flex-1 w-0 truncate" }, q = /* @__PURE__ */ g({
|
|
6
6
|
__name: "outline",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("./tree.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("./tree.vue_vue_type_script_setup_true_lang-BS6Anq-8.cjs"),f=require("./axios-B5oA4AjJ.cjs"),m=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),v={class:"epic-outline"},y=["onMouseenter"],g={class:"max-w-full truncate"},h={class:"epic-node-type-text flex-1 w-0 truncate"},k=e.defineComponent({__name:"outline",setup(N){const n=e.inject("designer"),a=e.inject("pageSchema"),l=e.computed(()=>{var s;const o=(s=n.state.checkedNode)==null?void 0:s.id;return o?[o]:[]});function u(o){n.setCheckedNode(o.componentSchema)}return(o,s)=>{var i;return e.openBlock(),e.createElementBlock("div",v,[e.createVNode(e.unref(_._sfc_main),{options:e.unref(a).schemas,draggable:"","selected-keys":l.value,"hover-key":(i=e.unref(n).state.hoverNode)==null?void 0:i.id,onNodeClick:u},{"tree-node":e.withCtx(({schema:t})=>{var r,c,d;return[e.createElementVNode("div",{class:e.normalizeClass(["epic-text-padding flex",{hidden:(r=t.componentProps)==null?void 0:r.hidden}]),onMouseenter:e.withModifiers(p=>e.unref(n).setHoverNode(t),["stop"]),onMouseleave:s[0]||(s[0]=e.withModifiers(p=>e.unref(n).setHoverNode(null),["stop"]))},[e.createElementVNode("span",g,[(c=t.componentProps)!=null&&c.hidden?(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,name:"icon--epic--visibility-off-outline-rounded",class:"translate-y-2px"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label??((d=e.unref(f.pluginManager).getComponentConfingByType(t.type))==null?void 0:d.defaultSchema.label)),1)]),e.createElementVNode("span",h,e.toDisplayString(t.id),1)],42,y)]}),_:1},8,["options","selected-keys","hover-key"])])}}});exports.default=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("./axios-B5oA4AjJ.cjs"),p=require("element-plus"),S=require("./index-BpROfyMH.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Y={class:"sign-main"},F=["src"],O={class:"sign",style:{height:"100%",width:"100%"}},H=["id"],L={class:"btn"},$={class:"btns"},Z={__name:"sign",props:{componentSchema:{type:Object,require:!0,default:()=>({})},modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(T,{expose:B,emit:C}){const{t:l}=S.useLocale(),P=w.pluginManager.getComponent("button"),D=w.pluginManager.getComponent("Dialog"),E=C,o=T,d=e.inject("disabled",{value:!1});e.watch(()=>o.componentSchema,()=>{e.nextTick(()=>{h.value=o.modelValue})},{deep:!0,immediate:!0});const s=e.ref(null),i=e.ref(null),a=e.ref(),M=e.ref("");function N(){var n,t,u,g;if(i.value&&((n=i.value)!=null&&n.clientHeight)&&((t=i.value)!=null&&t.clientWidth)){if(s.value=document.getElementById(`canvas${o.componentSchema.field}`),s.value.height=((u=i.value)==null?void 0:u.clientHeight)||600,s.value.width=(g=i.value)==null?void 0:g.clientWidth,a.value=s.value.getContext("2d"),o.modelValue){let m=new Image;m.src=o.modelValue,m.setAttribute("crossOrigin","anonymous"),m.onload=()=>{a.value.fillStyle=a.value.createPattern(m,"repeat"),a.value.fillRect(0,0,1e3,550)}}a.value.lineWidth=o.componentSchema.componentProps.lineWidth||4,o.componentSchema&&o.componentSchema.componentProps&&o.componentSchema.componentProps.style&&o.componentSchema.componentProps.style.color&&(a.value.strokeStyle=o.componentSchema.componentProps.style.color),M.value=s.value.getBoundingClientRect()}}const v=e.ref(""),f=e.ref(""),A=e.ref(""),W=e.ref(""),c=e.ref([]),x=e.ref(!1);function j(n){if(d.value||o.componentSchema.componentProps.readonly||o.componentSchema.componentProps.disabled)return;n=n||event,n.preventDefault();let t={x:n.offsetX,y:n.offsetY};v.value=t.x,f.value=t.y,a.value.beginPath(),a.value.moveTo(t.x,t.y),a.value.lineTo(t.x,t.y),a.value.stroke(),a.value.closePath(),c.value.push(t),x.value=!0}function q(n){if(!(d.value||o.componentSchema.componentProps.readonly||o.componentSchema.componentProps.disabled)&&(n=n||event,n.preventDefault(),x.value)){let t={x:n.offsetX,y:n.offsetY};A.value=t.x,W.value=t.y,a.value.beginPath(),a.value.moveTo(v.value,f.value),a.value.lineTo(t.x,t.y),a.value.stroke(),a.value.closePath(),v.value=t.x,f.value=t.y,c.value.push(t)}}function R(n){if(d.value||o.componentSchema.componentProps.readonly||o.componentSchema.componentProps.disabled)return;n=n||event,n.preventDefault();let t={x:n.offsetX,y:n.offsetY};a.value.beginPath(),a.value.moveTo(v.value,f.value),a.value.lineTo(t.x,t.y),a.value.stroke(),a.value.closePath(),c.value.push(t),c.value.push({x:-1,y:-1}),x.value=!1}function _(){p.ElMessageBox.confirm(l("rewriteWillClearCanvas"),l("warning"),{confirmButtonText:l("confirm"),cancelButtonText:l("cancel"),type:"warning"}).then(()=>{a.value.clearRect(0,0,s.value.width,s.value.height),c.value=[],p.ElMessage({type:"info",message:l("clearSuccess")})}).catch(()=>{})}const h=e.ref("");async function b(){let n=await z(s.value.toDataURL("image/png"));h.value=n,E("update:modelValue",n)}async function z(n){try{let t=atob(n.split(",")[1]),u=new ArrayBuffer(t.length),g=new Uint8Array(u);for(let y=0;y<t.length;y++)g[y]=t.charCodeAt(y);let m=new Blob([u],{type:"image/png"}),k=new FormData;k.append("file",m,Date.now()+"png");let U=await w.axios({method:"post",url:"https://ess-ds.com/prod-api/center-file/file/upload",data:k,headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+S.api.get("Admin-Token"),lang:S.api.get("saas-locale")||"zh-CN",zone:Intl.DateTimeFormat().resolvedOptions().timeZone}});return p.ElMessage({type:"success",message:l("uploadSuccess")}),U.data.data.url}catch{p.ElMessage({type:"warning",message:l("uploadFailed")}),r.value=!1}finally{r.value=!1}}const r=e.ref(!1);function I(){p.ElMessageBox.confirm(l("confirmAbandonSignature"),l("warning"),{confirmButtonText:l("confirm"),cancelButtonText:l("cancel"),type:"warning"}).then(()=>{a.value.clearRect(0,0,s.value.width,s.value.height),c.value=[],r.value=!1}).catch(()=>!1)}function V(){d.value||o.componentSchema.componentProps.readonly||o.componentSchema.componentProps.disabled||(r.value=!0,a.value&&(a.value.clearRect(0,0,s.value.width,s.value.height),c.value=[]),e.nextTick(()=>{N()}))}return e.onMounted(()=>{}),e.onUnmounted(()=>{}),B({surewrite:b}),(n,t)=>(e.openBlock(),e.createElementBlock("div",Y,[h.value?(e.openBlock(),e.createElementBlock("img",{key:1,class:"sign-board",src:h.value,alt:"",onClick:V},null,8,F)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"sign-board",onClick:V},e.toDisplayString(e.unref(l)("signaturePad")),1)),e.createVNode(e.unref(D),{modelValue:r.value,"onUpdate:modelValue":t[0]||(t[0]=u=>r.value=u),title:e.unref(l)("signaturePad"),class:"w-860px",width:"860px",style:{height:"600px"},"before-close":I,draggable:!1,modal:""},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createElementVNode("div",{class:"canvas",ref_key:"canvasWrap",ref:i},[e.createElementVNode("canvas",{id:`canvas${o.componentSchema.field}`,onMousedown:j,onMousemove:q,onMouseup:R},null,40,H)],512),e.createElementVNode("div",L,[t[1]||(t[1]=e.createElementVNode("div",{class:"remark"},null,-1)),e.createElementVNode("div",$,[e.createVNode(e.unref(P),{type:"info",size:"mini",onClick:_,onTouch:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("rewrite")),1)]),_:1}),e.createVNode(e.unref(P),{type:"primary",size:"mini",onClick:b,onTouch:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("confirm")),1)]),_:1})])])])]),_:1},8,["modelValue","title"])]))}},G=X._export_sfc(Z,[["__scopeId","data-v-4e3b1b32"]]);exports.default=G;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { inject as K, watch as Q, nextTick as A, ref as s, onMounted as
|
|
2
|
-
import { p as R, e as
|
|
1
|
+
import { inject as K, watch as Q, nextTick as A, ref as s, onMounted as ee, onUnmounted as te, openBlock as S, createElementBlock as _, toDisplayString as P, unref as u, createVNode as T, withCtx as k, createElementVNode as d, createTextVNode as W } from "vue";
|
|
2
|
+
import { p as R, e as ae } from "./axios-awtfJhsA.js";
|
|
3
3
|
import { ElMessageBox as j, ElMessage as C } from "element-plus";
|
|
4
|
-
import { u as
|
|
4
|
+
import { u as oe, a as z } from "./index-DWxy0GSJ.js";
|
|
5
5
|
import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
7
7
|
class: "sign",
|
|
@@ -9,7 +9,7 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
9
9
|
height: "100%",
|
|
10
10
|
width: "100%"
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, ie = ["id"], ue = { class: "btn" }, re = { class: "btns" }, me = {
|
|
13
13
|
__name: "sign",
|
|
14
14
|
props: {
|
|
15
15
|
componentSchema: {
|
|
@@ -23,8 +23,8 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
emits: ["update:modelValue"],
|
|
26
|
-
setup(E, { expose:
|
|
27
|
-
const { t: n } =
|
|
26
|
+
setup(E, { expose: I, emit: U }) {
|
|
27
|
+
const { t: n } = oe(), B = R.getComponent("button"), X = R.getComponent("Dialog"), Y = U, o = E, v = K("disabled", { value: !1 });
|
|
28
28
|
Q(
|
|
29
29
|
() => o.componentSchema,
|
|
30
30
|
() => {
|
|
@@ -34,20 +34,20 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
34
34
|
},
|
|
35
35
|
{ deep: !0, immediate: !0 }
|
|
36
36
|
);
|
|
37
|
-
const l = s(null), r = s(null), a = s(),
|
|
38
|
-
function
|
|
39
|
-
var t, e,
|
|
37
|
+
const l = s(null), r = s(null), a = s(), F = s("");
|
|
38
|
+
function N() {
|
|
39
|
+
var t, e, i, y;
|
|
40
40
|
if (r.value && ((t = r.value) != null && t.clientHeight) && ((e = r.value) != null && e.clientWidth)) {
|
|
41
|
-
if (l.value = document.getElementById(`canvas${o.componentSchema.field}`), l.value.height = ((
|
|
41
|
+
if (l.value = document.getElementById(`canvas${o.componentSchema.field}`), l.value.height = ((i = r.value) == null ? void 0 : i.clientHeight) || 600, l.value.width = (y = r.value) == null ? void 0 : y.clientWidth, a.value = l.value.getContext("2d"), o.modelValue) {
|
|
42
42
|
let p = new Image();
|
|
43
43
|
p.src = o.modelValue, p.setAttribute("crossOrigin", "anonymous"), p.onload = () => {
|
|
44
44
|
a.value.fillStyle = a.value.createPattern(p, "repeat"), a.value.fillRect(0, 0, 1e3, 550);
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
a.value.lineWidth = o.componentSchema.componentProps.lineWidth || 4, o.componentSchema && o.componentSchema.componentProps && o.componentSchema.componentProps.style && o.componentSchema.componentProps.style.color && (a.value.strokeStyle = o.componentSchema.componentProps.style.color),
|
|
47
|
+
a.value.lineWidth = o.componentSchema.componentProps.lineWidth || 4, o.componentSchema && o.componentSchema.componentProps && o.componentSchema.componentProps.style && o.componentSchema.componentProps.style.color && (a.value.strokeStyle = o.componentSchema.componentProps.style.color), F.value = l.value.getBoundingClientRect();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const f = s(""), h = s(""),
|
|
50
|
+
const f = s(""), h = s(""), O = s(""), H = s(""), c = s([]), w = s(!1);
|
|
51
51
|
function L(t) {
|
|
52
52
|
if (v.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled)
|
|
53
53
|
return;
|
|
@@ -58,16 +58,16 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
58
58
|
};
|
|
59
59
|
f.value = e.x, h.value = e.y, a.value.beginPath(), a.value.moveTo(e.x, e.y), a.value.lineTo(e.x, e.y), a.value.stroke(), a.value.closePath(), c.value.push(e), w.value = !0;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function $(t) {
|
|
62
62
|
if (!(v.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled) && (t = t || event, t.preventDefault(), w.value)) {
|
|
63
63
|
let e = {
|
|
64
64
|
x: t.offsetX,
|
|
65
65
|
y: t.offsetY
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
O.value = e.x, H.value = e.y, a.value.beginPath(), a.value.moveTo(f.value, h.value), a.value.lineTo(e.x, e.y), a.value.stroke(), a.value.closePath(), f.value = e.x, h.value = e.y, c.value.push(e);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function q(t) {
|
|
71
71
|
if (v.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled)
|
|
72
72
|
return;
|
|
73
73
|
t = t || event, t.preventDefault();
|
|
@@ -77,7 +77,7 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
77
77
|
};
|
|
78
78
|
a.value.beginPath(), a.value.moveTo(f.value, h.value), a.value.lineTo(e.x, e.y), a.value.stroke(), a.value.closePath(), c.value.push(e), c.value.push({ x: -1, y: -1 }), w.value = !1;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function D() {
|
|
81
81
|
j.confirm(n("rewriteWillClearCanvas"), n("warning"), {
|
|
82
82
|
confirmButtonText: n("confirm"),
|
|
83
83
|
cancelButtonText: n("cancel"),
|
|
@@ -92,23 +92,27 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
92
92
|
}
|
|
93
93
|
const g = s("");
|
|
94
94
|
async function x() {
|
|
95
|
-
let t = await
|
|
96
|
-
g.value = t,
|
|
95
|
+
let t = await Z(l.value.toDataURL("image/png"));
|
|
96
|
+
g.value = t, Y("update:modelValue", t);
|
|
97
97
|
}
|
|
98
|
-
async function
|
|
98
|
+
async function Z(t) {
|
|
99
99
|
try {
|
|
100
|
-
let e = atob(t.split(",")[1]),
|
|
100
|
+
let e = atob(t.split(",")[1]), i = new ArrayBuffer(e.length), y = new Uint8Array(i);
|
|
101
101
|
for (let b = 0; b < e.length; b++)
|
|
102
102
|
y[b] = e.charCodeAt(b);
|
|
103
|
-
let p = new Blob([
|
|
103
|
+
let p = new Blob([i], { type: "image/png" }), M = new FormData();
|
|
104
104
|
M.append("file", p, Date.now() + "png");
|
|
105
|
-
let J = await
|
|
105
|
+
let J = await ae({
|
|
106
106
|
method: "post",
|
|
107
107
|
url: "https://ess-ds.com/prod-api/center-file/file/upload",
|
|
108
108
|
data: M,
|
|
109
109
|
headers: {
|
|
110
110
|
"Content-Type": "multipart/form-data",
|
|
111
|
-
Authorization: "Bearer " +
|
|
111
|
+
Authorization: "Bearer " + z.get("Admin-Token"),
|
|
112
|
+
lang: z.get("saas-locale") || "zh-CN",
|
|
113
|
+
//语言
|
|
114
|
+
zone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
115
|
+
//时区
|
|
112
116
|
}
|
|
113
117
|
});
|
|
114
118
|
return C({
|
|
@@ -134,14 +138,14 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
134
138
|
a.value.clearRect(0, 0, l.value.width, l.value.height), c.value = [], m.value = !1;
|
|
135
139
|
}).catch(() => !1);
|
|
136
140
|
}
|
|
137
|
-
function
|
|
141
|
+
function V() {
|
|
138
142
|
v.value || o.componentSchema.componentProps.readonly || o.componentSchema.componentProps.disabled || (m.value = !0, a.value && (a.value.clearRect(0, 0, l.value.width, l.value.height), c.value = []), A(() => {
|
|
139
|
-
|
|
143
|
+
N();
|
|
140
144
|
}));
|
|
141
145
|
}
|
|
142
|
-
return
|
|
143
|
-
}),
|
|
144
|
-
}),
|
|
146
|
+
return ee(() => {
|
|
147
|
+
}), te(() => {
|
|
148
|
+
}), I({
|
|
145
149
|
surewrite: x
|
|
146
150
|
}), (t, e) => (S(), _("div", le, [
|
|
147
151
|
g.value ? (S(), _("img", {
|
|
@@ -149,16 +153,16 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
149
153
|
class: "sign-board",
|
|
150
154
|
src: g.value,
|
|
151
155
|
alt: "",
|
|
152
|
-
onClick:
|
|
156
|
+
onClick: V
|
|
153
157
|
}, null, 8, se)) : (S(), _("div", {
|
|
154
158
|
key: 0,
|
|
155
159
|
class: "sign-board",
|
|
156
|
-
onClick:
|
|
157
|
-
}, P(
|
|
158
|
-
|
|
160
|
+
onClick: V
|
|
161
|
+
}, P(u(n)("signaturePad")), 1)),
|
|
162
|
+
T(u(X), {
|
|
159
163
|
modelValue: m.value,
|
|
160
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
161
|
-
title:
|
|
164
|
+
"onUpdate:modelValue": e[0] || (e[0] = (i) => m.value = i),
|
|
165
|
+
title: u(n)("signaturePad"),
|
|
162
166
|
class: "w-860px",
|
|
163
167
|
width: "860px",
|
|
164
168
|
style: { height: "600px" },
|
|
@@ -166,7 +170,7 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
166
170
|
draggable: !1,
|
|
167
171
|
modal: ""
|
|
168
172
|
}, {
|
|
169
|
-
default:
|
|
173
|
+
default: k(() => [
|
|
170
174
|
d("div", ce, [
|
|
171
175
|
d("div", {
|
|
172
176
|
class: "canvas",
|
|
@@ -176,32 +180,32 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
176
180
|
d("canvas", {
|
|
177
181
|
id: `canvas${o.componentSchema.field}`,
|
|
178
182
|
onMousedown: L,
|
|
179
|
-
onMousemove:
|
|
180
|
-
onMouseup:
|
|
181
|
-
}, null, 40,
|
|
183
|
+
onMousemove: $,
|
|
184
|
+
onMouseup: q
|
|
185
|
+
}, null, 40, ie)
|
|
182
186
|
], 512),
|
|
183
|
-
d("div",
|
|
187
|
+
d("div", ue, [
|
|
184
188
|
e[1] || (e[1] = d("div", { class: "remark" }, null, -1)),
|
|
185
189
|
d("div", re, [
|
|
186
|
-
|
|
190
|
+
T(u(B), {
|
|
187
191
|
type: "info",
|
|
188
192
|
size: "mini",
|
|
189
|
-
onClick:
|
|
190
|
-
onTouch:
|
|
193
|
+
onClick: D,
|
|
194
|
+
onTouch: D
|
|
191
195
|
}, {
|
|
192
|
-
default:
|
|
193
|
-
W(P(
|
|
196
|
+
default: k(() => [
|
|
197
|
+
W(P(u(n)("rewrite")), 1)
|
|
194
198
|
]),
|
|
195
199
|
_: 1
|
|
196
200
|
}),
|
|
197
|
-
|
|
201
|
+
T(u(B), {
|
|
198
202
|
type: "primary",
|
|
199
203
|
size: "mini",
|
|
200
204
|
onClick: x,
|
|
201
205
|
onTouch: x
|
|
202
206
|
}, {
|
|
203
|
-
default:
|
|
204
|
-
W(P(
|
|
207
|
+
default: k(() => [
|
|
208
|
+
W(P(u(n)("confirm")), 1)
|
|
205
209
|
]),
|
|
206
210
|
_: 1
|
|
207
211
|
})
|
|
@@ -213,7 +217,7 @@ const le = { class: "sign-main" }, se = ["src"], ce = {
|
|
|
213
217
|
}, 8, ["modelValue", "title"])
|
|
214
218
|
]));
|
|
215
219
|
}
|
|
216
|
-
}, ge = /* @__PURE__ */ ne(me, [["__scopeId", "data-v-
|
|
220
|
+
}, ge = /* @__PURE__ */ ne(me, [["__scopeId", "data-v-4e3b1b32"]]);
|
|
217
221
|
export {
|
|
218
222
|
ge as default
|
|
219
223
|
};
|