epic-designer-gold 0.0.33 → 0.0.35
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-DVqMH1xY.js → attributeView-BuU8Ajxc.js} +1 -1
- package/dist/{attributeView-CkX6fubE.cjs → attributeView-n7qIXP7S.cjs} +1 -1
- package/dist/{index-DWA3Pa6_.cjs → index--mXdf_N_.cjs} +1 -1
- package/dist/{index-BGKInHWa.js → index-AT5ltRGN.js} +1 -1
- package/dist/index-B0dJIMij.cjs +10 -0
- package/dist/{index-BvRS3i9N.cjs → index-B1hinJbh.cjs} +1 -1
- package/dist/{index-Bl9bHpGb.cjs → index-B2BO1iqb.cjs} +1 -1
- package/dist/{index-BffcOK9E.cjs → index-BqrNcAYd.cjs} +1 -1
- package/dist/{index-CKl_FM23.cjs → index-C4wq_cwc.cjs} +1 -1
- package/dist/{index-CYyckZuN.js → index-CF3fYMNt.js} +1 -1
- package/dist/{index-QcfCoknU.js → index-CbVJE-r7.js} +479 -461
- package/dist/{index-DQBowkLQ.js → index-CfqYk0Cm.js} +1 -1
- package/dist/{index-i26diW3P.cjs → index-CueBqJva.cjs} +1 -1
- package/dist/index-D7xfe3p6.js +4 -0
- package/dist/{index-BqPBE6Y2.cjs → index-DMWZmwY3.cjs} +1 -1
- package/dist/{index-CY8bzSIr.js → index-DluF22Iv.js} +1 -1
- package/dist/{index-C7Rkr11-.cjs → index-Dxs27XfA.cjs} +1 -1
- package/dist/{index-B07zwTz2.js → index-I369bEhX.js} +1 -1
- package/dist/{index-C8_p36X3.js → index-QWJHIAu8.js} +1 -1
- package/dist/{index-bup0iSFb.js → index-XbBcyR0q.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/sign-BCmA2v-3.cjs +1 -0
- package/dist/{sign-d-TCl0NS.js → sign-CSv8hClp.js} +31 -32
- package/dist/style.css +1 -1
- package/dist/{styleView-DNbMFObZ.js → styleView-3R3fJCVy.js} +1 -1
- package/dist/{styleView-D_DJWtjt.cjs → styleView-CMN7E_-A.cjs} +1 -1
- package/dist/ui/elementPlus/index.cjs +1 -1
- package/dist/ui/elementPlus/index.js +1 -1
- package/package.json +1 -1
- package/dist/index-rlyOYH5_.cjs +0 -10
- package/dist/index-zlm7L3aS.js +0 -4
- package/dist/sign-CpJ83zt4.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as g, ref as p, onMounted as h, watch as v, nextTick as V, openBlock as _, createElementBlock as T } from "vue";
|
|
2
2
|
import * as a from "monaco-editor";
|
|
3
|
-
import { p as b } from "./index-
|
|
3
|
+
import { p as b } from "./index-CbVJE-r7.js";
|
|
4
4
|
import { _ as y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const x = /* @__PURE__ */ g({
|
|
6
6
|
__name: "index",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./axios-CYGTE3lR.cjs"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./axios-CYGTE3lR.cjs"),c=require("./index-B0dJIMij.cjs"),B=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),_=[{label:"string",value:"string"},{label:"number",value:"number"},{label:"boolean",value:"boolean"},{label:"method",value:"method"},{label:"regexp",value:"regexp"},{label:"integer",value:"integer"},{label:"float",value:"float"},{label:"array",value:"array"},{label:"object",value:"object"},{label:"date",value:"date"},{label:"url",value:"url"},{label:"hex",value:"hex"},{label:"email",value:"email"},{label:"any",value:"any"}],V=[{label:"change",value:"change"},{label:"blur",value:"blur"}],f=["string","number","url","array","email"],w={class:"rule-item-main bg-white m-t-2 p-2 rounded border border-solid border-gray-200 hover:border-primary transition-all relative"},E={key:0,class:"flex m-t-2 first:m-0"},x={class:"epic-attr-label",title:"校验时机"},q={class:"epic-attr-input"},C=e.defineComponent({__name:"ERuleItem",props:{rule:{}},emits:["change","delete","update:rule"],setup(h,{emit:b}){const i=b,d=h,r=e.computed({get(){return d.rule},set(l){i("update:rule",l)}}),u=e.inject("pageManager",{}),a=e.computed(()=>Object.entries(u.funcs.value).filter(([l,p])=>typeof p=="function").map(([l])=>({label:l,value:l}))),g=[{type:"select",label:"校验时机",model:"trigger",componentProps:{options:V,placeholder:"校验时机",multiple:!0,mode:"multiple"}},{type:"switch",label:"自定义规则",model:"isValidator"},{type:"select",label:"校验函数",model:"validator",show(){return!!r.value.isValidator},componentProps:{options:a.value,placeholder:"校验函数"}},{type:"select",label:"类型",model:"type",show(){return!r.value.isValidator},componentProps:{options:_,placeholder:"类型"}},{type:"input",label:"正则校验",model:"pattern",show(){return!r.value.isValidator},componentProps:{placeholder:"正则校验"}},{type:"number",label:"字段长度",model:"len",show(){return f.includes(r.value.type??"")},componentProps:{min:0,placeholder:"字段长度"}},{type:"number",label:"最小长度",model:"min",show(){return f.includes(r.value.type??"")},componentProps:{min:0,placeholder:"最小长度"}},{type:"number",label:"最大长度",model:"max",show(){return f.includes(r.value.type??"")},componentProps:{min:0,placeholder:"最大长度"}},{type:"input",label:"校验信息",model:"message",componentProps:{placeholder:"校验信息"}}];function o(){const l=r.value;l.isValidator?(delete l.type,delete l.pattern,delete l.len,delete l.min,delete l.max):delete l.validator,i("change",l)}function y(){i("delete")}return(l,p)=>(e.openBlock(),e.createElementBlock("div",w,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,(t,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[!t.show||t.show()?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("div",x,e.toDisplayString(t.label),1),e.createElementVNode("div",q,[e.createVNode(e.unref(c._sfc_main),{modelValue:r.value[t.model],"onUpdate:modelValue":n=>r.value[t.model]=n,componentSchema:{...t,noFormItem:!0},onChange:o},null,8,["modelValue","onUpdate:modelValue","componentSchema"])])])):e.createCommentVNode("",!0)],64))),64)),e.createElementVNode("div",{class:"rule-btn-delete absolute top-0 text-md right-0 transition-all w-24px h-24px cursor-pointer rounded-bl-2 flex justify-center items-center color-white",onClick:y},[e.createVNode(e.unref(B._sfc_main),{name:"icon--epic--delete-outline-rounded"})])]))}}),N={class:"rule-item-main m-t-2 p-2 rounded border border-solid transition-all relative"},P={key:0,class:"flex m-t-2 first:m-0"},U={class:"epic-attr-label"},F={class:"flex-1"},j=e.defineComponent({__name:"index",props:{ruleType:{type:String,default:"string"},modelValue:{type:Array,default:void 0}},emits:["update:modelValue"],setup(h,{emit:b}){const i=k.pluginManager.getComponent("button"),d=h,r=b,u=c.useVModel(d,"modelValue",r),a=e.ref({required:!1,message:"必填项",type:d.ruleType,trigger:["change"]}),g=[{type:"switch",label:"必填项",model:"required"},{type:"select",label:"校验时机",model:"trigger",show(){return!!a.value.required},componentProps:{options:V,placeholder:"校验时机",multiple:!0,mode:"multiple"}},{type:"select",label:"类型",model:"type",show(){return!!a.value.required},componentProps:{options:_,placeholder:"类型"}},{type:"input",label:"校验信息",model:"message",show(){return!!a.value.required},componentProps:{placeholder:"校验信息"}}],o=e.ref([]);e.watchEffect(()=>{u.value&&(o.value=[],u.value.forEach(t=>{typeof t.required<"u"?a.value=t:o.value.push(t)}))});function y(){o.value.push({message:"",type:d.ruleType,trigger:["change"]}),l()}function l(){if(a.value.required){u.value=c.deepClone([...o.value,a.value]);return}if(o.value.length){u.value=c.deepClone(o.value);return}u.value=void 0}function p(t){o.value.splice(t,1),l()}return(t,m)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",N,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[!n.show||n.show()?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",U,e.toDisplayString(n.label),1),e.createElementVNode("div",F,[e.createVNode(e.unref(c._sfc_main),{modelValue:a.value[n.model],"onUpdate:modelValue":v=>a.value[n.model]=v,componentSchema:{...n,noFormItem:!0},onChange:l},null,8,["modelValue","onUpdate:modelValue","componentSchema"])])])):e.createCommentVNode("",!0)],64))),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,s)=>(e.openBlock(),e.createBlock(C,{key:s,rule:o.value[s],"onUpdate:rule":v=>o.value[s]=v,onDelete:v=>p(s),onChange:l},null,8,["rule","onUpdate:rule","onDelete"]))),128)),e.createVNode(e.unref(i),{class:"m-t-2",onClick:y},{default:e.withCtx(()=>m[0]||(m[0]=[e.createTextVNode(" 添加规则 ")])),_:1})]))}});exports.default=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),p=require("monaco-editor"),b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),p=require("monaco-editor"),b=require("./index-B0dJIMij.cjs"),h=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function v(l){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const r in l)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(l,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>l[r]})}}return o.default=l,Object.freeze(o)}const i=v(p),_=a.defineComponent({__name:"index",props:{language:{default:"json"},readOnly:{type:Boolean,default:!1},valueFormat:{default:"string"},modelValue:{},config:{default:()=>({selectOnLineNumbers:!0,minimap:{enabled:!1}})},lineNumbers:{default:"on"},autoToggleTheme:{type:Boolean},theme:{default:"vs-light"}},emits:["update:modelValue"],setup(l,{expose:o,emit:r}){const t=l,s=r,c=a.ref(null);let e=null;const{isDark:f}=b.useTheme();function d(){f.value?i.editor.setTheme("vs-dark"):i.editor.setTheme("vs-light")}function m(u){e==null||e.setValue(u||"")}function g(u){const n=e==null?void 0:e.getPosition();n&&(e==null||e.executeEdits("",[{range:new i.Range(n.lineNumber,n.column,n.lineNumber,n.column),text:u}]),e==null||e.setPosition({...n,column:n.column+u.length}),e==null||e.focus())}return a.onMounted(()=>{e=i.editor.create(c.value,{value:u(),...t.config,language:t.language,readOnly:t.readOnly,lineNumbers:t.lineNumbers,theme:t.theme,scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},automaticLayout:!0}),t.autoToggleTheme&&a.watch(()=>f.value,()=>{a.nextTick(()=>d())},{immediate:!0});function u(){return t.valueFormat==="json"&&t.modelValue?JSON.stringify(t.modelValue,null,2):t.modelValue??""}e.onDidChangeModelContent(()=>{const n=e==null?void 0:e.getValue();if(t.valueFormat==="json"&&n){s("update:modelValue",JSON.parse(n));return}s("update:modelValue",n??"")})}),o({setValue:m,insertText:g}),(u,n)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"editContainer",ref:c,class:"epic-code-editor"},null,512))}}),y=h._export_sfc(_,[["__scopeId","data-v-3e2e893c"]]);exports.default=y;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as D, inject as i, ref as S, computed as b, openBlock as m, createElementBlock as h, createElementVNode as n, createVNode as r, unref as a, withCtx as w, Fragment as E, renderList as M, normalizeClass as j, toDisplayString as V, mergeProps as z, withDirectives as A, vShow as F } from "vue";
|
|
2
2
|
import { d as G } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
3
|
import { p as d } from "./axios-ITY6Uw7A.js";
|
|
4
|
-
import { g as B, f as q } from "./index-
|
|
4
|
+
import { g as B, f as q } from "./index-CbVJE-r7.js";
|
|
5
5
|
import { _ as I } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
6
6
|
const H = { class: "epic-component-view flex flex-col" }, J = { class: "epic-search-box px-10px py-6px" }, K = { class: "flex flex-1 overflow-auto" }, O = { class: "epic-tabs-box" }, Q = ["title", "onClick"], R = { class: "h-full flex-1 overflow-auto py-2 box-border" }, W = ["onClick"], X = { class: "epic-componet-label flex-1 w-0 truncate" }, Y = { class: "text-center pt-42px text-gray-400" }, ae = /* @__PURE__ */ D({
|
|
7
7
|
__name: "index",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),N=require("./vuedraggable.umd-BqhSJIAi.cjs"),i=require("./axios-CYGTE3lR.cjs"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),N=require("./vuedraggable.umd-BqhSJIAi.cjs"),i=require("./axios-CYGTE3lR.cjs"),u=require("./index-B0dJIMij.cjs"),x=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),w={class:"epic-component-view flex flex-col"},E={class:"epic-search-box px-10px py-6px"},B={class:"flex flex-1 overflow-auto"},M={class:"epic-tabs-box"},j=["title","onClick"],q={class:"h-full flex-1 overflow-auto py-2 box-border"},I=["onClick"],L={class:"epic-componet-label flex-1 w-0 truncate"},P={class:"text-center pt-42px text-gray-400"},T=e.defineComponent({__name:"index",setup($){const k=i.pluginManager.getComponent("input"),d=e.inject("pageSchema"),p=e.inject("designer"),y=e.inject("revoke"),C=e.inject("designerProps"),m=i.pluginManager.getComponentSchemaGroups(),a=e.ref(""),g={title:"全部",list:[]},c=e.ref(g),S=e.computed(()=>[g,...m.value]),s=e.computed(()=>{let o=c.value.list;if(c.value.title==="全部"){const n=m.value.map(t=>t.list);o=[].concat(...n)}return o.filter(n=>{var t;return((t=n.label)==null?void 0:t.includes(a.value))&&(!C.value.formMode||n.type!=="form")})});function V(o){c.value=o}function b(o){var v,f,_;const n=u.findSchemaInfoById(d.schemas,((v=p.state.checkedNode)==null?void 0:v.id)??"root");if(!n)return!1;let{list:t,schema:l,index:r}=n;l.children&&!((_=(f=i.pluginManager.getComponentConfingByType(l.type))==null?void 0:f.editConstraints)!=null&&_.childImmovable)&&(t=l.children,r=l.children.length-1);const h=u.generateNewSchema(o);t.splice(r+1,0,h),p.setCheckedNode(h),y.push(d.schemas,"插入组件")}return(o,n)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",E,[e.createVNode(e.unref(k),{placeholder:"搜索组件",modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=t=>a.value=t),clearable:"",allowClear:"",value:a.value,"onUpdate:value":n[1]||(n[1]=t=>a.value=t)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(x._sfc_main),{class:"text-$epic-text-helper",name:"icon--epic--search-rounded"})]),_:1},8,["modelValue","value"])]),e.createElementVNode("div",B,[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:c.value.title===t.title}]),key:l,title:t.title,onClick:r=>V(t)},e.toDisplayString(t.title),11,j))),128))]),e.createElementVNode("div",q,[e.createVNode(e.unref(N.draggable),e.mergeProps({modelValue:s.value,"onUpdate:modelValue":n[2]||(n[2]=t=>s.value=t)},{group:{name:"edit-draggable",pull:"clone",put:!1},sort:!1,animation:180,ghostClass:"moving"},{clone:e.unref(u.generateNewSchema),"item-key":"id",class:"grid grid-cols-[auto_auto] px-10px gap-2"}),{item:e.withCtx(({element:t})=>[e.createElementVNode("div",{class:"epic-componet-item flex items-center truncate",onClick:l=>b(t)},[e.createVNode(e.unref(x._sfc_main),{name:e.unref(i.pluginManager).getComponentConfingByType(t.type).icon??""},null,8,["name"]),e.createElementVNode("div",L,e.toDisplayString(t.label),1)],8,I)]),_:1},16,["modelValue","clone"]),e.withDirectives(e.createElementVNode("div",P,"没有查询到的组件",512),[[e.vShow,!s.value.length]])])])]))}});exports.default=T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as X, inject as L, ref as C, computed as U, watch as G, openBlock as M, createElementBlock as W, Fragment as q, withDirectives as ue, createElementVNode as w, normalizeClass as ee, toDisplayString as be, unref as f, createVNode as z, createCommentVNode as le, vShow as de, createBlock as te, mergeProps as Se, withCtx as oe, useAttrs as we, provide as Ce, onUnmounted as ke, resolveComponent as Ne, createSlots as $e, renderList as ve, shallowRef as Re, watchEffect as Te, nextTick as pe, normalizeStyle as se, renderSlot as Be, onMounted as Oe } from "vue";
|
|
2
2
|
import { p as J } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { u as fe, a as Me, f as me, g as Le, b as ae, _ as De, d as ce, c as He, e as Ve, h as We, i as ze, w as Ae, j as Ee } from "./index-
|
|
3
|
+
import { u as fe, a as Me, f as me, g as Le, b as ae, _ as De, d as ce, c as He, e as Ve, h as We, i as ze, w as Ae, j as Ee } from "./index-CbVJE-r7.js";
|
|
4
4
|
import { _ as ie } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
import { d as Ie } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
6
6
|
const Pe = { class: "epic-widget-action-item whitespace-nowrap" }, je = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as B, computed as P, inject as O, openBlock as r, createElementBlock as u, Fragment as c, renderList as k, createElementVNode as d, toDisplayString as U, createVNode as g, unref as y, createCommentVNode as $, ref as C, watchEffect as T, createBlock as I, withCtx as M, createTextVNode as N } from "vue";
|
|
2
2
|
import { p as R } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { _ as j, n as F, m as q } from "./index-
|
|
3
|
+
import { _ as j, n as F, m as q } from "./index-CbVJE-r7.js";
|
|
4
4
|
import { _ as A } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
const D = [
|
|
6
6
|
{ label: "string", value: "string" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as U, inject as L, openBlock as p, createElementBlock as g, Fragment as A, renderList as T, createElementVNode as i, toDisplayString as O, createVNode as C, unref as _, withCtx as R, createCommentVNode as G, createTextVNode as J, ref as E, computed as S, withDirectives as F, normalizeClass as j, vShow as P, reactive as H, createBlock as K, nextTick as Q, toRaw as z, watch as W } from "vue";
|
|
2
|
-
import { l as q, _ as X, k as Y, m as Z } from "./index-
|
|
2
|
+
import { l as q, _ as X, k as Y, m as Z } from "./index-CbVJE-r7.js";
|
|
3
3
|
import { p as w } from "./axios-ITY6Uw7A.js";
|
|
4
4
|
import { _ as D } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
import { d as ee } from "./vuedraggable.umd-D2S7Eo7p.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B0dJIMij.cjs"),a=require("./axios-CYGTE3lR.cjs");exports.EBuilder=e._sfc_main$1;exports.EDesigner=e._sfc_main$2;exports.ENode=e._sfc_main;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.convertKFormData=e.convertKFormData;exports.debounce=e.debounce;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.getDarkState=e.getDarkState;exports.getFormFields=e.getFormFields;exports.getFormSchemas=e.getFormSchemas;exports.getMatchedById=e.getMatchedById;exports.getUUID=e.getUUID;exports.getValueByPath=e.getValueByPath;exports.initStore=e.initStore;exports.mapSchemas=e.mapSchemas;exports.recursionConvertedNode=e.recursionConvertedNode;exports.setValueByPath=e.setValueByPath;exports.useDark=e.useDark;exports.useElementDrag=e.useElementDrag;exports.useElementZoom=e.useElementZoom;exports.useKeyPress=e.useKeyPress;exports.usePageManager=e.usePageManager;exports.useRevoke=e.useRevoke;exports.useStore=e.useStore;exports.useTheme=e.useTheme;exports.useTimedQuery=e.useTimedQuery;exports.EventBus=a.EventBus;exports.PluginManager=a.PluginManager;exports.loadAsyncComponent=a.loadAsyncComponent;exports.pluginManager=a.pluginManager;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as s, r as t, _ as r, E as o, c as n, j as d, m, d as u, x as i, l as g, f as l, B as c, g as p, H as h, z as y, A as E, y as S, k as f, o as B, I as D, C as F, D as I, s as P, G as v, e as C, i as M, F as k, t as x, v as A, u as N, p as q, a as z } from "./index-
|
|
1
|
+
import { q as s, r as t, _ as r, E as o, c as n, j as d, m, d as u, x as i, l as g, f as l, B as c, g as p, H as h, z as y, A as E, y as S, k as f, o as B, I as D, C as F, D as I, s as P, G as v, e as C, i as M, F as k, t as x, v as A, u as N, p as q, a as z } from "./index-CbVJE-r7.js";
|
|
2
2
|
import { E as T, P as U, l as V, p as b } from "./axios-ITY6Uw7A.js";
|
|
3
3
|
export {
|
|
4
4
|
s as EBuilder,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./axios-CYGTE3lR.cjs"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),E={class:"btn"},j={class:"btns"},z={__name:"sign",props:{componentSchema:{type:Object,require:!0,default:()=>({})},modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(x,{expose:b,emit:w}){const d=g.pluginManager.getComponent("button"),S=w,a=x;t.watch(()=>a.componentSchema,()=>{t.nextTick(()=>{v()})},{deep:!0,immediate:!0});const P=new ResizeObserver(o=>{for(const e of o)e.target&&e.target.clientWidth&&e.target.clientHeight&&v()}),l=t.ref(null),u=t.ref(null),n=t.ref(),V=t.ref("");function v(){var o,e;if(u.value&&((o=u.value)!=null&&o.clientHeight)&&((e=u.value)!=null&&e.clientWidth)){if(l.value.height=u.value.clientHeight,l.value.width=u.value.clientWidth,n.value=l.value.getContext("2d"),a.modelValue){let s=new Image;s.src=a.modelValue,s.setAttribute("crossOrigin","anonymous"),s.onload=()=>{n.value.fillStyle=n.value.createPattern(s,"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),V.value=l.value.getBoundingClientRect()}}const i=t.ref(""),c=t.ref(""),_=t.ref(""),T=t.ref(""),r=t.ref([]),m=t.ref(!1);function k(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};i.value=e.x,c.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(),r.value.push(e),m.value=!0}function C(o){if(o=o||event,o.preventDefault(),m.value){let e={x:o.offsetX,y:o.offsetY};_.value=e.x,T.value=e.y,n.value.beginPath(),n.value.moveTo(i.value,c.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),i.value=e.x,c.value=e.y,r.value.push(e)}}function N(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};n.value.beginPath(),n.value.moveTo(i.value,c.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),r.value.push(e),r.value.push({x:-1,y:-1}),m.value=!1}function h(){n.value.clearRect(0,0,l.value.width,l.value.height),r.value=[]}async function f(){let o=await D(l.value.toDataURL("image/png"));S("update:modelValue",o)}async function D(o){let e=atob(o.split(",")[1]),s=new ArrayBuffer(e.length),M=new Uint8Array(s);for(let p=0;p<e.length;p++)M[p]=e.charCodeAt(p);let W=new Blob([s],{type:"image/png"}),y=new FormData;return y.append("file",W,Date.now()+"png"),(await g.axios({method:"post",url:"https://ess-ds.com/prod-api/center-file/file/upload",data:y,headers:{"Content-Type":"multipart/form-data"}})).data.data.url}return t.onMounted(()=>{v(),P.observe(u.value)}),t.onUnmounted(()=>{}),b({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:u},[t.createElementVNode("canvas",{ref_key:"canvas",ref:l,onMousedown:k,onMousemove:C,onMouseup:N},null,544)],512),t.createElementVNode("div",E,[e[2]||(e[2]=t.createElementVNode("div",{class:"remark"},null,-1)),t.createElementVNode("div",j,[t.createVNode(t.unref(d),{type:"info",size:"mini",onClick:h,onTouch:h},{default:t.withCtx(()=>e[0]||(e[0]=[t.createTextVNode("重写")])),_:1}),t.createVNode(t.unref(d),{type:"primary",size:"mini",onClick:f,onTouch:f},{default:t.withCtx(()=>e[1]||(e[1]=[t.createTextVNode("确定")])),_:1})])])],4))}},O=B._export_sfc(z,[["__scopeId","data-v-e6820cdc"]]);exports.default=O;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { watch as j, nextTick as A, ref as a, onMounted as O, onUnmounted as U, openBlock as H, createElementBlock as I, normalizeStyle as N, createElementVNode as
|
|
1
|
+
import { watch as j, nextTick as A, ref as a, onMounted as O, onUnmounted as U, openBlock as H, createElementBlock as I, normalizeStyle as N, createElementVNode as r, createVNode as x, unref as b, withCtx as w, createTextVNode as P } from "vue";
|
|
2
2
|
import { p as E, a as F } from "./axios-ITY6Uw7A.js";
|
|
3
3
|
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
@@ -15,9 +15,9 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
emits: ["update:modelValue"],
|
|
18
|
-
setup(
|
|
19
|
-
const h = E.getComponent("button"), T =
|
|
20
|
-
|
|
18
|
+
setup(S, { expose: _, emit: k }) {
|
|
19
|
+
const h = E.getComponent("button"), T = k, n = S;
|
|
20
|
+
j(
|
|
21
21
|
() => n.componentSchema,
|
|
22
22
|
() => {
|
|
23
23
|
A(() => {
|
|
@@ -42,37 +42,36 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
42
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), D.value = l.value.getBoundingClientRect();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
45
|
+
const c = a(""), p = a(""), V = a(""), W = a(""), i = a([]), f = a(!1);
|
|
46
|
+
function B(t) {
|
|
47
47
|
t = t || event, t.preventDefault();
|
|
48
48
|
let e = {
|
|
49
49
|
x: t.offsetX,
|
|
50
50
|
y: t.offsetY
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
c.value = e.x, p.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(), i.value.push(e), f.value = !0;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function M(t) {
|
|
55
55
|
if (t = t || event, t.preventDefault(), f.value) {
|
|
56
56
|
let e = {
|
|
57
57
|
x: t.offsetX,
|
|
58
58
|
y: t.offsetY
|
|
59
59
|
};
|
|
60
|
-
V.value = e.x,
|
|
60
|
+
V.value = e.x, W.value = e.y, o.value.beginPath(), o.value.moveTo(c.value, p.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), c.value = e.x, p.value = e.y, i.value.push(e);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function z(t) {
|
|
64
64
|
t = t || event, t.preventDefault();
|
|
65
65
|
let e = {
|
|
66
66
|
x: t.offsetX,
|
|
67
67
|
y: t.offsetY
|
|
68
68
|
};
|
|
69
|
-
o.value.beginPath(), o.value.moveTo(
|
|
69
|
+
o.value.beginPath(), o.value.moveTo(c.value, p.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), i.value.push(e), i.value.push({ x: -1, y: -1 }), f.value = !1;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function y() {
|
|
72
72
|
o.value.clearRect(0, 0, l.value.width, l.value.height), i.value = [];
|
|
73
73
|
}
|
|
74
74
|
async function d() {
|
|
75
|
-
console.log("%c [ ]-145", "font-size:13px; background:pink; color:#bf2c9f;", l.value);
|
|
76
75
|
let t = await R(l.value.toDataURL("image/png"));
|
|
77
76
|
T("update:modelValue", t);
|
|
78
77
|
}
|
|
@@ -80,11 +79,11 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
80
79
|
let e = atob(t.split(",")[1]), u = new ArrayBuffer(e.length), X = new Uint8Array(u);
|
|
81
80
|
for (let m = 0; m < e.length; m++)
|
|
82
81
|
X[m] = e.charCodeAt(m);
|
|
83
|
-
let Y = new Blob([u], { type: "image/png" }),
|
|
84
|
-
return
|
|
82
|
+
let Y = new Blob([u], { type: "image/png" }), g = new FormData();
|
|
83
|
+
return g.append("file", Y, Date.now() + "png"), (await F({
|
|
85
84
|
method: "post",
|
|
86
85
|
url: "https://ess-ds.com/prod-api/center-file/file/upload",
|
|
87
|
-
data:
|
|
86
|
+
data: g,
|
|
88
87
|
headers: {
|
|
89
88
|
"Content-Type": "multipart/form-data"
|
|
90
89
|
}
|
|
@@ -93,7 +92,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
93
92
|
return O(() => {
|
|
94
93
|
v(), C.observe(s.value);
|
|
95
94
|
}), U(() => {
|
|
96
|
-
}),
|
|
95
|
+
}), _({
|
|
97
96
|
surewrite: d
|
|
98
97
|
}), (t, e) => (H(), I("div", {
|
|
99
98
|
class: "sign",
|
|
@@ -102,41 +101,41 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
102
101
|
width: n.componentSchema.componentProps.style.width || "100%"
|
|
103
102
|
})
|
|
104
103
|
}, [
|
|
105
|
-
|
|
104
|
+
r("div", {
|
|
106
105
|
class: "canvas",
|
|
107
106
|
ref_key: "canvasWrap",
|
|
108
107
|
ref: s
|
|
109
108
|
}, [
|
|
110
|
-
|
|
109
|
+
r("canvas", {
|
|
111
110
|
ref_key: "canvas",
|
|
112
111
|
ref: l,
|
|
113
|
-
onMousedown:
|
|
114
|
-
onMousemove:
|
|
115
|
-
onMouseup:
|
|
112
|
+
onMousedown: B,
|
|
113
|
+
onMousemove: M,
|
|
114
|
+
onMouseup: z
|
|
116
115
|
}, null, 544)
|
|
117
116
|
], 512),
|
|
118
|
-
|
|
119
|
-
e[2] || (e[2] =
|
|
120
|
-
|
|
121
|
-
b(
|
|
117
|
+
r("div", L, [
|
|
118
|
+
e[2] || (e[2] = r("div", { class: "remark" }, null, -1)),
|
|
119
|
+
r("div", G, [
|
|
120
|
+
x(b(h), {
|
|
122
121
|
type: "info",
|
|
123
122
|
size: "mini",
|
|
124
|
-
onClick:
|
|
125
|
-
onTouch:
|
|
123
|
+
onClick: y,
|
|
124
|
+
onTouch: y
|
|
126
125
|
}, {
|
|
127
126
|
default: w(() => e[0] || (e[0] = [
|
|
128
|
-
|
|
127
|
+
P("重写")
|
|
129
128
|
])),
|
|
130
129
|
_: 1
|
|
131
130
|
}),
|
|
132
|
-
b(
|
|
131
|
+
x(b(h), {
|
|
133
132
|
type: "primary",
|
|
134
133
|
size: "mini",
|
|
135
134
|
onClick: d,
|
|
136
135
|
onTouch: d
|
|
137
136
|
}, {
|
|
138
137
|
default: w(() => e[1] || (e[1] = [
|
|
139
|
-
|
|
138
|
+
P("确定")
|
|
140
139
|
])),
|
|
141
140
|
_: 1
|
|
142
141
|
})
|
|
@@ -144,7 +143,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
144
143
|
])
|
|
145
144
|
], 4));
|
|
146
145
|
}
|
|
147
|
-
}, ee = /* @__PURE__ */ q(J, [["__scopeId", "data-v-
|
|
146
|
+
}, ee = /* @__PURE__ */ q(J, [["__scopeId", "data-v-e6820cdc"]]);
|
|
148
147
|
export {
|
|
149
148
|
ee as default
|
|
150
149
|
};
|