epic-designer-gold 0.0.13 → 0.0.15
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-BoLhVQzb.cjs +1 -0
- package/dist/{attributeView-CqQCeL9p.js → attributeView-CsETdPfQ.js} +2 -2
- package/dist/axios-CYGTE3lR.cjs +6 -0
- package/dist/axios-ITY6Uw7A.js +2085 -0
- package/dist/core/components/builder/src/builder.vue.d.ts +2 -0
- package/dist/core/components/node/src/node.vue.d.ts +4 -2
- package/dist/core/components/tree/src/tree.vue.d.ts +1 -1
- package/dist/core/extensions/EOptionsEditor/index.vue.d.ts +2 -2
- package/dist/eventView-CeoqK6Se.cjs +1 -0
- package/dist/{eventView-C_THyz3W.js → eventView-y92-iX1R.js} +2 -2
- package/dist/index-1afOcXnV.cjs +1 -0
- package/dist/index-9NfXcZ4Y.cjs +1 -0
- package/dist/{index-M-hTLR0c.js → index-ASoFJnMl.js} +1 -1
- package/dist/index-B03W7FZR.cjs +1 -0
- package/dist/index-BJlPL6eL.cjs +1 -0
- package/dist/index-BUw5OdPn.cjs +1 -0
- package/dist/index-BXqSZLpt.js +4 -0
- package/dist/{index-BqPDmqv7.js → index-BimQe5uF.js} +2 -2
- package/dist/index-BuNxO1Pv.cjs +1 -0
- package/dist/{index-sZ9OfgE1.cjs → index-BwZBxXdy.cjs} +1 -1
- package/dist/{index-Ba0ZjQgI.js → index-C-XUgjda.js} +1 -1
- package/dist/index-C3ug5HS-.cjs +10 -0
- package/dist/{index-HM72iSCq.js → index-C4sdhgF2.js} +1 -1
- package/dist/index-C6ceZM1C.cjs +1 -0
- package/dist/{index-Dm_60RQ9.js → index-CCTMCqiz.js} +3 -4
- package/dist/index-CM2yS7Lz.js +216 -0
- package/dist/{index-DBj3eppg.js → index-CgW7uOAC.js} +2 -2
- package/dist/index-CzIPdR2H.js +1550 -0
- package/dist/{index-BMnsWYrT.js → index-D4hsNiQf.js} +3 -3
- package/dist/{index-DtXxkuvD.js → index-DLeXF615.js} +2 -2
- package/dist/index-DpzLP1Zp.cjs +1 -0
- package/dist/{index-GtUWspi3.js → index-DqoXRcy4.js} +2 -2
- package/dist/{index-DAWH9Tr_.js → index-Dzatsws1.js} +2 -2
- package/dist/index-FRRNZqrr.cjs +1 -0
- package/dist/index-FW4I6HiK.cjs +1 -0
- package/dist/index-PwPgOIVo.cjs +1 -0
- package/dist/{index-BC_6e5pJ.js → index-QVJsPbkw.js} +1 -1
- package/dist/index-Uwfc3-yh.cjs +1 -0
- package/dist/{index-uaq_HmHi.js → index-ooVzYa5L.js} +1 -1
- package/dist/{index-BnRo1212.cjs → index-uPLxG_y4.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/outline-CJSEUbgc.cjs +1 -0
- package/dist/{outline-utbOTCBV.js → outline-yy4pIEi3.js} +2 -2
- package/dist/{sign-CdhDIjlg.js → sign-BDZCr3wJ.js} +11 -12
- package/dist/sign-Gwu2PIRy.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/styleView-BfH5Ujdi.cjs +1 -0
- package/dist/{styleView-DX_XKKmF.js → styleView-kap7mePV.js} +2 -2
- package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +1 -0
- package/dist/{tree.vue_vue_type_script_setup_true_lang-Bnl1CGxG.js → tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js} +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/attributeView-CfMG9ANQ.cjs +0 -1
- package/dist/axios-CXDYiOMX.js +0 -1704
- package/dist/axios-tuVKNgv9.cjs +0 -6
- package/dist/eventView-CSJb3Zam.cjs +0 -1
- package/dist/index-B3dTIoEC.cjs +0 -1
- package/dist/index-Bd5nBb_T.cjs +0 -1
- package/dist/index-Bs6GdgDl.cjs +0 -1
- package/dist/index-CaIsXqm5.cjs +0 -1
- package/dist/index-Ctr7oJRf.cjs +0 -1
- package/dist/index-CuxnFxdY.cjs +0 -1
- package/dist/index-Cz47jN8A.cjs +0 -1
- package/dist/index-DAk3CFkW.cjs +0 -1
- package/dist/index-DBQ-tc2k.cjs +0 -1
- package/dist/index-DWjMyXtP.cjs +0 -1
- package/dist/index-DZ5RBl4U.cjs +0 -1
- package/dist/index-MwVOPR2b.js +0 -1509
- package/dist/index-S4XwR1vD.js +0 -215
- package/dist/index-jsf_Tgj1.js +0 -4
- package/dist/index-mxP1Ba2T.cjs +0 -1
- package/dist/index-p6doDa9j.cjs +0 -10
- package/dist/outline-UAdT8ap6.cjs +0 -1
- package/dist/pluginManager-D8PM7ICc.js +0 -383
- package/dist/pluginManager-itCTrGag.cjs +0 -1
- package/dist/sign-Dx0d5kWo.cjs +0 -1
- package/dist/styleView-0rthSdVL.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-BVopU0uv.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
3
|
-
import { p as w } from "./
|
|
2
|
+
import { l as q, _ as X, k as Y, m as Z } from "./index-CzIPdR2H.js";
|
|
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";
|
|
6
|
-
import { _ as te } from "./tree.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { _ as te } from "./tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js";
|
|
7
7
|
const ne = { class: "epic-event-info" }, oe = ["title"], le = { class: "epic-event-btn text-lg flex items-center text-$epic-text-secondary" }, ae = { class: "epic-action-editor-main" }, se = { class: "epic-editor-item rounded" }, ie = { class: "w-36px flex items-center text-lg" }, ce = { class: "flex-1" }, de = { key: 0 }, ue = { key: 1 }, re = { key: 2 }, pe = { class: "epic-action-box text-lg text-$epic-text-medium" }, me = ["onClick"], ve = ["onClick"], fe = /* @__PURE__ */ U({
|
|
8
8
|
__name: "EActionEditorItem",
|
|
9
9
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as K, inject as L, ref as C, computed as j, watch as Y, openBlock as M, createElementBlock as W, Fragment as X, withDirectives as de, createElementVNode as w, normalizeClass as q, toDisplayString as _e, unref as h, createVNode as z, createCommentVNode as se, vShow as ue, 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 le, renderSlot as Be, onMounted as Oe } from "vue";
|
|
2
|
-
import { p as U } from "./
|
|
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 Pe } from "./index-
|
|
2
|
+
import { p as U } 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 Pe } from "./index-CzIPdR2H.js";
|
|
4
4
|
import { _ as ie } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
import { d as Ee } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
6
6
|
const Fe = { class: "epic-widget-action-item whitespace-nowrap" }, Ie = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./axios-CYGTE3lR.cjs"),x=e.defineComponent({__name:"index",props:{modelValue:{}},emits:["update:modelValue"],setup(v,{emit:i}){const p=r.pluginManager.getComponent("input"),s=r.pluginManager.getComponent("select"),d=v,m=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(()=>d.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,()=>{c()});function c(){e.nextTick(()=>m("update:modelValue",l.value?l.value+t.value:void 0))}return(n,u)=>(e.openBlock(),e.createBlock(e.unref(p),{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:"请输入"},{suffix:e.withCtx(()=>[e.createVNode(e.unref(s),{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"]))}});exports.default=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as V, computed as k, openBlock as a, createElementBlock as l, Fragment as g, renderList as C, createVNode as p, unref as r, createElementVNode as c, createCommentVNode as y } from "vue";
|
|
2
|
-
import { p as U } from "./
|
|
3
|
-
import { k as P } from "./index-
|
|
2
|
+
import { p as U } from "./axios-ITY6Uw7A.js";
|
|
3
|
+
import { k as P } from "./index-CzIPdR2H.js";
|
|
4
4
|
import { _ as b } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
const E = {
|
|
6
6
|
key: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as u, ref as p, inject as d, watch as f, toRaw as m, openBlock as g, createElementBlock as _, createVNode as h, unref as r } from "vue";
|
|
2
|
-
import { p as N } from "./
|
|
3
|
-
import { o as y, d as k } from "./index-
|
|
2
|
+
import { p as N } from "./axios-ITY6Uw7A.js";
|
|
3
|
+
import { o as y, d as k } from "./index-CzIPdR2H.js";
|
|
4
4
|
const E = { class: "epic-sound-code" }, R = /* @__PURE__ */ u({
|
|
5
5
|
__name: "index",
|
|
6
6
|
setup(O) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("./axios-CYGTE3lR.cjs"),v=require("./index-C3ug5HS-.cjs"),k=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),V={key:0,class:"epic-del-btn"},f=["onClick"],h=e.defineComponent({__name:"index",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(c,{emit:r}){const u=_.pluginManager.getComponent("number"),s=c,d=r,o=e.computed({get(){return s.modelValue},set(n){d("update:modelValue",n)}});function p(){const n={type:"col",children:[],componentProps:{span:12},id:v.getUUID()};o.value.push(n)}function i(n){o.value=o.value.filter((m,t)=>n!==t)}return(n,m)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(t,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"EColEditor-item"},[e.createVNode(e.unref(u),{value:t.componentProps.span,"onUpdate:value":l=>t.componentProps.span=l,modelValue:t.componentProps.span,"onUpdate:modelValue":l=>t.componentProps.span=l,style:{width:"100%"},min:1,max:24},null,8,["value","onUpdate:value","modelValue","onUpdate:modelValue"]),o.value.length>1?(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("span",{onClick:l=>i(a)},[e.createVNode(e.unref(k._sfc_main),{name:"icon-shanchu1"})],8,f)])):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("div",{class:"add-btn",onClick:p}," 添加 ")]))}});exports.default=h;
|
|
@@ -0,0 +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-C3ug5HS-.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./vuedraggable.umd-BqhSJIAi.cjs"),p=require("./axios-CYGTE3lR.cjs"),b=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),C=require("./index-C3ug5HS-.cjs"),B=require("element-plus"),S=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U={key:0,class:"pl-4"},M=e.defineComponent({name:"EOptionItem",__name:"optionItem",props:{modelValue:{}},emits:["update:modelValue"],setup(h,{emit:k}){const y=h,f=p.pluginManager.getComponent("input"),d=e.inject("tree",!1),s=k,i=C.useVModel(y,"modelValue",s);function _(a){const c={label:"",value:""};a.children?a.children.push(c):a.children=[c]}function r(a){i.value=i.value.filter((c,v)=>v!==a)}return(a,c)=>{const v=e.resolveComponent("EOptionItem");return e.openBlock(),e.createBlock(e.unref(E.draggable),{modelValue:e.unref(i),"onUpdate:modelValue":c[0]||(c[0]=n=>e.isRef(i)?i.value=n:null),"item-key":"id","component-data":{type:"transition-group"},group:"option-list",handle:".handle",animation:200},{item:e.withCtx(({element:n,index:g})=>[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass([e.unref(d)?"grid-cols-[16px_auto_auto_16px_16px]":"grid-cols-[16px_auto_auto_16px]","option-item text-16px grid text-$epic-text-secondary gap-2 items-center mb-2"])},[e.createVNode(e.unref(b._sfc_main),{class:"mr-2 cursor-move handle",name:"icon--epic--drag"}),e.createVNode(e.unref(f),{modelValue:n.label,"onUpdate:modelValue":o=>n.label=o,value:n.label,"onUpdate:value":o=>n.label=o,placeholder:"label"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.createVNode(e.unref(f),{modelValue:n.value,"onUpdate:modelValue":o=>n.value=o,value:n.value,"onUpdate:value":o=>n.value=o,placeholder:"value"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.unref(d)?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,class:"cursor-pointer text-lg!",name:"icon--epic--add-rounded",onClick:o=>_(n)},null,8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(b._sfc_main),{class:"hover:text-red cursor-pointer",name:"icon--epic--delete-outline-rounded",onClick:o=>r(g)},null,8,["onClick"])],2),n.children?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(v,{modelValue:n.children,"onUpdate:modelValue":o=>n.children=o},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),O={class:""},I={class:"epic-tabs-box"},q=["title","onClick"],w={key:0},$={class:"py-4 my-2 text-center text-gray-400 bg-white"},j={key:1},A=e.defineComponent({__name:"index",props:{tree:{type:Boolean},modelValue:{},dynamicId:{},type:{}},emits:["update:modelValue","update:EOptionsEditor"],setup(h,{emit:k}){const y=p.pluginManager.getComponent("button"),f=p.pluginManager.getComponent("select"),d=e.ref([]),s=e.reactive({title:"静态"}),i=h,_=k;p.EventBus.on("updateSource",l=>{d.value=p.pluginManager.sourceData.map(t=>({...t,label:t.apiName,value:t.id})),g(a.value)}),e.onMounted(()=>{d.value=p.pluginManager.sourceData.map(l=>({...l,label:l.apiName,value:l.id}))});const r=C.useVModel(i,"modelValue",_),a=C.useVModel(i,"dynamicId",_);function c(l){return l&&Object.prototype.toString.call(l)==="[object Array]"?l:(B.ElMessage.info("请检查数据位置是否配置准确"),[])}e.watch(()=>a.value,async()=>{a.value?s.title="动态":s.title="静态"},{immediate:!0});const v=[{title:"静态"},{title:"动态"}];async function n(l){s.title=l.title,l.title==="静态"&&(a.value="")}async function g(l){const t=d.value.find(m=>m.id===l);if(t&&t.url){let m=await p.axios({method:(t==null?void 0:t.method)||"get",url:t.url,params:t!=null&&t.params?JSON.parse(t==null?void 0:t.params):{},data:t!=null&&t.data?JSON.parse(t==null?void 0:t.data):{},headers:t!=null&&t.header?JSON.parse(t==null?void 0:t.header):{}});if(t&&(t!=null&&t.dataPath)){const x=t.dataPath.split(".").reduce((V,N)=>V[N],m.data);r.value=c(x).map(V=>({label:V[t.dataKey],value:V[t.dataValue]}))}else r.value=c(m.data).map(u=>({label:u[t.dataKey],value:u[t.dataValue]}))}}i.modelValue,e.provide("tree",i.tree);function o(){const l=e.reactive({label:"",value:""});r.value.length?r.value=[...r.value,l]:r.value=[l]}return(l,t)=>{var m;return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",null,[e.createElementVNode("div",I,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,(u,x)=>e.createElementVNode("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:s.title===u.title}]),key:x,title:u.title,onClick:V=>n(u)},e.toDisplayString(u.title),11,q)),64))]),s.title==="静态"?(e.openBlock(),e.createElementBlock("div",w,[e.withDirectives(e.createElementVNode("div",$,"暂无选项",512),[[e.vShow,!((m=e.unref(r))!=null&&m.length)]]),e.createVNode(M,{modelValue:e.unref(r),"onUpdate:modelValue":t[0]||(t[0]=u=>e.isRef(r)?r.value=u:null)},null,8,["modelValue"]),e.createVNode(e.unref(y),{onClick:o},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("添加选项")])),_:1})])):(e.openBlock(),e.createElementBlock("div",j,[t[3]||(t[3]=e.createElementVNode("span",{style:{"font-size":"12px","margin-bottom":"8px",display:"inline-block"}},"数据源",-1)),e.createVNode(e.unref(f),{modelValue:e.unref(a),"onUpdate:modelValue":t[1]||(t[1]=u=>e.isRef(a)?a.value=u:null),placeholder:"请选择数据源",clearable:"",options:d.value,onChange:g},null,8,["modelValue","options"])]))])])}}}),D=S._export_sfc(A,[["__scopeId","data-v-786f8c8a"]]);exports.default=D;
|
|
@@ -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 { q as b } from "./index-
|
|
3
|
+
import { q as b } from "./index-CzIPdR2H.js";
|
|
4
4
|
import { _ as y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const x = /* @__PURE__ */ g({
|
|
6
6
|
__name: "index",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./axios-CYGTE3lR.cjs"),c=require("./index-C3ug5HS-.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,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as b, inject as B, openBlock as t, createElementBlock as s, Fragment as C, renderList as y, unref as n, createCommentVNode as h, createBlock as w, createElementVNode as r, withModifiers as f, toDisplayString as x, ref as g, computed as S, shallowRef as H, createVNode as k, normalizeClass as v, resolveDynamicComponent as R } from "vue";
|
|
2
|
-
import { p as $ } from "./
|
|
2
|
+
import { p as $ } from "./axios-ITY6Uw7A.js";
|
|
3
3
|
import { _ as M } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
4
4
|
const V = { class: "epic-breadcrumb pl-4 py-2 truncate h-40px flex items-center" }, j = {
|
|
5
5
|
key: 0,
|
|
@@ -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-C3ug5HS-.cjs");exports.default=e._sfc_main;
|
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-C3ug5HS-.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,5 +1,5 @@
|
|
|
1
|
-
import { r as s, t, _ as r, E as o, c as n, j as d, m, d as u, o 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, p 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, v as x, x as A, u as N, q, a as z } from "./index-
|
|
2
|
-
import { E as T, P as U, l as V, p as b } from "./
|
|
1
|
+
import { r as s, t, _ as r, E as o, c as n, j as d, m, d as u, o 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, p 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, v as x, x as A, u as N, q, a as z } from "./index-CzIPdR2H.js";
|
|
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,
|
|
5
5
|
t as EDesigner,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("./tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs"),f=require("./axios-CYGTE3lR.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;
|
|
@@ -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 "./
|
|
2
|
+
import { _ as w } from "./tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js";
|
|
3
|
+
import { p as B } from "./axios-ITY6Uw7A.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,6 +1,5 @@
|
|
|
1
1
|
import { watch as R, nextTick as U, ref as n, onMounted as A, onUnmounted as H, openBlock as N, createElementBlock as O, normalizeStyle as E, createElementVNode as i, createVNode as x, unref as b, withCtx as w, createTextVNode as P } from "vue";
|
|
2
|
-
import { p as F } from "./
|
|
3
|
-
import { a as I } from "./axios-CXDYiOMX.js";
|
|
2
|
+
import { p as F, a as I } from "./axios-ITY6Uw7A.js";
|
|
4
3
|
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
4
|
const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
6
5
|
__name: "sign",
|
|
@@ -18,30 +17,30 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
18
17
|
() => a.componentSchema,
|
|
19
18
|
() => {
|
|
20
19
|
U(() => {
|
|
21
|
-
|
|
20
|
+
v();
|
|
22
21
|
});
|
|
23
22
|
},
|
|
24
23
|
{ deep: !0, immediate: !0 }
|
|
25
24
|
);
|
|
26
25
|
const C = new ResizeObserver((t) => {
|
|
27
26
|
for (const e of t)
|
|
28
|
-
e.target && e.target.clientWidth && e.target.clientHeight &&
|
|
27
|
+
e.target && e.target.clientWidth && e.target.clientHeight && v();
|
|
29
28
|
}), l = n(null), s = n(null), o = n(), D = n("");
|
|
30
|
-
function
|
|
29
|
+
function v() {
|
|
31
30
|
var t, e;
|
|
32
31
|
s.value && ((t = s.value) != null && t.clientHeight) && ((e = s.value) != null && e.clientWidth) && (l.value.height = s.value.clientHeight, l.value.width = s.value.clientWidth, o.value = l.value.getContext("2d"), o.value.lineWidth = a.componentSchema.componentProps.lineWidth || 4, a.componentSchema && a.componentSchema.componentProps && a.componentSchema.componentProps.style && a.componentSchema.componentProps.style.color && (o.value.strokeStyle = a.componentSchema.componentProps.style.color), D.value = l.value.getBoundingClientRect());
|
|
33
32
|
}
|
|
34
|
-
const r = n(""), c = n(""), W = n(""), B = n(""), u = n([]),
|
|
33
|
+
const r = n(""), c = n(""), W = n(""), B = n(""), u = n([]), m = n(!1);
|
|
35
34
|
function M(t) {
|
|
36
35
|
t = t || event, t.preventDefault();
|
|
37
36
|
let e = {
|
|
38
37
|
x: t.offsetX,
|
|
39
38
|
y: t.offsetY
|
|
40
39
|
};
|
|
41
|
-
r.value = e.x, c.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),
|
|
40
|
+
r.value = e.x, c.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), m.value = !0;
|
|
42
41
|
}
|
|
43
42
|
function z(t) {
|
|
44
|
-
if (t = t || event, t.preventDefault(),
|
|
43
|
+
if (t = t || event, t.preventDefault(), m.value) {
|
|
45
44
|
let e = {
|
|
46
45
|
x: t.offsetX,
|
|
47
46
|
y: t.offsetY
|
|
@@ -55,7 +54,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
55
54
|
x: t.offsetX,
|
|
56
55
|
y: t.offsetY
|
|
57
56
|
};
|
|
58
|
-
o.value.beginPath(), o.value.moveTo(r.value, c.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 }),
|
|
57
|
+
o.value.beginPath(), o.value.moveTo(r.value, c.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 }), m.value = !1;
|
|
59
58
|
}
|
|
60
59
|
function h() {
|
|
61
60
|
o.value.clearRect(0, 0, l.value.width, l.value.height), u.value = [];
|
|
@@ -79,7 +78,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
79
78
|
})).data.data.url;
|
|
80
79
|
}
|
|
81
80
|
return A(() => {
|
|
82
|
-
|
|
81
|
+
v(), C.observe(s.value);
|
|
83
82
|
}), H(() => {
|
|
84
83
|
}), k({
|
|
85
84
|
surewrite: f
|
|
@@ -132,7 +131,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
|
132
131
|
])
|
|
133
132
|
], 4));
|
|
134
133
|
}
|
|
135
|
-
},
|
|
134
|
+
}, ee = /* @__PURE__ */ q(J, [["__scopeId", "data-v-e972b6e0"]]);
|
|
136
135
|
export {
|
|
137
|
-
|
|
136
|
+
ee as default
|
|
138
137
|
};
|
|
@@ -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:()=>({})}},emits:["update:modelValue"],setup(x,{expose:b,emit:w}){const f=g.pluginManager.getComponent("button"),P=w,a=x;t.watch(()=>a.componentSchema,()=>{t.nextTick(()=>{p()})},{deep:!0,immediate:!0});const S=new ResizeObserver(o=>{for(const e of o)e.target&&e.target.clientWidth&&e.target.clientHeight&&p()}),l=t.ref(null),s=t.ref(null),n=t.ref(),_=t.ref("");function p(){var o,e;s.value&&((o=s.value)!=null&&o.clientHeight)&&((e=s.value)!=null&&e.clientWidth)&&(l.value.height=s.value.clientHeight,l.value.width=s.value.clientWidth,n.value=l.value.getContext("2d"),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 r=t.ref(""),i=t.ref(""),T=t.ref(""),k=t.ref(""),u=t.ref([]),v=t.ref(!1);function V(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};r.value=e.x,i.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 C(o){if(o=o||event,o.preventDefault(),v.value){let e={x:o.offsetX,y:o.offsetY};T.value=e.x,k.value=e.y,n.value.beginPath(),n.value.moveTo(r.value,i.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),r.value=e.x,i.value=e.y,u.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(r.value,i.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 d(){n.value.clearRect(0,0,l.value.width,l.value.height),u.value=[]}async function m(){let o=await D(l.value.toDataURL("image/png"));P("update:modelValue",o)}async function D(o){let e=atob(o.split(",")[1]),h=new ArrayBuffer(e.length),M=new Uint8Array(h);for(let c=0;c<e.length;c++)M[c]=e.charCodeAt(c);let W=new Blob([h],{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(()=>{p(),S.observe(s.value)}),t.onUnmounted(()=>{}),b({surewrite:m}),(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:V,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(f),{type:"info",size:"mini",onClick:d,onTouch:d},{default:t.withCtx(()=>e[0]||(e[0]=[t.createTextVNode("重写")])),_:1}),t.createVNode(t.unref(f),{type:"primary",size:"mini",onClick:m,onTouch:m},{default:t.withCtx(()=>e[1]||(e[1]=[t.createTextVNode("确定")])),_:1})])])],4))}},X=B._export_sfc(z,[["__scopeId","data-v-e972b6e0"]]);exports.default=X;
|