epic-designer-gold 0.0.9 → 0.0.11

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.
Files changed (35) hide show
  1. package/dist/{attributeView-D6GDDwJd.cjs → attributeView-DQTbBkx6.cjs} +1 -1
  2. package/dist/{attributeView-C5p72pi9.js → attributeView-d51qwAGc.js} +1 -1
  3. package/dist/{eventView-C-nPJeal.cjs → eventView-BaDIF66_.cjs} +1 -1
  4. package/dist/{eventView-B1SO_b3U.js → eventView-BxTwk3Gb.js} +1 -1
  5. package/dist/{index-Bvq0Bx84.js → index-8M1sB_Qf.js} +1 -1
  6. package/dist/{index-8Z_BUSpi.cjs → index-B1j0JJjX.cjs} +1 -1
  7. package/dist/{index-D0g3u-k9.js → index-B2lbc5lj.js} +9 -9
  8. package/dist/{index-CW5-2m8M.cjs → index-B5EYlO1t.cjs} +1 -1
  9. package/dist/{index-Dd4gCjAw.js → index-B8PVsPu_.js} +79 -73
  10. package/dist/{index-B4QCUzmC.cjs → index-BCgW7lAq.cjs} +1 -1
  11. package/dist/{index-CtG-fCHj.cjs → index-BhKBVm6E.cjs} +1 -1
  12. package/dist/{index-FHuEonxg.js → index-BtZq-ie5.js} +55 -55
  13. package/dist/{index-B0tIuwC4.cjs → index-CExMQ6Fe.cjs} +1 -1
  14. package/dist/{index-xS4C1Uqo.cjs → index-CUVYkkg8.cjs} +1 -1
  15. package/dist/index-CqlZ86sE.cjs +1 -0
  16. package/dist/{index-DuC_aA96.cjs → index-Cs4lLl3Y.cjs} +2 -2
  17. package/dist/{index-BRfHHwGt.js → index-CwJDUfGd.js} +1 -1
  18. package/dist/{index-BWsouAX1.js → index-Czol3WHB.js} +1 -1
  19. package/dist/index-D1mklGgR.cjs +1 -0
  20. package/dist/index-D62Ik4Dt.js +4 -0
  21. package/dist/{index-DjpnzTAe.cjs → index-DAEaW6wH.cjs} +1 -1
  22. package/dist/{index-BnfqRlhk.js → index-DTsLSMrJ.js} +1 -1
  23. package/dist/{index-DskGuw3e.js → index-Dw9ciL_n.js} +1 -1
  24. package/dist/{index-Blx2W6GS.js → index-IMXHB1LW.js} +1 -1
  25. package/dist/{index-CphLWdDE.js → index-YYBlBbdy.js} +1 -1
  26. package/dist/{index-B4_pfSXd.cjs → index-lPBFjKuX.cjs} +1 -1
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/style.css +1 -1
  30. package/dist/{styleView-BZV97I57.cjs → styleView-DozZ0ICs.cjs} +1 -1
  31. package/dist/{styleView-D8NW8ZDL.js → styleView-DrFifmTk.js} +1 -1
  32. package/package.json +1 -1
  33. package/dist/index-Bk1B4RlV.cjs +0 -1
  34. package/dist/index-BosPwufD.cjs +0 -1
  35. package/dist/index-ChrX-B9g.js +0 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "epic-designer-gold",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./pluginManager-itCTrGag.cjs"),f=require("element-plus"),c=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),I=require("./axios-tuVKNgv9.cjs"),$={class:"e-data-source"},A={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"},oe={class:"form-item"},ne={class:"form-item-title"},re={key:0,class:"form-item-content"},de={class:"form-item"},ue={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"},ve=e.defineComponent({__name:"index",emits:["update:modelValue","update:sourceData"],setup(fe,{emit:Ve}){const s=r.pluginManager.getComponent("button"),w=r.pluginManager.getComponent("Drawer"),h=r.pluginManager.getComponent("input"),V=r.pluginManager.getComponent("FormItem"),x=r.pluginManager.getComponent("Form"),S=r.pluginManager.getComponent("RadioGroup"),k=r.pluginManager.getComponent("RadioButton"),g=r.pluginManager.getComponent("select");r.pluginManager.getComponent("switch");const E=e.ref(),L={GET:"#67c23a",POST:"#e6a23c",PUT:"#409eff",DELETE:"#f56c6c"},B=e.ref(0),O=e.reactive({apiName:[{required:!0,message:"请输入接口名称",trigger:"blur"}],url:[{required:!0,message:"请输入请求地址",trigger:"blur"}],dataKey:[{required:!0,message:"请输入标签键名",trigger:"blur"}],dataValue:[{required:!0,message:"请输入值键名",trigger:"blur"}]}),_=e.ref(!1),p=e.ref([]),a=e.ref(),N=[{label:"1",value:"1"}];function M(){_.value=!0}function U(){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+=U();return t}function D(){console.log("%c [ ]-249","font-size:13px; background:pink; color:#bf2c9f;",a.value),!a.value||a.value.id||!Object.keys(a.value).length?(a.value={id:"",url:"",body:{},bodyList:[],apiName:`数据源_${T(5)}`,method:"get",params:{},paramsList:[],dataKey:"name",headers:{},headerList:[],dataPath:"",dataValue:"id"},p.value.push(a.value)):a.value.id||C()}function J(l){var t;console.log("%c [ ]-271","font-size:13px; background:pink; color:#bf2c9f;",a.value),!a.value||a.value.id||!Object.keys(a.value).length?(p.value=JSON.parse(JSON.stringify(r.pluginManager.getSourceData())),((t=a.value)==null?void 0:t.id)===l?a.value={}:(a.value=p.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){r.EventBus.emit("deleteSourceData",l)}function q(){var l;(l=a.value)==null||l.paramsList.push({label:"",value:""})}function F(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 K(){var l;(l=a.value)==null||l.bodyList.push({label:"",value:""})}function z(l){a.value.bodyList.splice(l,1)}e.onMounted(()=>{p.value=JSON.parse(JSON.stringify(r.pluginManager.getSourceData()))}),r.EventBus.on("updateSource",l=>{p.value=JSON.parse(JSON.stringify(r.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 m={};a.value.headerList.forEach(d=>{m[d.label]=d.value});let i=await I.axios({method:a.value.method,url:a.value.url,params:t,data:o,headers:m});if(a.value.dataPath){const y=a.value.dataPath.split(".").reduce((v,n)=>v[n],i.data);y&&y.length?f.ElMessage({message:y.map(v=>({label:v[a.value.dataKey],value:v[a.value.dataValue]}))}):f.ElMessage.info("配置错误")}else i.data&&i.data.length?f.ElMessage({message:i.data.map(d=>({label:d[a.value.dataKey],value:d[a.value.dataValue]}))}):f.ElMessage.info("配置错误")}catch{f.ElMessage.error("请求失败")}finally{}else f.ElMessage.error("请填写必填项")})}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?(r.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={}):(r.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={}):f.ElMessage.warning("请先完善表单")})}return(l,t)=>(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(s),{class:"btn",onClick:M},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{name:"icon--epic--window-outline",class:"mr-4px"}),t[8]||(t[8]=e.createElementVNode("span",null,"配置",-1)),e.createElementVNode("span",A,e.toDisplayString(B.value||p.value.length),1)]),_:1}),e.createVNode(e.unref(w),{size:960,modelValue:_.value,"onUpdate:modelValue":t[7]||(t[7]=o=>_.value=o),"append-to-body":"",title:"数据源"},{default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createElementVNode("div",Q,[e.createVNode(e.unref(s),{type:"primary",class:"btn",onClick:D},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{name:"icon--epic--add-rounded",class:"mr-4px"}),t[9]||(t[9]=e.createElementVNode("span",null,"新增数据源",-1))]),_:1}),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,o=>{var m;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["source-item",{active:o.id===((m=a.value)==null?void 0:m.id)}]),key:o.id,onClick:i=>J(o.id)},[e.createElementVNode("div",X,[e.createElementVNode("div",{style:e.normalizeStyle({color:L[o.method.toLocaleUpperCase()]})},e.toDisplayString(o.method.toLocaleUpperCase()),5),e.createElementVNode("div",null,e.toDisplayString(o.apiName),1)]),e.createElementVNode("div",{onClick:i=>P(o.id),class:"source-item-icon"},[e.createVNode(e.unref(c._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.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,m,i,d,y,v;return[e.createVNode(e.unref(V),{prop:"apiName",label:"接口名称"},{default:e.withCtx(()=>[e.createVNode(e.unref(h),{clearable:"",modelValue:a.value.apiName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value.apiName=n),placeholder:"请输入接口名称"},null,8,["modelValue"])]),_:1}),e.createVNode(e.unref(V),{prop:"url",label:"请求地址"},{default:e.withCtx(()=>[e.createVNode(e.unref(h),{modelValue:a.value.url,"onUpdate:modelValue":t[1]||(t[1]=n=>a.value.url=n),clearable:"",placeholder:"请输入完整的请求地址"},null,8,["modelValue"])]),_:1}),e.createVNode(e.unref(V),{label:"请求方法",required:""},{default:e.withCtx(()=>[e.createVNode(e.unref(S),{modelValue:a.value.method,"onUpdate:modelValue":t[2]||(t[2]=n=>a.value.method=n)},{default:e.withCtx(()=>[e.createVNode(e.unref(k),{label:"GET",value:"get"},{default:e.withCtx(()=>t[10]||(t[10]=[e.createTextVNode("GET")])),_:1}),e.createVNode(e.unref(k),{label:"POST",value:"post"},{default:e.withCtx(()=>t[11]||(t[11]=[e.createTextVNode("POST")])),_:1}),e.createVNode(e.unref(k),{label:"PUT",value:"put"},{default:e.withCtx(()=>t[12]||(t[12]=[e.createTextVNode("PUT")])),_:1}),e.createVNode(e.unref(k),{label:"DELETE",value:"delete"},{default:e.withCtx(()=>t[13]||(t[13]=[e.createTextVNode("DELETE")])),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createElementVNode("div",le,[e.createVNode(e.unref(V),{prop:"dataKey",style:{width:"30%"},label:"标签键名"},{default:e.withCtx(()=>[e.createVNode(e.unref(h),{modelValue:a.value.dataKey,"onUpdate:modelValue":t[3]||(t[3]=n=>a.value.dataKey=n),clearable:"",placeholder:"请输入标签键名"},null,8,["modelValue"])]),_:1}),e.createVNode(e.unref(V),{prop:"dataValue",style:{width:"30%"},label:"值键名"},{default:e.withCtx(()=>[e.createVNode(e.unref(h),{modelValue:a.value.dataValue,"onUpdate:modelValue":t[4]||(t[4]=n=>a.value.dataValue=n),clearable:"",placeholder:"请输入值键名"},null,8,["modelValue"])]),_:1}),e.createVNode(e.unref(V),{style:{width:"33%"},label:"数据位置"},{default:e.withCtx(()=>[e.createVNode(e.unref(h),{modelValue:a.value.dataPath,"onUpdate:modelValue":t[5]||(t[5]=n=>a.value.dataPath=n),clearable:"",placeholder:"多层嵌套使用.分隔"},null,8,["modelValue"])]),_:1})]),e.createElementVNode("div",oe,[e.createElementVNode("div",ne,[t[15]||(t[15]=e.createElementVNode("div",null,"请求参数",-1)),e.createVNode(e.unref(s),{onClick:q,text:"",type:"primary",class:"btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{name:"icon--epic--add-rounded"}),t[14]||(t[14]=e.createTextVNode(" 添加 "))]),_:1})]),(o=a.value)!=null&&o.paramsList&&((m=a.value)!=null&&m.paramsList.length)?(e.openBlock(),e.createElementBlock("div",re,[(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(g),{modelValue:n.label,"onUpdate:modelValue":u=>n.label=u,filterable:"","allow-create":"",style:{width:"42%"},options:N,placeholder:"参数名"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(g),{modelValue:n.value,"onUpdate:modelValue":u=>n.value=u,filterable:"","allow-create":"",style:{width:"42%"},options:N,placeholder:"参数值"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(s),{onClick:u=>F(b),type:"danger",circle:""},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{style:{color:"#fff"},name:"icon--epic--delete-outline-rounded"})]),_:2},1032,["onClick"])]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",de,[e.createElementVNode("div",ue,[t[17]||(t[17]=e.createElementVNode("div",null,"请求头",-1)),e.createVNode(e.unref(s),{onClick:R,text:"",type:"primary",class:"btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{name:"icon--epic--add-rounded"}),t[16]||(t[16]=e.createTextVNode(" 添加 "))]),_:1})]),(i=a.value)!=null&&i.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(g),{modelValue:n.label,"onUpdate:modelValue":u=>n.label=u,filterable:"","allow-create":"",style:{width:"42%"},options:N,placeholder:"参数名"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(g),{modelValue:n.value,"onUpdate:modelValue":u=>n.value=u,filterable:"","allow-create":"",style:{width:"42%"},options:N,placeholder:"参数值"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(s),{onClick:u=>j(b),type:"danger",circle:""},{default:e.withCtx(()=>[e.createVNode(e.unref(c._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,[t[19]||(t[19]=e.createElementVNode("div",null,"请求体",-1)),e.createVNode(e.unref(s),{onClick:K,text:"",type:"primary",class:"btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{name:"icon--epic--add-rounded"}),t[18]||(t[18]=e.createTextVNode(" 添加 "))]),_:1})]),(y=a.value)!=null&&y.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(g),{modelValue:n.label,"onUpdate:modelValue":u=>n.label=u,filterable:"","allow-create":"",style:{width:"42%"},options:N,placeholder:"参数名"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(g),{modelValue:n.value,"onUpdate:modelValue":u=>n.value=u,filterable:"","allow-create":"",style:{width:"42%"},options:N,placeholder:"参数值"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(s),{onClick:t[6]||(t[6]=u=>z(l.i)),type:"danger",circle:""},{default:e.withCtx(()=>[e.createVNode(e.unref(c._sfc_main),{style:{color:"#fff"},name:"icon--epic--delete-outline-rounded"})]),_:1})]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",pe,[e.createVNode(e.unref(s),{type:"info",onClick:G},{default:e.withCtx(()=>t[20]||(t[20]=[e.createTextVNode("请求测试")])),_:1}),e.createVNode(e.unref(s),{type:"primary",onClick:C},{default:e.withCtx(()=>t[21]||(t[21]=[e.createTextVNode("保存")])),_:1})])]}),_:1},8,["model","rules"])]))])])])]),_:1},8,["modelValue"])]))}});exports.default=ve;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./vuedraggable.umd-BqhSJIAi.cjs"),p=require("./pluginManager-itCTrGag.cjs"),y=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),b=require("./index-DuC_aA96.cjs"),B=require("element-plus"),S=require("./axios-tuVKNgv9.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"pl-4"},O=e.defineComponent({name:"EOptionItem",__name:"optionItem",props:{modelValue:{}},emits:["update:modelValue"],setup(_,{emit:g}){const h=_,V=p.pluginManager.getComponent("input"),d=e.inject("tree",!1),s=g,i=b.useVModel(h,"modelValue",s);function f(o){const c={label:"",value:""};o.children?o.children.push(c):o.children=[c]}function r(o){i.value=i.value.filter((c,m)=>m!==o)}return(o,c)=>{const m=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:k})=>[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(y._sfc_main),{class:"mr-2 cursor-move handle",name:"icon--epic--drag"}),e.createVNode(e.unref(V),{modelValue:n.label,"onUpdate:modelValue":a=>n.label=a,value:n.label,"onUpdate:value":a=>n.label=a,placeholder:"label"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.createVNode(e.unref(V),{modelValue:n.value,"onUpdate:modelValue":a=>n.value=a,value:n.value,"onUpdate:value":a=>n.value=a,placeholder:"value"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.unref(d)?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:0,class:"cursor-pointer text-lg!",name:"icon--epic--add-rounded",onClick:a=>f(n)},null,8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y._sfc_main),{class:"hover:text-red cursor-pointer",name:"icon--epic--delete-outline-rounded",onClick:a=>r(k)},null,8,["onClick"])],2),n.children?(e.openBlock(),e.createElementBlock("div",M,[e.createVNode(m,{modelValue:n.children,"onUpdate:modelValue":a=>n.children=a},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),I={class:""},q={class:"epic-tabs-box"},w=["title","onClick"],$={key:0},j={class:"py-4 my-2 text-center text-gray-400 bg-white"},A={key:1},D=e.defineComponent({__name:"index",props:{tree:{type:Boolean},modelValue:{},dynamicId:{},type:{}},emits:["update:modelValue","update:EOptionsEditor"],setup(_,{emit:g}){const h=p.pluginManager.getComponent("button"),V=p.pluginManager.getComponent("select"),d=e.ref([]),s=e.reactive({title:"静态"}),i=_,f=g;p.EventBus.on("updateSource",l=>{d.value=p.pluginManager.sourceData.map(t=>({...t,label:t.apiName,value:t.id}))}),e.onMounted(()=>{d.value=p.pluginManager.sourceData.map(l=>({...l,label:l.apiName,value:l.id}))});const r=b.useVModel(i,"modelValue",f),o=b.useVModel(i,"dynamicId",f);function c(l){return l&&Object.prototype.toString.call(l)==="[object Array]"?l:(B.ElMessage.info("请检查数据位置是否配置准确"),[])}e.watch(()=>o.value,async()=>{o.value?s.title="动态":s.title="静态"},{immediate:!0});const m=[{title:"静态"},{title:"动态"}];async function n(l){s.title=l.title,l.title==="静态"&&(o.value="")}async function k(l){const t=d.value.find(u=>u.id===l);let v=await S.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((C,N)=>C[N],v.data);r.value=c(x)}else r.value=c(v.data)}i.modelValue,e.provide("tree",i.tree);function a(){const l=e.reactive({label:"",value:""});r.value.length?r.value=[...r.value,l]:r.value=[l]}return(l,t)=>{var v;return e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",null,[e.createElementVNode("div",q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(m,(u,x)=>e.createElementVNode("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:s.title===u.title}]),key:x,title:u.title,onClick:C=>n(u)},e.toDisplayString(u.title),11,w)),64))]),s.title==="静态"?(e.openBlock(),e.createElementBlock("div",$,[e.withDirectives(e.createElementVNode("div",j,"暂无选项",512),[[e.vShow,!((v=e.unref(r))!=null&&v.length)]]),e.createVNode(O,{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(h),{onClick:a},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("添加选项")])),_:1})])):(e.openBlock(),e.createElementBlock("div",A,[t[3]||(t[3]=e.createElementVNode("span",{style:{"font-size":"12px","margin-bottom":"8px",display:"inline-block"}},"数据源",-1)),e.createVNode(e.unref(V),{modelValue:e.unref(o),"onUpdate:modelValue":t[1]||(t[1]=u=>e.isRef(o)?o.value=u:null),placeholder:"请选择数据源",clearable:"",options:d.value,onChange:k},null,8,["modelValue","options"])]))])])}}}),P=U._export_sfc(D,[["__scopeId","data-v-90d95f9f"]]);exports.default=P;
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./index-D0g3u-k9.js";
2
- export {
3
- f as default
4
- };