epic-designer-gold 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attributeView-B2dWB_U2.cjs → attributeView-CEFjPemt.cjs} +1 -1
- package/dist/{attributeView-Cu_tjo9A.js → attributeView-C_rnFDGo.js} +3 -3
- package/dist/{axios-B8aFvCWj.cjs → axios-B5oA4AjJ.cjs} +1 -1
- package/dist/{axios-Bb3STC1u.js → axios-awtfJhsA.js} +1 -1
- package/dist/index-AH-Lj15r.js +107 -0
- package/dist/{index-VblxMq6V.js → index-B0rUZfG_.js} +2 -2
- package/dist/{index-CMbBKMQU.js → index-BEMPXyNN.js} +2 -2
- package/dist/{index-BhcwWM1G.cjs → index-BOUKAGKU.cjs} +1 -1
- package/dist/index-B_BKVTct.cjs +1 -0
- package/dist/{index-Bn8pwpgq.cjs → index-Ba8KVYrQ.cjs} +1 -1
- package/dist/{index-D0kQz_zt.js → index-BfdYrl-Q.js} +1 -1
- package/dist/{index-21c4Pe3i.cjs → index-BnLI5N3M.cjs} +1 -1
- package/dist/index-BpROfyMH.cjs +1 -0
- package/dist/index-BxCrqMkz.cjs +1 -0
- package/dist/{index-DeZ09CHf.cjs → index-CBBK4Aze.cjs} +1 -1
- package/dist/index-CDTcUcwY.cjs +1 -0
- package/dist/{index-CgwN4ucQ.js → index-CFZioB1O.js} +2 -2
- package/dist/{index-BLJT8e0Q.js → index-Ce470l1n.js} +4 -4
- package/dist/{index-CHCOxt3B.js → index-CeVV_SOj.js} +3 -3
- package/dist/{index-DxNdcsD-.js → index-CoCyrWM2.js} +124 -120
- package/dist/{index-CYAKMqdR.cjs → index-Cq5wbnmA.cjs} +1 -1
- package/dist/index-D8olMR4m.cjs +10 -0
- package/dist/index-DENcRmIy.js +47 -0
- package/dist/{index-CqeRfqUw.cjs → index-DK4PrvRF.cjs} +1 -1
- package/dist/{index-Dg7MK40D.js → index-DWxy0GSJ.js} +6 -2
- package/dist/{index-DeFAvWuV.cjs → index-DaJuXp0q.cjs} +1 -1
- package/dist/index-DfRZtELz.js +4 -0
- package/dist/{index-Bybwt7-u.js → index-DpF9E6J8.js} +1 -1
- package/dist/{index-DUMEtCCN.cjs → index-J9twEwWw.cjs} +1 -1
- package/dist/{index-CjIIhZdV.js → index-P13z5c0g.js} +3 -3
- package/dist/{index-CEDIwmNK.js → index-cElDeAm2.js} +2 -2
- package/dist/{index-BULuVnVl.js → index-oMkqg9Zb.js} +194 -186
- package/dist/{index-BV9SE7wG.cjs → index-tR-Y01R8.cjs} +1 -1
- package/dist/{index-Bxi3JLms.cjs → index-vzxiD3pz.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/locale/lang/en-US.d.ts +2 -0
- package/dist/locale/lang/zh-cn.d.ts +2 -0
- package/dist/{outline-DxCKINRN.js → outline-DQ8wgGyH.js} +2 -2
- package/dist/{outline-CK-jNomF.cjs → outline-JJ0IbSzs.cjs} +1 -1
- package/dist/sign-BBoshwS_.cjs +1 -0
- package/dist/{sign-B-FCN_7O.js → sign-Dfqcv4Fg.js} +52 -48
- package/dist/style.css +1 -1
- package/dist/{styleView-CRUqDcCl.cjs → styleView-CZEOSq2l.cjs} +1 -1
- package/dist/{styleView-ClMjCfMk.js → styleView-CajgzMOm.js} +3 -3
- package/dist/tree.vue_vue_type_script_setup_true_lang-B-8wkdQS.js +243 -0
- package/dist/tree.vue_vue_type_script_setup_true_lang-BS6Anq-8.cjs +1 -0
- package/dist/ui/elementPlus/index.cjs +1 -1
- package/dist/ui/elementPlus/index.js +4 -4
- package/dist/ui/naiveUi/index.cjs +1 -1
- package/dist/ui/naiveUi/index.js +1 -1
- package/dist/{uploadFile-oB2-NP-v.cjs → uploadFile-BHn9oVA8.cjs} +1 -1
- package/dist/{uploadFile-Bc5Rxk0b.js → uploadFile-D_0_6ghp.js} +1 -1
- package/dist/{uploadImage-CGXm3zNQ.js → uploadImage-4U4YGGfK.js} +1 -1
- package/dist/{uploadImage-CF7fobUP.cjs → uploadImage-B3tV49Mm.cjs} +1 -1
- package/dist/{uploadImage-4tgp3t7X.cjs → uploadImage-C-OyUMFn.cjs} +1 -1
- package/dist/{uploadImage-COCC3pxH.js → uploadImage-Z6Y6KN1R.js} +1 -1
- package/package.json +1 -1
- package/dist/index-B553TaXm.js +0 -44
- package/dist/index-CEvDmc0a.js +0 -104
- package/dist/index-CI3dhGXT.cjs +0 -1
- package/dist/index-Cq6eLpKZ.cjs +0 -1
- package/dist/index-CrV5FaWU.cjs +0 -10
- package/dist/index-DR80h8IU.js +0 -4
- package/dist/index-DddTXMY9.cjs +0 -1
- package/dist/index-DzxQG0o7.cjs +0 -1
- package/dist/sign-Dho4kHTC.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-B9rWLveX.js +0 -242
- package/dist/tree.vue_vue_type_script_setup_true_lang-DDDqMedP.cjs +0 -1
package/dist/index-DzxQG0o7.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./axios-B8aFvCWj.cjs"),h=require("element-plus"),f=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),S=require("./index-Cq6eLpKZ.cjs"),I={class:"e-data-source"},z={class:"icon-numbers"},H={class:"drawer-content"},Q={class:"drawer-content-left"},W=["onClick"],X={class:"source-item-title"},Y=["onClick"],Z={class:"drawer-content-right"},ee={class:"content"},ae={key:0,class:"content-empty"},te={key:1,class:"content-form"},le={class:"form-flex"},re={class:"form-item"},oe={class:"form-item-title"},ne={key:0,class:"form-item-content"},ue={class:"form-item"},de={class:"form-item-title"},se={key:0,class:"form-item-content"},ie={class:"form-item"},ce={class:"form-item-title"},me={key:0,class:"form-item-content"},pe={class:"content-right-btn"},fe=e.defineComponent({__name:"index",emits:["update:modelValue","update:sourceData"],setup(ve,{emit:Ve}){const{t:r}=S.useLocale(),c=u.pluginManager.getComponent("button"),w=u.pluginManager.getComponent("Drawer"),i=u.pluginManager.getComponent("input"),g=u.pluginManager.getComponent("FormItem"),x=u.pluginManager.getComponent("Form"),L=u.pluginManager.getComponent("RadioGroup"),_=u.pluginManager.getComponent("RadioButton");u.pluginManager.getComponent("select"),u.pluginManager.getComponent("switch");const E=e.ref(),B={GET:"#67c23a",POST:"#e6a23c",PUT:"#409eff",DELETE:"#f56c6c"},D=e.ref(0),O=e.reactive({apiName:[{required:!0,message:r("pleaseEnterApiName"),trigger:"blur"}],url:[{required:!0,message:r("pleaseEnterRequestUrl"),trigger:"blur"}],dataKey:[{required:!0,message:r("pleaseEnterLabelKey"),trigger:"blur"}],dataValue:[{required:!0,message:r("pleaseEnterValueKey"),trigger:"blur"}]}),k=e.ref(!1),m=e.ref([]),a=e.ref(),y=[{label:"1",value:"1"}];function U(){k.value=!0}function M(){const l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return l.charAt(Math.floor(Math.random()*l.length))}function T(l){let t="";for(let o=0;o<l;o++)t+=M();return t}function q(){!a.value||a.value.id||!Object.keys(a.value).length?(a.value={id:"",url:"",body:{},bodyList:[],apiName:`${r("dataSource")}_${T(5)}`,method:"get",params:{},paramsList:[],dataKey:"name",headers:{},headerList:[],dataPath:"",dataValue:"id"},m.value.push(a.value)):a.value.id||C()}function J(l){var t;!a.value||a.value.id||!Object.keys(a.value).length?(m.value=JSON.parse(JSON.stringify(u.pluginManager.getSourceData())),((t=a.value)==null?void 0:t.id)===l?a.value={}:(a.value=m.value.find(o=>o.id===l),a.value.paramsList=Object.keys(JSON.parse(a.value.params)).map(o=>({label:o,value:JSON.parse(a.value.params)[o]})),a.value.bodyList=Object.keys(JSON.parse(a.value.body)).map(o=>({label:o,value:JSON.parse(a.value.body)[o]})),a.value.headerList=Object.keys(JSON.parse(a.value.headers)).map(o=>({label:o,value:JSON.parse(a.value.headers)[o]})))):C()}function P(l){l?(u.EventBus.emit("deleteSourceData",l),a.value={}):(m.value=m.value.filter(t=>t.id!==l),a.value={})}function F(){var l;(l=a.value)==null||l.paramsList.push({label:"",value:""})}function K(l){a.value.paramsList.splice(l,1)}function R(){var l;(l=a.value)==null||l.headerList.push({label:"",value:""})}function j(l){a.value.headerList.splice(l,1)}function A(){var l;(l=a.value)==null||l.bodyList.push({label:"",value:""})}function $(l){a.value.bodyList.splice(l,1)}e.onMounted(()=>{m.value=JSON.parse(JSON.stringify(u.pluginManager.getSourceData()))}),u.EventBus.on("updateSource",l=>{m.value=JSON.parse(JSON.stringify(u.pluginManager.getSourceData()))});async function G(){E.value.validate(async l=>{if(l)try{const t={};a.value.paramsList.forEach(d=>{t[d.label]=d.value});const o={};a.value.bodyList.forEach(d=>{o[d.label]=d.value});const v={};a.value.headerList.forEach(d=>{v[d.label]=d.value});let p=await u.axios({method:a.value.method,url:a.value.url,params:t,data:o,headers:{...v,Authorization:"Bearer "+S.api.get("Admin-Token")}});if(a.value.dataPath){const N=a.value.dataPath.split(".").reduce((V,n)=>V[n],p.data);N&&N.length?h.ElMessage({message:N.map(V=>({label:V[a.value.dataKey],value:V[a.value.dataValue]}))}):h.ElMessage.info(r("configError"))}else p.data&&p.data.length?h.ElMessage({message:p.data.map(d=>({label:d[a.value.dataKey],value:d[a.value.dataValue]}))}):h.ElMessage.info(r("configError"))}catch{h.ElMessage.error(r("requestFailed"))}finally{}else h.ElMessage.error(r("fillRequiredFields"))})}async function C(){a.value.body=a.value.bodyList.reduce((l,t)=>(l[t.label]=t.value,l),{}),a.value.params=a.value.paramsList.reduce((l,t)=>(l[t.label]=t.value,l),{}),a.value.headers=a.value.headerList.reduce((l,t)=>(l[t.label]=t.value,l),{}),E.value.validate(l=>{l?a.value.id?(u.EventBus.emit("updateSourceData",{...a.value,body:JSON.stringify(a.value.body),params:JSON.stringify(a.value.params),headers:JSON.stringify(a.value.headers)}),a.value={}):(u.EventBus.emit("saveSourceData",{...a.value,body:JSON.stringify(a.value.body),params:JSON.stringify(a.value.params),headers:JSON.stringify(a.value.headers)}),a.value={}):h.ElMessage.warning(r("completeFormFirst"))})}return(l,t)=>(e.openBlock(),e.createElementBlock("div",I,[e.createVNode(e.unref(c),{class:"btn",onClick:U},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{name:"icon--epic--window-outline",class:"mr-4px"}),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("configuration")),1),e.createElementVNode("span",z,e.toDisplayString(D.value||m.value.length),1)]),_:1}),e.createVNode(e.unref(w),{size:960,modelValue:k.value,"onUpdate:modelValue":t[7]||(t[7]=o=>k.value=o),"append-to-body":"",title:e.unref(r)("dataSources")},{default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createElementVNode("div",Q,[e.createVNode(e.unref(c),{type:"primary",class:"btn",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{name:"icon--epic--add-rounded",class:"mr-4px"}),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("addDataSource")),1)]),_:1}),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,o=>{var v;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["source-item",{active:o.id===((v=a.value)==null?void 0:v.id)}]),key:o.id,onClick:p=>J(o.id)},[e.createElementVNode("div",X,[e.createElementVNode("div",{style:e.normalizeStyle({color:B[o.method.toLocaleUpperCase()]})},e.toDisplayString(o.method.toLocaleUpperCase()),5),e.createElementVNode("div",null,e.toDisplayString(o.apiName),1)]),e.createElementVNode("div",{onClick:p=>P(o.id),class:"source-item-icon"},[e.createVNode(e.unref(f._sfc_main),{name:"icon--epic--delete-outline-rounded"})],8,Y)],10,W)}),128))])]),e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[!a.value||!Object.keys(a.value).length?(e.openBlock(),e.createElementBlock("div",ae,e.toDisplayString(e.unref(r)("pleaseSelectDataSource")),1)):(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(e.unref(x),{ref_key:"ruleFormRef",ref:E,model:a.value,"label-position":"top",rules:O,"label-width":120},{default:e.withCtx(()=>{var o,v,p,d,N,V;return[e.createVNode(e.unref(g),{prop:"apiName",label:e.unref(r)("apiName")},{default:e.withCtx(()=>[e.createVNode(e.unref(i),{clearable:"",modelValue:a.value.apiName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value.apiName=n),placeholder:e.unref(r)("pleaseEnterApiName")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.createVNode(e.unref(g),{prop:"url",label:e.unref(r)("requestUrl")},{default:e.withCtx(()=>[e.createVNode(e.unref(i),{modelValue:a.value.url,"onUpdate:modelValue":t[1]||(t[1]=n=>a.value.url=n),clearable:"",placeholder:e.unref(r)("pleaseEnterRequestUrl")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.createVNode(e.unref(g),{label:e.unref(r)("requestMethod"),required:""},{default:e.withCtx(()=>[e.createVNode(e.unref(L),{modelValue:a.value.method,"onUpdate:modelValue":t[2]||(t[2]=n=>a.value.method=n)},{default:e.withCtx(()=>[e.createVNode(e.unref(_),{label:"GET",value:"get"},{default:e.withCtx(()=>t[8]||(t[8]=[e.createTextVNode("GET")])),_:1}),e.createVNode(e.unref(_),{label:"POST",value:"post"},{default:e.withCtx(()=>t[9]||(t[9]=[e.createTextVNode("POST")])),_:1}),e.createVNode(e.unref(_),{label:"PUT",value:"put"},{default:e.withCtx(()=>t[10]||(t[10]=[e.createTextVNode("PUT")])),_:1}),e.createVNode(e.unref(_),{label:"DELETE",value:"delete"},{default:e.withCtx(()=>t[11]||(t[11]=[e.createTextVNode("DELETE")])),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),e.createElementVNode("div",le,[e.createVNode(e.unref(g),{prop:"dataKey",style:{width:"30%"},label:e.unref(r)("labelKey")},{default:e.withCtx(()=>[e.createVNode(e.unref(i),{modelValue:a.value.dataKey,"onUpdate:modelValue":t[3]||(t[3]=n=>a.value.dataKey=n),clearable:"",placeholder:e.unref(r)("pleaseEnterLabelKey")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.createVNode(e.unref(g),{prop:"dataValue",style:{width:"30%"},label:e.unref(r)("valueKey")},{default:e.withCtx(()=>[e.createVNode(e.unref(i),{modelValue:a.value.dataValue,"onUpdate:modelValue":t[4]||(t[4]=n=>a.value.dataValue=n),clearable:"",placeholder:e.unref(r)("pleaseEnterValueKey")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.createVNode(e.unref(g),{style:{width:"33%"},label:e.unref(r)("dataPath")},{default:e.withCtx(()=>[e.createVNode(e.unref(i),{modelValue:a.value.dataPath,"onUpdate:modelValue":t[5]||(t[5]=n=>a.value.dataPath=n),clearable:"",placeholder:e.unref(r)("nestedPath")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),e.createElementVNode("div",re,[e.createElementVNode("div",oe,[e.createElementVNode("div",null,e.toDisplayString(e.unref(r)("requestParams")),1),e.createVNode(e.unref(c),{onClick:F,text:"",type:"primary",class:"btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{name:"icon--epic--add-rounded"}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("add")),1)]),_:1})]),(o=a.value)!=null&&o.paramsList&&((v=a.value)!=null&&v.paramsList.length)?(e.openBlock(),e.createElementBlock("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.paramsList,(n,b)=>(e.openBlock(),e.createElementBlock("div",{class:"content-item",key:n.value},[e.createVNode(e.unref(i),{modelValue:n.label,"onUpdate:modelValue":s=>n.label=s,filterable:"","allow-create":"",style:{width:"42%"},options:y,placeholder:e.unref(r)("paramName")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(e.unref(i),{modelValue:n.value,"onUpdate:modelValue":s=>n.value=s,filterable:"","allow-create":"",style:{width:"42%"},options:y,placeholder:e.unref(r)("paramValue")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(e.unref(c),{onClick:s=>K(b),type:"danger",circle:""},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{style:{color:"#fff"},name:"icon--epic--delete-outline-rounded"})]),_:2},1032,["onClick"])]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ue,[e.createElementVNode("div",de,[e.createElementVNode("div",null,e.toDisplayString(e.unref(r)("requestHeaders")),1),e.createVNode(e.unref(c),{onClick:R,text:"",type:"primary",class:"btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{name:"icon--epic--add-rounded"}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("add")),1)]),_:1})]),(p=a.value)!=null&&p.headerList&&((d=a.value)!=null&&d.headerList.length)?(e.openBlock(),e.createElementBlock("div",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.headerList,(n,b)=>(e.openBlock(),e.createElementBlock("div",{class:"content-item",key:b},[e.createVNode(e.unref(i),{modelValue:n.label,"onUpdate:modelValue":s=>n.label=s,filterable:"","allow-create":"",style:{width:"42%"},options:y,placeholder:e.unref(r)("paramName")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(e.unref(i),{modelValue:n.value,"onUpdate:modelValue":s=>n.value=s,filterable:"","allow-create":"",style:{width:"42%"},options:y,placeholder:e.unref(r)("paramValue")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(e.unref(c),{onClick:s=>j(b),type:"danger",circle:""},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{style:{color:"#fff"},name:"icon--epic--delete-outline-rounded"})]),_:2},1032,["onClick"])]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ie,[e.createElementVNode("div",ce,[e.createElementVNode("div",null,e.toDisplayString(e.unref(r)("requestBody")),1),e.createVNode(e.unref(c),{onClick:A,text:"",type:"primary",class:"btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{name:"icon--epic--add-rounded"}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("add")),1)]),_:1})]),(N=a.value)!=null&&N.bodyList&&((V=a.value)!=null&&V.bodyList.length)?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.bodyList,(n,b)=>(e.openBlock(),e.createElementBlock("div",{class:"content-item",key:b},[e.createVNode(e.unref(i),{modelValue:n.label,"onUpdate:modelValue":s=>n.label=s,filterable:"","allow-create":"",style:{width:"42%"},options:y,placeholder:e.unref(r)("paramName")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(e.unref(i),{modelValue:n.value,"onUpdate:modelValue":s=>n.value=s,filterable:"","allow-create":"",style:{width:"42%"},options:y,placeholder:e.unref(r)("paramValue")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),e.createVNode(e.unref(c),{onClick:t[6]||(t[6]=s=>$(l.i)),type:"danger",circle:""},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{style:{color:"#fff"},name:"icon--epic--delete-outline-rounded"})]),_:1})]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",pe,[e.createVNode(e.unref(c),{type:"info",onClick:G},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("requestTest")),1)]),_:1}),e.createVNode(e.unref(c),{type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("save")),1)]),_:1})])]}),_:1},8,["model","rules"])]))])])])]),_:1},8,["modelValue","title"])]))}});exports.default=fe;
|
package/dist/sign-Dho4kHTC.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("./axios-B8aFvCWj.cjs"),p=require("element-plus"),k=require("./index-Cq6eLpKZ.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,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-Bb3STC1u.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
|
-
};
|
|
@@ -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-B8aFvCWj.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;
|