epic-designer-gold 1.0.4 → 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-DEg9mFCt.cjs → attributeView-CEFjPemt.cjs} +1 -1
- package/dist/{attributeView-CPrGnVQ8.js → attributeView-C_rnFDGo.js} +3 -3
- package/dist/{axios-BAhOY32t.cjs → axios-B5oA4AjJ.cjs} +1 -1
- package/dist/{axios-BFVeUxau.js → axios-awtfJhsA.js} +1 -1
- package/dist/index-AH-Lj15r.js +107 -0
- package/dist/{index-Cwgv4MbW.js → index-B0rUZfG_.js} +2 -2
- package/dist/{index-Bsv8EECz.js → index-BEMPXyNN.js} +2 -2
- package/dist/{index-BEXliJtJ.cjs → index-BOUKAGKU.cjs} +1 -1
- package/dist/index-B_BKVTct.cjs +1 -0
- package/dist/{index-ykB9CsYG.cjs → index-Ba8KVYrQ.cjs} +1 -1
- package/dist/{index-BiXYEiWV.js → index-BfdYrl-Q.js} +1 -1
- package/dist/{index-C5-ZZLug.cjs → index-BnLI5N3M.cjs} +1 -1
- package/dist/index-BpROfyMH.cjs +1 -0
- package/dist/index-BxCrqMkz.cjs +1 -0
- package/dist/{index-B8V7odtp.cjs → index-CBBK4Aze.cjs} +1 -1
- package/dist/index-CDTcUcwY.cjs +1 -0
- package/dist/{index-D7z34DMU.js → index-CFZioB1O.js} +2 -2
- package/dist/{index-Dru9G2MF.js → index-Ce470l1n.js} +4 -4
- package/dist/{index-dUOJH8fj.js → index-CeVV_SOj.js} +3 -3
- package/dist/{index-C6C5D9M8.js → index-CoCyrWM2.js} +124 -120
- package/dist/{index-KGGnmoAO.cjs → index-Cq5wbnmA.cjs} +1 -1
- package/dist/index-D8olMR4m.cjs +10 -0
- package/dist/index-DENcRmIy.js +47 -0
- package/dist/{index-D3Uft3bJ.cjs → index-DK4PrvRF.cjs} +1 -1
- package/dist/{index-DO5DuUPL.js → index-DWxy0GSJ.js} +7 -3
- package/dist/{index-g1W7IHK_.cjs → index-DaJuXp0q.cjs} +1 -1
- package/dist/index-DfRZtELz.js +4 -0
- package/dist/{index-BstMY1Nn.js → index-DpF9E6J8.js} +1 -1
- package/dist/{index-dcjty1Ho.cjs → index-J9twEwWw.cjs} +1 -1
- package/dist/{index-BoVrWUpL.js → index-P13z5c0g.js} +3 -3
- package/dist/{index-BPmq8lmK.js → index-cElDeAm2.js} +2 -2
- package/dist/{index-CIwV58Ko.js → index-oMkqg9Zb.js} +194 -186
- package/dist/{index-CtkdvWFN.cjs → index-tR-Y01R8.cjs} +1 -1
- package/dist/{index-C2Sx6r6b.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-CG-aHThT.js → outline-DQ8wgGyH.js} +2 -2
- package/dist/{outline-Coy4TGIa.cjs → outline-JJ0IbSzs.cjs} +1 -1
- package/dist/sign-BBoshwS_.cjs +1 -0
- package/dist/{sign-C0z0Ygs4.js → sign-Dfqcv4Fg.js} +52 -48
- package/dist/style.css +1 -1
- package/dist/{styleView-D0W-N4vW.cjs → styleView-CZEOSq2l.cjs} +1 -1
- package/dist/{styleView-CkbdwQhA.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-CmKFRZMw.cjs → uploadFile-BHn9oVA8.cjs} +1 -1
- package/dist/{uploadFile-Bh5GyGFd.js → uploadFile-D_0_6ghp.js} +1 -1
- package/dist/{uploadImage-CbVsUivh.js → uploadImage-4U4YGGfK.js} +1 -1
- package/dist/{uploadImage-CcMA6CyX.cjs → uploadImage-B3tV49Mm.cjs} +1 -1
- package/dist/{uploadImage-DENhzttU.cjs → uploadImage-C-OyUMFn.cjs} +1 -1
- package/dist/{uploadImage-qHq6JX83.js → uploadImage-Z6Y6KN1R.js} +1 -1
- package/package.json +1 -1
- package/dist/index-BN_dXDiO.cjs +0 -1
- package/dist/index-BPRzjSrH.cjs +0 -10
- package/dist/index-BY9j66Gp.js +0 -4
- package/dist/index-CgisEnmm.cjs +0 -1
- package/dist/index-DAhVvQNH.cjs +0 -1
- package/dist/index-DddOVmF6.cjs +0 -1
- package/dist/index-DdsHIglg.js +0 -104
- package/dist/index-Sin3ac_7.js +0 -44
- package/dist/sign-BlMhTkWG.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-KKt_Qgqv.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-RWHCYpkY.js +0 -242
package/dist/index-Sin3ac_7.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { defineComponent as d, computed as p, ref as _, shallowRef as m, openBlock as i, createElementBlock as s, createElementVNode as t, Fragment as f, renderList as h, normalizeClass as u, createVNode as k, unref as C, toDisplayString as b, createBlock as y, resolveDynamicComponent as B } from "vue";
|
|
2
|
-
import { p as g } from "./axios-BFVeUxau.js";
|
|
3
|
-
import { _ as x } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
4
|
-
const E = { class: "flex relative" }, w = { class: "epic-action-bar" }, D = { class: "epic-actions-container" }, N = ["title", "onClick"], V = { class: "text-14px" }, $ = { class: "epic-sidebar-container" }, M = /* @__PURE__ */ d({
|
|
5
|
-
name: "EActivityBar",
|
|
6
|
-
__name: "index",
|
|
7
|
-
setup(z) {
|
|
8
|
-
const r = p(() => g.viewsContainers.activitybars.value.filter((a) => a.visible)), e = _(0), l = m(null);
|
|
9
|
-
l.value = r.value[0].component;
|
|
10
|
-
function v(a, c) {
|
|
11
|
-
if (e.value === c)
|
|
12
|
-
return e.value = null, !1;
|
|
13
|
-
l.value = a.component, e.value = c;
|
|
14
|
-
}
|
|
15
|
-
return (a, c) => (i(), s("div", E, [
|
|
16
|
-
t("div", w, [
|
|
17
|
-
t("ul", D, [
|
|
18
|
-
(i(!0), s(f, null, h(r.value, (n, o) => (i(), s("li", {
|
|
19
|
-
key: o,
|
|
20
|
-
class: u(["epic-action-item", { checked: e.value === o }]),
|
|
21
|
-
title: n.title,
|
|
22
|
-
onClick: (A) => v(n, o)
|
|
23
|
-
}, [
|
|
24
|
-
k(C(x), {
|
|
25
|
-
class: "relative",
|
|
26
|
-
name: n.icon
|
|
27
|
-
}, null, 8, ["name"]),
|
|
28
|
-
t("div", V, b(n.title), 1)
|
|
29
|
-
], 10, N))), 128))
|
|
30
|
-
])
|
|
31
|
-
]),
|
|
32
|
-
t("div", {
|
|
33
|
-
class: u(["epic-left-sidebar", { hide: e.value === null }])
|
|
34
|
-
}, [
|
|
35
|
-
t("div", $, [
|
|
36
|
-
(i(), y(B(l.value)))
|
|
37
|
-
])
|
|
38
|
-
], 2)
|
|
39
|
-
]));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
export {
|
|
43
|
-
M as default
|
|
44
|
-
};
|
package/dist/sign-BlMhTkWG.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("./axios-BAhOY32t.cjs"),p=require("element-plus"),k=require("./index-DddOVmF6.cjs"),I=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),z={class:"sign-main"},F=["src"],H={class:"sign",style:{height:"100%",width:"100%"}},O=["id"],L={class:"btn"},$={class:"btns"},G={__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}=k.useLocale(),S=w.pluginManager.getComponent("button"),E=w.pluginManager.getComponent("Dialog"),D=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(){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 U(s.value.toDataURL("image/png"));h.value=n,D("update:modelValue",n)}async function U(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"}),V=new FormData;V.append("file",m,Date.now()+"png");let Y=await w.axios({method:"post",url:"https://ess-ds.com/prod-api/center-file/file/upload",data:V,headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+k.api.get("Admin-Token")}});return p.ElMessage({type:"success",message:l("uploadSuccess")}),Y.data.data.url}catch{p.ElMessage({type:"warning",message:l("uploadFailed")}),r.value=!1}finally{r.value=!1}}const r=e.ref(!1);function X(){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 _(){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",z,[h.value?(e.openBlock(),e.createElementBlock("img",{key:1,class:"sign-board",src:h.value,alt:"",onClick:_},null,8,F)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"sign-board",onClick:_},e.toDisplayString(e.unref(l)("signaturePad")),1)),e.createVNode(e.unref(E),{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":X,draggable:!1,modal:""},{default:e.withCtx(()=>[e.createElementVNode("div",H,[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,O)],512),e.createElementVNode("div",L,[t[1]||(t[1]=e.createElementVNode("div",{class:"remark"},null,-1)),e.createElementVNode("div",$,[e.createVNode(e.unref(S),{type:"info",size:"mini",onClick:P,onTouch:P},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("rewrite")),1)]),_:1}),e.createVNode(e.unref(S),{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"])]))}},J=I._export_sfc(G,[["__scopeId","data-v-b0e855ca"]]);exports.default=J;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),C=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),k=require("./axios-BAhOY32t.cjs"),S=require("./vuedraggable.umd-BqhSJIAi.cjs"),_=e.defineComponent({name:"ETreeNodeItem",__name:"treeNodeItem",props:{schema:{}},setup(x){const a=x,u=e.inject("slots",{}),m=e.inject("pageSchema",{}),c=e.inject("expandedKeys"),v=e.inject("treeProps"),h=e.inject("selectedKeys"),i=e.inject("handleSelect"),g=e.computed(()=>c.value.includes(a.schema.id??"")),f=e.defineComponent({setup(){return()=>{var n;return e.h("span",{class:{text:!0,hover:v.hoverKey===a.schema.id,checked:h.value.includes(a.schema.id)},onClick:()=>i(a.schema.id,a.schema)},((n=u["tree-node"])==null?void 0:n.call(u,a))??e.h("span",{class:"epic-text-padding flex"},{default:()=>{var t;return[e.h("span",{class:"max-w-full truncate"},a.schema.label??((t=k.pluginManager.getComponentConfingByType(a.schema.type))==null?void 0:t.defaultSchema.label)),e.h("span",{class:"epic-node-type-text flex-1 w-0 truncate"},a.schema.id)]}}))}}});function o(){const n=a.schema.id;if(!n)return!1;c.value.includes(n)?c.value=c.value.filter(t=>t!==n):c.value.push(n)}function r(){var t;const n=a.schema.id;if(!n||!((t=a.schema.children)!=null&&t.length))return!1;c.value.push(n)}return r(),(n,t)=>{var l,d,p,s,y;return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["epic-tree-node",{expanded:(l=a.schema.children)==null?void 0:l.length,"level-1":a.schema.id===((d=e.unref(m).schemas[0])==null?void 0:d.id)}])},[e.createElementVNode("a",null,[(p=a.schema.children)!=null&&p.length&&a.schema.id!==((s=e.unref(m).schemas[0])==null?void 0:s.id)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["icon-expanded",{expanded:g.value}]),onClick:o},[e.createVNode(e.unref(C._sfc_main),{name:"icon--epic--caret-right-outlined"})],2)):e.createCommentVNode("",!0),e.createVNode(e.unref(f))]),(y=a.schema.children)!=null&&y.length?(e.openBlock(),e.createBlock(B,{key:0,class:e.normalizeClass(["epic-tree-sublist",{expanded:g.value}]),schemas:a.schema.children,"onUpdate:schemas":t[0]||(t[0]=b=>a.schema.children=b),parentSchema:a.schema},null,8,["class","schemas","parentSchema"])):e.createCommentVNode("",!0)],2)}}}),N={key:1},B=e.defineComponent({name:"ETreeNodes",__name:"treeNodes",props:{schemas:{},parentSchema:{}},emits:["update:schemas"],setup(x,{emit:a}){const u=e.inject("designer"),m=e.inject("pageSchema"),c=e.inject("treeProps"),v=x,h=a,i=e.computed({get(){return v.schemas},set(o){h("update:schemas",o)}});function g(o){u.setDisableHover(!0),u.setCheckedNode(i.value[o])}function f(o){var r,n,t;return o.id===((r=m.schemas[0])==null?void 0:r.id)||(t=(n=k.pluginManager.getComponentConfingByType(o.type))==null?void 0:n.editConstraints)!=null&&t.immovable?"unmover-item":"draggable-item"}return(o,r)=>{var n,t,l,d,p;return(l=(t=e.unref(k.pluginManager).getComponentConfingByType(((n=v.parentSchema)==null?void 0:n.type)||""))==null?void 0:t.editConstraints)!=null&&l.childImmovable?(e.openBlock(),e.createElementBlock("ul",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,s=>(e.openBlock(),e.createBlock(_,{key:s.id,schema:s},null,8,["schema"]))),128))])):(e.openBlock(),e.createBlock(e.unref(S.draggable),e.mergeProps({key:0,modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=s=>i.value=s),"item-key":"id","component-data":{},class:"epic-draggable-range"},{animation:200,tag:"ul",group:"tree-draggable",ghostClass:"moveing",draggable:".draggable-item",disabled:!e.unref(c).draggable||((d=i.value[0])==null?void 0:d.id)===((p=e.unref(m).schemas[0])==null?void 0:p.id)},{onStart:r[1]||(r[1]=s=>g(s.oldIndex))}),{item:e.withCtx(({element:s,index:y})=>[(e.openBlock(),e.createBlock(_,{class:e.normalizeClass(f(s)),key:s.id,schema:s},null,8,["class","schema"]))]),_:1},16,["modelValue"]))}}}),V={class:"epic-tree h-full flex flex-col"},E={class:"epic-search-box px-10px py-6px"},K={class:"epic-tree-main flex-1 overflow-auto h-0"},T={class:"text-center pt-42px text-gray-400"},j=e.defineComponent({name:"ETree",__name:"tree",props:{options:{type:Array,default:()=>[]},hoverKey:{type:String,default:""},selectedKeys:{type:Array,default:()=>[]},draggable:{type:Boolean,default:!1}},emits:["update:selectedKeys","nodeClick"],setup(x,{emit:a}){const u=e.useSlots();e.provide("slots",u);const m=k.pluginManager.getComponent("input"),c=e.ref(""),v=e.ref([]),h=x,i=a,g=e.computed({get(){return h.selectedKeys},set(n){i("update:selectedKeys",n)}}),f=e.computed({get(){return o(h.options,c.value)},set(n){console.log(n)}});function o(n,t){const l=[];return n.forEach(d=>{var p;if((p=d.label)!=null&&p.includes(t))l.push(d);else if(d.children){const s=o(d.children,t);if(s.length>0){const y={...d};y.children=s,l.push(y)}}}),l}function r(n,t){g.value=[n],i("nodeClick",{id:n,componentSchema:t})}return e.provide("expandedKeys",v),e.provide("selectedKeys",g),e.provide("treeProps",h),e.provide("handleSelect",r),(n,t)=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",E,[e.createVNode(e.unref(m),{placeholder:"搜索节点",clearable:"",allowClear:"",modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=l=>c.value=l),value:c.value,"onUpdate:value":t[1]||(t[1]=l=>c.value=l)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(C._sfc_main),{name:"icon--epic--search-rounded"})]),_:1},8,["modelValue","value"])]),e.createElementVNode("div",K,[e.createElementVNode("ul",null,[e.createVNode(B,{schemas:f.value,"onUpdate:schemas":t[2]||(t[2]=l=>f.value=l)},null,8,["schemas"])]),e.withDirectives(e.createElementVNode("div",T,"没有查询到的数据",512),[[e.vShow,!f.value.length]])])]))}});exports._sfc_main=j;
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { defineComponent as w, inject as p, computed as B, h as T, openBlock as u, createElementBlock as K, normalizeClass as N, unref as i, createElementVNode as S, createVNode as k, createCommentVNode as I, createBlock as V, mergeProps as j, withCtx as D, Fragment as z, renderList as H, useSlots as M, provide as b, ref as P, withDirectives as q, vShow as F } from "vue";
|
|
2
|
-
import { _ as $ } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
3
|
-
import { p as E } from "./axios-BFVeUxau.js";
|
|
4
|
-
import { d as G } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
5
|
-
const U = /* @__PURE__ */ w({
|
|
6
|
-
name: "ETreeNodeItem",
|
|
7
|
-
__name: "treeNodeItem",
|
|
8
|
-
props: {
|
|
9
|
-
schema: {}
|
|
10
|
-
},
|
|
11
|
-
setup(_) {
|
|
12
|
-
const s = _, m = p("slots", {}), g = p("pageSchema", {}), l = p("expandedKeys"), x = p("treeProps"), f = p("selectedKeys"), d = p("handleSelect"), v = B(() => l.value.includes(s.schema.id ?? "")), y = w({
|
|
13
|
-
setup() {
|
|
14
|
-
return () => {
|
|
15
|
-
var t;
|
|
16
|
-
return T(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
class: {
|
|
20
|
-
text: !0,
|
|
21
|
-
hover: x.hoverKey === s.schema.id,
|
|
22
|
-
checked: f.value.includes(s.schema.id)
|
|
23
|
-
},
|
|
24
|
-
onClick: () => d(s.schema.id, s.schema)
|
|
25
|
-
},
|
|
26
|
-
((t = m["tree-node"]) == null ? void 0 : t.call(m, s)) ?? T(
|
|
27
|
-
"span",
|
|
28
|
-
{ class: "epic-text-padding flex" },
|
|
29
|
-
{
|
|
30
|
-
default: () => {
|
|
31
|
-
var e;
|
|
32
|
-
return [
|
|
33
|
-
T(
|
|
34
|
-
"span",
|
|
35
|
-
{ class: "max-w-full truncate" },
|
|
36
|
-
s.schema.label ?? ((e = E.getComponentConfingByType(s.schema.type)) == null ? void 0 : e.defaultSchema.label)
|
|
37
|
-
),
|
|
38
|
-
T(
|
|
39
|
-
"span",
|
|
40
|
-
{ class: "epic-node-type-text flex-1 w-0 truncate" },
|
|
41
|
-
s.schema.id
|
|
42
|
-
)
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
function c() {
|
|
52
|
-
const t = s.schema.id;
|
|
53
|
-
if (!t)
|
|
54
|
-
return !1;
|
|
55
|
-
l.value.includes(t) ? l.value = l.value.filter((e) => e !== t) : l.value.push(t);
|
|
56
|
-
}
|
|
57
|
-
function o() {
|
|
58
|
-
var e;
|
|
59
|
-
const t = s.schema.id;
|
|
60
|
-
if (!t || !((e = s.schema.children) != null && e.length))
|
|
61
|
-
return !1;
|
|
62
|
-
l.value.push(t);
|
|
63
|
-
}
|
|
64
|
-
return o(), (t, e) => {
|
|
65
|
-
var n, r, h, a, C;
|
|
66
|
-
return u(), K("li", {
|
|
67
|
-
class: N(["epic-tree-node", {
|
|
68
|
-
expanded: (n = s.schema.children) == null ? void 0 : n.length,
|
|
69
|
-
"level-1": s.schema.id === ((r = i(g).schemas[0]) == null ? void 0 : r.id)
|
|
70
|
-
}])
|
|
71
|
-
}, [
|
|
72
|
-
S("a", null, [
|
|
73
|
-
(h = s.schema.children) != null && h.length && s.schema.id !== ((a = i(g).schemas[0]) == null ? void 0 : a.id) ? (u(), K("span", {
|
|
74
|
-
key: 0,
|
|
75
|
-
class: N(["icon-expanded", { expanded: v.value }]),
|
|
76
|
-
onClick: c
|
|
77
|
-
}, [
|
|
78
|
-
k(i($), { name: "icon--epic--caret-right-outlined" })
|
|
79
|
-
], 2)) : I("", !0),
|
|
80
|
-
k(i(y))
|
|
81
|
-
]),
|
|
82
|
-
(C = s.schema.children) != null && C.length ? (u(), V(A, {
|
|
83
|
-
key: 0,
|
|
84
|
-
class: N(["epic-tree-sublist", { expanded: v.value }]),
|
|
85
|
-
schemas: s.schema.children,
|
|
86
|
-
"onUpdate:schemas": e[0] || (e[0] = (L) => s.schema.children = L),
|
|
87
|
-
parentSchema: s.schema
|
|
88
|
-
}, null, 8, ["class", "schemas", "parentSchema"])) : I("", !0)
|
|
89
|
-
], 2);
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}), J = { key: 1 }, A = /* @__PURE__ */ w({
|
|
93
|
-
name: "ETreeNodes",
|
|
94
|
-
__name: "treeNodes",
|
|
95
|
-
props: {
|
|
96
|
-
schemas: {},
|
|
97
|
-
parentSchema: {}
|
|
98
|
-
},
|
|
99
|
-
emits: ["update:schemas"],
|
|
100
|
-
setup(_, { emit: s }) {
|
|
101
|
-
const m = p("designer"), g = p("pageSchema"), l = p("treeProps"), x = _, f = s, d = B({
|
|
102
|
-
get() {
|
|
103
|
-
return x.schemas;
|
|
104
|
-
},
|
|
105
|
-
set(c) {
|
|
106
|
-
f("update:schemas", c);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
function v(c) {
|
|
110
|
-
m.setDisableHover(!0), m.setCheckedNode(d.value[c]);
|
|
111
|
-
}
|
|
112
|
-
function y(c) {
|
|
113
|
-
var o, t, e;
|
|
114
|
-
return c.id === ((o = g.schemas[0]) == null ? void 0 : o.id) || (e = (t = E.getComponentConfingByType(c.type)) == null ? void 0 : t.editConstraints) != null && e.immovable ? "unmover-item" : "draggable-item";
|
|
115
|
-
}
|
|
116
|
-
return (c, o) => {
|
|
117
|
-
var t, e, n, r, h;
|
|
118
|
-
return (n = (e = i(E).getComponentConfingByType(((t = x.parentSchema) == null ? void 0 : t.type) || "")) == null ? void 0 : e.editConstraints) != null && n.childImmovable ? (u(), K("ul", J, [
|
|
119
|
-
(u(!0), K(z, null, H(d.value, (a) => (u(), V(U, {
|
|
120
|
-
key: a.id,
|
|
121
|
-
schema: a
|
|
122
|
-
}, null, 8, ["schema"]))), 128))
|
|
123
|
-
])) : (u(), V(i(G), j({
|
|
124
|
-
key: 0,
|
|
125
|
-
modelValue: d.value,
|
|
126
|
-
"onUpdate:modelValue": o[0] || (o[0] = (a) => d.value = a),
|
|
127
|
-
"item-key": "id",
|
|
128
|
-
"component-data": {},
|
|
129
|
-
class: "epic-draggable-range"
|
|
130
|
-
}, {
|
|
131
|
-
animation: 200,
|
|
132
|
-
tag: "ul",
|
|
133
|
-
group: "tree-draggable",
|
|
134
|
-
ghostClass: "moveing",
|
|
135
|
-
draggable: ".draggable-item",
|
|
136
|
-
disabled: !i(l).draggable || ((r = d.value[0]) == null ? void 0 : r.id) === ((h = i(g).schemas[0]) == null ? void 0 : h.id)
|
|
137
|
-
}, {
|
|
138
|
-
onStart: o[1] || (o[1] = (a) => v(a.oldIndex))
|
|
139
|
-
}), {
|
|
140
|
-
item: D(({ element: a, index: C }) => [
|
|
141
|
-
(u(), V(U, {
|
|
142
|
-
class: N(y(a)),
|
|
143
|
-
key: a.id,
|
|
144
|
-
schema: a
|
|
145
|
-
}, null, 8, ["class", "schema"]))
|
|
146
|
-
]),
|
|
147
|
-
_: 1
|
|
148
|
-
}, 16, ["modelValue"]));
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
}), O = { class: "epic-tree h-full flex flex-col" }, Q = { class: "epic-search-box px-10px py-6px" }, R = { class: "epic-tree-main flex-1 overflow-auto h-0" }, W = { class: "text-center pt-42px text-gray-400" }, te = /* @__PURE__ */ w({
|
|
152
|
-
name: "ETree",
|
|
153
|
-
__name: "tree",
|
|
154
|
-
props: {
|
|
155
|
-
options: {
|
|
156
|
-
type: Array,
|
|
157
|
-
default: () => []
|
|
158
|
-
},
|
|
159
|
-
hoverKey: {
|
|
160
|
-
type: String,
|
|
161
|
-
default: ""
|
|
162
|
-
},
|
|
163
|
-
selectedKeys: {
|
|
164
|
-
type: Array,
|
|
165
|
-
default: () => []
|
|
166
|
-
},
|
|
167
|
-
draggable: {
|
|
168
|
-
type: Boolean,
|
|
169
|
-
default: !1
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
emits: ["update:selectedKeys", "nodeClick"],
|
|
173
|
-
setup(_, { emit: s }) {
|
|
174
|
-
const m = M();
|
|
175
|
-
b("slots", m);
|
|
176
|
-
const g = E.getComponent("input"), l = P(""), x = P([]), f = _, d = s, v = B({
|
|
177
|
-
get() {
|
|
178
|
-
return f.selectedKeys;
|
|
179
|
-
},
|
|
180
|
-
set(t) {
|
|
181
|
-
d("update:selectedKeys", t);
|
|
182
|
-
}
|
|
183
|
-
}), y = B({
|
|
184
|
-
get() {
|
|
185
|
-
return c(f.options, l.value);
|
|
186
|
-
},
|
|
187
|
-
set(t) {
|
|
188
|
-
console.log(t);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
function c(t, e) {
|
|
192
|
-
const n = [];
|
|
193
|
-
return t.forEach((r) => {
|
|
194
|
-
var h;
|
|
195
|
-
if ((h = r.label) != null && h.includes(e))
|
|
196
|
-
n.push(r);
|
|
197
|
-
else if (r.children) {
|
|
198
|
-
const a = c(r.children, e);
|
|
199
|
-
if (a.length > 0) {
|
|
200
|
-
const C = { ...r };
|
|
201
|
-
C.children = a, n.push(C);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}), n;
|
|
205
|
-
}
|
|
206
|
-
function o(t, e) {
|
|
207
|
-
v.value = [t], d("nodeClick", { id: t, componentSchema: e });
|
|
208
|
-
}
|
|
209
|
-
return b("expandedKeys", x), b("selectedKeys", v), b("treeProps", f), b("handleSelect", o), (t, e) => (u(), K("div", O, [
|
|
210
|
-
S("div", Q, [
|
|
211
|
-
k(i(g), {
|
|
212
|
-
placeholder: "搜索节点",
|
|
213
|
-
clearable: "",
|
|
214
|
-
allowClear: "",
|
|
215
|
-
modelValue: l.value,
|
|
216
|
-
"onUpdate:modelValue": e[0] || (e[0] = (n) => l.value = n),
|
|
217
|
-
value: l.value,
|
|
218
|
-
"onUpdate:value": e[1] || (e[1] = (n) => l.value = n)
|
|
219
|
-
}, {
|
|
220
|
-
prefix: D(() => [
|
|
221
|
-
k(i($), { name: "icon--epic--search-rounded" })
|
|
222
|
-
]),
|
|
223
|
-
_: 1
|
|
224
|
-
}, 8, ["modelValue", "value"])
|
|
225
|
-
]),
|
|
226
|
-
S("div", R, [
|
|
227
|
-
S("ul", null, [
|
|
228
|
-
k(A, {
|
|
229
|
-
schemas: y.value,
|
|
230
|
-
"onUpdate:schemas": e[2] || (e[2] = (n) => y.value = n)
|
|
231
|
-
}, null, 8, ["schemas"])
|
|
232
|
-
]),
|
|
233
|
-
q(S("div", W, "没有查询到的数据", 512), [
|
|
234
|
-
[F, !y.value.length]
|
|
235
|
-
])
|
|
236
|
-
])
|
|
237
|
-
]));
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
export {
|
|
241
|
-
te as _
|
|
242
|
-
};
|