epic-designer-gold 0.0.9 → 0.0.10
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-D6GDDwJd.cjs → attributeView-DU2TCl82.cjs} +1 -1
- package/dist/{attributeView-C5p72pi9.js → attributeView-u87puklW.js} +1 -1
- package/dist/{eventView-B1SO_b3U.js → eventView-3jlgsbYv.js} +1 -1
- package/dist/{eventView-C-nPJeal.cjs → eventView-DlM9PXFS.cjs} +1 -1
- package/dist/{index-D0g3u-k9.js → index-B44ldwiI.js} +8 -8
- package/dist/{index-CphLWdDE.js → index-BTe6WMoJ.js} +1 -1
- package/dist/index-BZ70tu0m.cjs +1 -0
- package/dist/{index-CtG-fCHj.cjs → index-Bhd9Utr6.cjs} +1 -1
- package/dist/{index-Dd4gCjAw.js → index-BxQ1aSj3.js} +79 -73
- package/dist/{index-B4_pfSXd.cjs → index-C9dq3Qx9.cjs} +1 -1
- package/dist/{index-DuC_aA96.cjs → index-CFryUxKc.cjs} +2 -2
- package/dist/{index-xS4C1Uqo.cjs → index-CT6Df8VO.cjs} +1 -1
- package/dist/{index-BnfqRlhk.js → index-CYPhbix8.js} +1 -1
- package/dist/{index-B0tIuwC4.cjs → index-CZeYVxo4.cjs} +1 -1
- package/dist/index-CgVTdX64.js +4 -0
- package/dist/{index-CW5-2m8M.cjs → index-Cx2JsRRr.cjs} +1 -1
- package/dist/{index-Bvq0Bx84.js → index-D6CL7QdF.js} +1 -1
- package/dist/{index-BRfHHwGt.js → index-DZxe3Mh2.js} +1 -1
- package/dist/{index-Blx2W6GS.js → index-DwxSF-EA.js} +1 -1
- package/dist/{index-DskGuw3e.js → index-GG-x1fxs.js} +1 -1
- package/dist/{index-8Z_BUSpi.cjs → index-KbBptC7N.cjs} +1 -1
- package/dist/{index-B4QCUzmC.cjs → index-TLhJz2ch.cjs} +1 -1
- package/dist/{index-BWsouAX1.js → index-r1WNNgF-.js} +1 -1
- package/dist/{index-DjpnzTAe.cjs → index-xDLPhT_Q.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{styleView-BZV97I57.cjs → styleView-C7t4u5ue.cjs} +1 -1
- package/dist/{styleView-D8NW8ZDL.js → styleView-wqJjZQTl.js} +1 -1
- package/package.json +1 -1
- package/dist/index-BosPwufD.cjs +0 -1
- package/dist/index-ChrX-B9g.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-CFryUxKc.cjs"),v=require("./pluginManager-itCTrGag.cjs"),k=["title"],g=e.defineComponent({__name:"attributeView",setup(b){const d=e.inject("designer"),s=e.inject("pageSchema"),p=e.inject("revoke"),f=v.pluginManager.getComponentConfings(),c=e.computed(()=>d.state.checkedNode);function h(n){var a;return typeof n.show=="boolean"?n.show:typeof n.show=="function"?(a=n.show)==null?void 0:a.call(n,{values:c.value}):!0}const u=e.ref([]);e.watchEffect(()=>{var o,t,r;const n=(o=d.state.checkedNode)==null?void 0:o.type;if(!d.state.checkedNode||!n)return[];const a=((t=f[n])==null?void 0:t.config.attribute)??[];u.value=[{label:"组件ID",type:"input",field:"id",componentProps:{disabled:!0}},...a],d.state.checkedNode.id===((r=s.schemas[0])==null?void 0:r.id)&&u.value.push({label:"画布宽度",type:"EInputSize",field:"canvas.width",editData:s},{label:"画布高度",type:"EInputSize",field:"canvas.height",editData:s})});function y(n,a,o,t=c.value){typeof o.onChange=="function"&&o.onChange({value:n,values:t,componentAttributes:u}),o.changeSync?l.setValueByPath(t,a,n):e.nextTick(()=>{l.setValueByPath(t,a,n)}),p.push(s.schemas,"编辑组件属性")}function m(n,a,o=c.value){e.nextTick(()=>{l.setValueByPath(o,"componentProps.dynamicId",n)})}return(n,a)=>{var o;return e.openBlock(),e.createElementBlock("div",{class:"epic-attribute-view",key:(o=c.value)==null?void 0:o.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>{var r;return e.openBlock(),e.createElementBlock("div",{key:t.field},[h(t)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["epic-attr-item",t.layout])},[t.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"epic-attr-label",title:t.label},e.toDisplayString(t.label),9,k)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["epic-attr-input",{"block!":t.layout==="vertical"}])},[e.createVNode(e.unref(l._sfc_main),{componentSchema:{...t,componentProps:{...t.componentProps,...t.field==="componentProps.defaultValue"?(r=c.value)==null?void 0:r.componentProps:{},input:!1,field:void 0,hidden:!1},show:!0,noFormItem:!0},dynamicId:e.unref(l.getValueByPath)(t.editData??c.value,"componentProps.dynamicId"),"model-value":e.unref(l.getValueByPath)(t.editData??c.value,t.field),"onUpdate:modelValue":i=>y(i,t.field,t,t.editData),"onUpdate:dynamicId":i=>m(i)},null,8,["componentSchema","dynamicId","model-value","onUpdate:modelValue","onUpdate:dynamicId"])],2)],2)):e.createCommentVNode("",!0)])}),128))])}}});exports.default=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as S, inject as i, computed as V, ref as P, watchEffect as C, openBlock as l, createElementBlock as s, Fragment as N, renderList as D, normalizeClass as m, toDisplayString as E, createCommentVNode as y, createElementVNode as U, createVNode as B, unref as f, nextTick as v } from "vue";
|
|
2
|
-
import { _ as x, p as g, s as h } from "./index-
|
|
2
|
+
import { _ as x, p as g, s as h } from "./index-B44ldwiI.js";
|
|
3
3
|
import { p as z } from "./pluginManager-D8PM7ICc.js";
|
|
4
4
|
const F = ["title"], M = /* @__PURE__ */ S({
|
|
5
5
|
__name: "attributeView",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as y, inject as d, computed as a, openBlock as r, createElementBlock as i, createBlock as b, unref as u, createCommentVNode as k } from "vue";
|
|
2
2
|
import { p } from "./pluginManager-D8PM7ICc.js";
|
|
3
|
-
import { p as _, s as B } from "./index-
|
|
3
|
+
import { p as _, s as B } from "./index-B44ldwiI.js";
|
|
4
4
|
const C = { class: "epic-event-view" }, U = { key: 0 }, S = /* @__PURE__ */ y({
|
|
5
5
|
__name: "eventView",
|
|
6
6
|
setup(E) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./pluginManager-itCTrGag.cjs"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./pluginManager-itCTrGag.cjs"),u=require("./index-CFryUxKc.cjs"),g={class:"epic-event-view"},f={key:0},y=e.defineComponent({__name:"eventView",setup(k){const i=e.inject("pageSchema"),c=e.inject("designer"),a=e.inject("revoke"),l=s.pluginManager.getComponent("EActionEditor"),p=s.pluginManager.getComponentConfings(),o=e.computed(()=>c.state.checkedNode),v=e.computed(()=>{var r,d;const n=[{title:"生命周期",events:[{type:"vnodeBeforeMount",describe:"beforeMount"},{type:"vnodeMounted",describe:"mounted"},{type:"vnodeBeforeUpdate",describe:"beforeUpdate"},{type:"vnodeUpdated",describe:"updated"},{type:"vnodeBeforeUnmount",describe:"beforeUnmount"},{type:"vnodeUnmounted",describe:"unmounted"},{type:"vnodeErrorCaptured",describe:"errorCaptured"}]}],t=((d=p[((r=c.state.checkedNode)==null?void 0:r.type)??""])==null?void 0:d.config.event)??[];return n.unshift({title:"组件事件",events:t}),n});function m(n,t){u.setValueByPath(o.value,t,n),a.push(i.schemas,"编辑组件属性")}return(n,t)=>(e.openBlock(),e.createElementBlock("div",g,[o.value?(e.openBlock(),e.createElementBlock("div",f,[(e.openBlock(),e.createBlock(e.unref(l),{key:o.value.id,"event-list":v.value,"model-value":e.unref(u.getValueByPath)(o.value,"on"),"onUpdate:modelValue":t[0]||(t[0]=r=>m(r,"on"))},null,8,["event-list","model-value"]))])):e.createCommentVNode("",!0)]))}});exports.default=y;
|
|
@@ -1199,7 +1199,7 @@ const ht = { class: "min-w-750px rounded" }, vt = { class: "h-full rounded" }, y
|
|
|
1199
1199
|
"updateSourceData"
|
|
1200
1200
|
],
|
|
1201
1201
|
setup(e, { expose: a, emit: n }) {
|
|
1202
|
-
const o = q(() => import("./index-Ba0ZjQgI.js")), t = q(() => import("./index-M-hTLR0c.js")), s = q(() => import("./index-
|
|
1202
|
+
const o = q(() => import("./index-Ba0ZjQgI.js")), t = q(() => import("./index-M-hTLR0c.js")), s = q(() => import("./index-DwxSF-EA.js")), l = q(() => import("./index-uaq_HmHi.js")), i = q(() => import("./index-DgcFxYFp.js")), c = be(), w = Ue(), m = e;
|
|
1203
1203
|
let r = {
|
|
1204
1204
|
schemas: [
|
|
1205
1205
|
{
|
|
@@ -1387,7 +1387,7 @@ defineExpose({
|
|
|
1387
1387
|
})) : (R(), de("div", gt));
|
|
1388
1388
|
}
|
|
1389
1389
|
}), At = {
|
|
1390
|
-
component: async () => await import("./index-
|
|
1390
|
+
component: async () => await import("./index-GG-x1fxs.js"),
|
|
1391
1391
|
defaultSchema: {
|
|
1392
1392
|
label: "代码编辑器",
|
|
1393
1393
|
type: "monacoEditor",
|
|
@@ -1437,16 +1437,16 @@ defineExpose({
|
|
|
1437
1437
|
}
|
|
1438
1438
|
};
|
|
1439
1439
|
function Dt(e) {
|
|
1440
|
-
e.component("EInputSize", async () => await import("./index-HM72iSCq.js")), e.component("EColEditor", async () => await import("./index-
|
|
1440
|
+
e.component("EInputSize", async () => await import("./index-HM72iSCq.js")), e.component("EColEditor", async () => await import("./index-BTe6WMoJ.js")), e.component("EActionEditor", async () => await import("./index-CYPhbix8.js")), e.component("ERuleEditor", async () => await import("./index-D6CL7QdF.js")), e.component("EOptionsEditor", async () => await import("./index-BxQ1aSj3.js")), e.component("ENode", async () => await import("./index-CgVTdX64.js")), e.component("EDataSource", async () => await import("./index-FHuEonxg.js")), e.registerActivitybar({
|
|
1441
1441
|
id: "component_view",
|
|
1442
1442
|
title: "组件",
|
|
1443
1443
|
icon: "icon--epic--extension-outline",
|
|
1444
|
-
component: async () => await import("./index-
|
|
1444
|
+
component: async () => await import("./index-r1WNNgF-.js")
|
|
1445
1445
|
}), e.registerActivitybar({
|
|
1446
1446
|
id: "sound_code_view",
|
|
1447
1447
|
title: "源码",
|
|
1448
1448
|
icon: "icon--epic--sdk-outline-rounded",
|
|
1449
|
-
component: async () => await import("./index-
|
|
1449
|
+
component: async () => await import("./index-DZxe3Mh2.js")
|
|
1450
1450
|
}), e.registerActivitybar({
|
|
1451
1451
|
id: "outline_view",
|
|
1452
1452
|
title: "大纲",
|
|
@@ -1455,15 +1455,15 @@ function Dt(e) {
|
|
|
1455
1455
|
}), e.registerRightSidebar({
|
|
1456
1456
|
id: "attribute_view",
|
|
1457
1457
|
title: "属性",
|
|
1458
|
-
component: async () => await import("./attributeView-
|
|
1458
|
+
component: async () => await import("./attributeView-u87puklW.js")
|
|
1459
1459
|
}), e.registerRightSidebar({
|
|
1460
1460
|
id: "style_view",
|
|
1461
1461
|
title: "样式",
|
|
1462
|
-
component: async () => await import("./styleView-
|
|
1462
|
+
component: async () => await import("./styleView-wqJjZQTl.js")
|
|
1463
1463
|
}), e.registerRightSidebar({
|
|
1464
1464
|
id: "event_view",
|
|
1465
1465
|
title: "事件",
|
|
1466
|
-
component: async () => await import("./eventView-
|
|
1466
|
+
component: async () => await import("./eventView-3jlgsbYv.js")
|
|
1467
1467
|
}), [At, Et].forEach((n) => {
|
|
1468
1468
|
e.registerComponent(n);
|
|
1469
1469
|
});
|
|
@@ -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
2
|
import { p as U } from "./pluginManager-D8PM7ICc.js";
|
|
3
|
-
import { k as P } from "./index-
|
|
3
|
+
import { k as P } from "./index-B44ldwiI.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,
|
|
@@ -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("./pluginManager-itCTrGag.cjs"),b=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),C=require("./index-CFryUxKc.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(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 _(o){const c={label:"",value:""};o.children?o.children.push(c):o.children=[c]}function u(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:x})=>[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":r=>n.label=r,value:n.label,"onUpdate:value":r=>n.label=r,placeholder:"label"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.createVNode(e.unref(f),{modelValue:n.value,"onUpdate:modelValue":r=>n.value=r,value:n.value,"onUpdate:value":r=>n.value=r,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:r=>_(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:r=>u(x)},null,8,["onClick"])],2),n.children?(e.openBlock(),e.createElementBlock("div",M,[e.createVNode(m,{modelValue:n.children,"onUpdate:modelValue":r=>n.children=r},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"},z={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}))}),e.onMounted(()=>{d.value=p.pluginManager.sourceData.map(l=>({...l,label:l.apiName,value:l.id}))});const u=C.useVModel(i,"modelValue",_),o=C.useVModel(i,"dynamicId",_);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 x(l){const t=d.value.find(a=>a.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 g=t.dataPath.split(".").reduce((V,N)=>V[N],v.data);console.log("%c [ ]-148","font-size:13px; background:pink; color:#bf2c9f;",g),u.value=c(g).map(V=>({label:V[t.dataKey],value:V[t.dataValue]}))}else u.value=c(v.data).map(a=>({label:a[t.dataKey],value:a[t.dataValue]}))}i.modelValue,e.provide("tree",i.tree);function r(){const l=e.reactive({label:"",value:""});u.value.length?u.value=[...u.value,l]:u.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,(a,g)=>e.createElementVNode("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:s.title===a.title}]),key:g,title:a.title,onClick:V=>n(a)},e.toDisplayString(a.title),11,w)),64))]),s.title==="静态"?(e.openBlock(),e.createElementBlock("div",$,[e.withDirectives(e.createElementVNode("div",j,"暂无选项",512),[[e.vShow,!((v=e.unref(u))!=null&&v.length)]]),e.createVNode(O,{modelValue:e.unref(u),"onUpdate:modelValue":t[0]||(t[0]=a=>e.isRef(u)?u.value=a:null)},null,8,["modelValue"]),e.createVNode(e.unref(y),{onClick:r},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("添加选项")])),_:1})])):(e.openBlock(),e.createElementBlock("div",z,[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(o),"onUpdate:modelValue":t[1]||(t[1]=a=>e.isRef(o)?o.value=a:null),placeholder:"请选择数据源",clearable:"",options:d.value,onChange:x},null,8,["modelValue","options"])]))])])}}}),D=U._export_sfc(A,[["__scopeId","data-v-d74ef13d"]]);exports.default=D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),p=require("monaco-editor"),b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),p=require("monaco-editor"),b=require("./index-CFryUxKc.cjs"),h=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function v(l){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const r in l)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(l,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>l[r]})}}return o.default=l,Object.freeze(o)}const i=v(p),_=a.defineComponent({__name:"index",props:{language:{default:"json"},readOnly:{type:Boolean,default:!1},valueFormat:{default:"string"},modelValue:{},config:{default:()=>({selectOnLineNumbers:!0,minimap:{enabled:!1}})},lineNumbers:{default:"on"},autoToggleTheme:{type:Boolean},theme:{default:"vs-light"}},emits:["update:modelValue"],setup(l,{expose:o,emit:r}){const t=l,s=r,c=a.ref(null);let e=null;const{isDark:f}=b.useTheme();function d(){f.value?i.editor.setTheme("vs-dark"):i.editor.setTheme("vs-light")}function m(u){e==null||e.setValue(u||"")}function g(u){const n=e==null?void 0:e.getPosition();n&&(e==null||e.executeEdits("",[{range:new i.Range(n.lineNumber,n.column,n.lineNumber,n.column),text:u}]),e==null||e.setPosition({...n,column:n.column+u.length}),e==null||e.focus())}return a.onMounted(()=>{e=i.editor.create(c.value,{value:u(),...t.config,language:t.language,readOnly:t.readOnly,lineNumbers:t.lineNumbers,theme:t.theme,scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},automaticLayout:!0}),t.autoToggleTheme&&a.watch(()=>f.value,()=>{a.nextTick(()=>d())},{immediate:!0});function u(){return t.valueFormat==="json"&&t.modelValue?JSON.stringify(t.modelValue,null,2):t.modelValue??""}e.onDidChangeModelContent(()=>{const n=e==null?void 0:e.getValue();if(t.valueFormat==="json"&&n){s("update:modelValue",JSON.parse(n));return}s("update:modelValue",n??"")})}),o({setValue:m,insertText:g}),(u,n)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"editContainer",ref:c,class:"epic-code-editor"},null,512))}}),y=h._export_sfc(_,[["__scopeId","data-v-3e2e893c"]]);exports.default=y;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as B, inject as j, resolveComponent as
|
|
1
|
+
import { defineComponent as B, inject as j, resolveComponent as z, openBlock as p, createBlock as N, unref as n, isRef as O, withCtx as A, createElementVNode as m, normalizeClass as D, createVNode as s, createCommentVNode as $, createElementBlock as _, ref as J, reactive as w, onMounted as K, watch as L, provide as P, Fragment as R, renderList as T, toDisplayString as F, withDirectives as q, vShow as G, createTextVNode as H } from "vue";
|
|
2
2
|
import { d as Q } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
|
-
import { p as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { n as
|
|
3
|
+
import { p as g, E as W } from "./pluginManager-D8PM7ICc.js";
|
|
4
|
+
import { _ as E } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
+
import { n as I } from "./index-B44ldwiI.js";
|
|
6
6
|
import { ElMessage as X } from "element-plus";
|
|
7
7
|
import { a as Y } from "./axios-CXDYiOMX.js";
|
|
8
8
|
import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -16,23 +16,23 @@ const ee = {
|
|
|
16
16
|
modelValue: {}
|
|
17
17
|
},
|
|
18
18
|
emits: ["update:modelValue"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
function x(
|
|
22
|
-
const
|
|
19
|
+
setup(k, { emit: C }) {
|
|
20
|
+
const U = k, y = g.getComponent("input"), c = j("tree", !1), u = I(U, "modelValue", C);
|
|
21
|
+
function x(o) {
|
|
22
|
+
const d = {
|
|
23
23
|
label: "",
|
|
24
24
|
value: ""
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
o.children ? o.children.push(d) : o.children = [d];
|
|
27
27
|
}
|
|
28
|
-
function i(
|
|
29
|
-
u.value = u.value.filter((
|
|
28
|
+
function i(o) {
|
|
29
|
+
u.value = u.value.filter((d, f) => f !== o);
|
|
30
30
|
}
|
|
31
|
-
return (
|
|
32
|
-
const f =
|
|
33
|
-
return p(), N(
|
|
34
|
-
modelValue:
|
|
35
|
-
"onUpdate:modelValue":
|
|
31
|
+
return (o, d) => {
|
|
32
|
+
const f = z("EOptionItem");
|
|
33
|
+
return p(), N(n(Q), {
|
|
34
|
+
modelValue: n(u),
|
|
35
|
+
"onUpdate:modelValue": d[0] || (d[0] = (l) => O(u) ? u.value = l : null),
|
|
36
36
|
"item-key": "id",
|
|
37
37
|
"component-data": {
|
|
38
38
|
type: "transition-group"
|
|
@@ -41,45 +41,45 @@ const ee = {
|
|
|
41
41
|
handle: ".handle",
|
|
42
42
|
animation: 200
|
|
43
43
|
}, {
|
|
44
|
-
item: A(({ element: l, index:
|
|
44
|
+
item: A(({ element: l, index: S }) => [
|
|
45
45
|
m("div", null, [
|
|
46
46
|
m("div", {
|
|
47
|
-
class: D([
|
|
47
|
+
class: D([n(c) ? "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"])
|
|
48
48
|
}, [
|
|
49
|
-
|
|
49
|
+
s(n(E), {
|
|
50
50
|
class: "mr-2 cursor-move handle",
|
|
51
51
|
name: "icon--epic--drag"
|
|
52
52
|
}),
|
|
53
|
-
|
|
53
|
+
s(n(y), {
|
|
54
54
|
modelValue: l.label,
|
|
55
|
-
"onUpdate:modelValue": (
|
|
55
|
+
"onUpdate:modelValue": (r) => l.label = r,
|
|
56
56
|
value: l.label,
|
|
57
|
-
"onUpdate:value": (
|
|
57
|
+
"onUpdate:value": (r) => l.label = r,
|
|
58
58
|
placeholder: "label"
|
|
59
59
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
60
|
-
|
|
60
|
+
s(n(y), {
|
|
61
61
|
modelValue: l.value,
|
|
62
|
-
"onUpdate:modelValue": (
|
|
62
|
+
"onUpdate:modelValue": (r) => l.value = r,
|
|
63
63
|
value: l.value,
|
|
64
|
-
"onUpdate:value": (
|
|
64
|
+
"onUpdate:value": (r) => l.value = r,
|
|
65
65
|
placeholder: "value"
|
|
66
66
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
67
|
-
|
|
67
|
+
n(c) ? (p(), N(n(E), {
|
|
68
68
|
key: 0,
|
|
69
69
|
class: "cursor-pointer text-lg!",
|
|
70
70
|
name: "icon--epic--add-rounded",
|
|
71
|
-
onClick: (
|
|
71
|
+
onClick: (r) => x(l)
|
|
72
72
|
}, null, 8, ["onClick"])) : $("", !0),
|
|
73
|
-
|
|
73
|
+
s(n(E), {
|
|
74
74
|
class: "hover:text-red cursor-pointer",
|
|
75
75
|
name: "icon--epic--delete-outline-rounded",
|
|
76
|
-
onClick: (
|
|
76
|
+
onClick: (r) => i(S)
|
|
77
77
|
}, null, 8, ["onClick"])
|
|
78
78
|
], 2),
|
|
79
|
-
l.children ? (p(),
|
|
80
|
-
|
|
79
|
+
l.children ? (p(), _("div", ee, [
|
|
80
|
+
s(f, {
|
|
81
81
|
modelValue: l.children,
|
|
82
|
-
"onUpdate:modelValue": (
|
|
82
|
+
"onUpdate:modelValue": (r) => l.children = r
|
|
83
83
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
84
84
|
])) : $("", !0)
|
|
85
85
|
])
|
|
@@ -88,7 +88,7 @@ const ee = {
|
|
|
88
88
|
}, 8, ["modelValue"]);
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
}), le = { class: "" }, ae = { class: "epic-tabs-box" }, ne = ["title", "onClick"], oe = { key: 0 },
|
|
91
|
+
}), le = { class: "" }, ae = { class: "epic-tabs-box" }, ne = ["title", "onClick"], oe = { key: 0 }, re = { class: "py-4 my-2 text-center text-gray-400 bg-white" }, ie = { key: 1 }, ue = /* @__PURE__ */ B({
|
|
92
92
|
__name: "index",
|
|
93
93
|
props: {
|
|
94
94
|
tree: { type: Boolean },
|
|
@@ -97,31 +97,31 @@ const ee = {
|
|
|
97
97
|
type: {}
|
|
98
98
|
},
|
|
99
99
|
emits: ["update:modelValue", "update:EOptionsEditor"],
|
|
100
|
-
setup(
|
|
101
|
-
const
|
|
100
|
+
setup(k, { emit: C }) {
|
|
101
|
+
const U = g.getComponent("button"), y = g.getComponent("select"), c = J([]), v = w({
|
|
102
102
|
title: "静态"
|
|
103
|
-
}), u =
|
|
103
|
+
}), u = k, x = C;
|
|
104
104
|
W.on("updateSource", (t) => {
|
|
105
|
-
c.value =
|
|
105
|
+
c.value = g.sourceData.map((e) => ({
|
|
106
106
|
...e,
|
|
107
107
|
label: e.apiName,
|
|
108
108
|
value: e.id
|
|
109
109
|
}));
|
|
110
|
-
}),
|
|
111
|
-
c.value =
|
|
110
|
+
}), K(() => {
|
|
111
|
+
c.value = g.sourceData.map((t) => ({
|
|
112
112
|
...t,
|
|
113
113
|
label: t.apiName,
|
|
114
114
|
value: t.id
|
|
115
115
|
}));
|
|
116
116
|
});
|
|
117
|
-
const i =
|
|
118
|
-
function
|
|
117
|
+
const i = I(u, "modelValue", x), o = I(u, "dynamicId", x);
|
|
118
|
+
function d(t) {
|
|
119
119
|
return t && Object.prototype.toString.call(t) === "[object Array]" ? t : (X.info("请检查数据位置是否配置准确"), []);
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
() =>
|
|
121
|
+
L(
|
|
122
|
+
() => o.value,
|
|
123
123
|
async () => {
|
|
124
|
-
|
|
124
|
+
o.value ? v.title = "动态" : v.title = "静态";
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
immediate: !0
|
|
@@ -136,10 +136,10 @@ const ee = {
|
|
|
136
136
|
}
|
|
137
137
|
];
|
|
138
138
|
async function l(t) {
|
|
139
|
-
v.title = t.title, t.title === "静态" && (
|
|
139
|
+
v.title = t.title, t.title === "静态" && (o.value = "");
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
142
|
-
const e = c.value.find((
|
|
141
|
+
async function S(t) {
|
|
142
|
+
const e = c.value.find((a) => a.id === t);
|
|
143
143
|
let h = await Y({
|
|
144
144
|
method: (e == null ? void 0 : e.method) || "get",
|
|
145
145
|
url: e.url,
|
|
@@ -149,13 +149,19 @@ const ee = {
|
|
|
149
149
|
headers: e != null && e.header ? JSON.parse(e == null ? void 0 : e.header) : {}
|
|
150
150
|
});
|
|
151
151
|
if (e && (e != null && e.dataPath)) {
|
|
152
|
-
const
|
|
153
|
-
i.value =
|
|
152
|
+
const b = e.dataPath.split(".").reduce((V, M) => V[M], h.data);
|
|
153
|
+
console.log("%c [ ]-148", "font-size:13px; background:pink; color:#bf2c9f;", b), i.value = d(b).map((V) => ({
|
|
154
|
+
label: V[e.dataKey],
|
|
155
|
+
value: V[e.dataValue]
|
|
156
|
+
}));
|
|
154
157
|
} else
|
|
155
|
-
i.value =
|
|
158
|
+
i.value = d(h.data).map((a) => ({
|
|
159
|
+
label: a[e.dataKey],
|
|
160
|
+
value: a[e.dataValue]
|
|
161
|
+
}));
|
|
156
162
|
}
|
|
157
|
-
u.modelValue,
|
|
158
|
-
function
|
|
163
|
+
u.modelValue, P("tree", u.tree);
|
|
164
|
+
function r() {
|
|
159
165
|
const t = w({
|
|
160
166
|
label: "",
|
|
161
167
|
value: ""
|
|
@@ -164,46 +170,46 @@ const ee = {
|
|
|
164
170
|
}
|
|
165
171
|
return (t, e) => {
|
|
166
172
|
var h;
|
|
167
|
-
return p(),
|
|
173
|
+
return p(), _("div", le, [
|
|
168
174
|
m("div", null, [
|
|
169
175
|
m("div", ae, [
|
|
170
|
-
(p(),
|
|
171
|
-
class: D(["epic-tab cursor-pointer truncate", { checked: v.title ===
|
|
172
|
-
key:
|
|
173
|
-
title:
|
|
174
|
-
onClick: (
|
|
175
|
-
},
|
|
176
|
+
(p(), _(R, null, T(f, (a, b) => m("div", {
|
|
177
|
+
class: D(["epic-tab cursor-pointer truncate", { checked: v.title === a.title }]),
|
|
178
|
+
key: b,
|
|
179
|
+
title: a.title,
|
|
180
|
+
onClick: (V) => l(a)
|
|
181
|
+
}, F(a.title), 11, ne)), 64))
|
|
176
182
|
]),
|
|
177
|
-
v.title === "静态" ? (p(),
|
|
178
|
-
|
|
179
|
-
[
|
|
183
|
+
v.title === "静态" ? (p(), _("div", oe, [
|
|
184
|
+
q(m("div", re, "暂无选项", 512), [
|
|
185
|
+
[G, !((h = n(i)) != null && h.length)]
|
|
180
186
|
]),
|
|
181
|
-
|
|
182
|
-
modelValue:
|
|
183
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
187
|
+
s(te, {
|
|
188
|
+
modelValue: n(i),
|
|
189
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => O(i) ? i.value = a : null)
|
|
184
190
|
}, null, 8, ["modelValue"]),
|
|
185
|
-
|
|
191
|
+
s(n(U), { onClick: r }, {
|
|
186
192
|
default: A(() => e[2] || (e[2] = [
|
|
187
|
-
|
|
193
|
+
H("添加选项")
|
|
188
194
|
])),
|
|
189
195
|
_: 1
|
|
190
196
|
})
|
|
191
|
-
])) : (p(),
|
|
197
|
+
])) : (p(), _("div", ie, [
|
|
192
198
|
e[3] || (e[3] = m("span", { style: { "font-size": "12px", "margin-bottom": "8px", display: "inline-block" } }, "数据源", -1)),
|
|
193
|
-
|
|
194
|
-
modelValue:
|
|
195
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
199
|
+
s(n(y), {
|
|
200
|
+
modelValue: n(o),
|
|
201
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => O(o) ? o.value = a : null),
|
|
196
202
|
placeholder: "请选择数据源",
|
|
197
203
|
clearable: "",
|
|
198
204
|
options: c.value,
|
|
199
|
-
onChange:
|
|
205
|
+
onChange: S
|
|
200
206
|
}, null, 8, ["modelValue", "options"])
|
|
201
207
|
]))
|
|
202
208
|
])
|
|
203
209
|
]);
|
|
204
210
|
};
|
|
205
211
|
}
|
|
206
|
-
}), Ve = /* @__PURE__ */ Z(ue, [["__scopeId", "data-v-
|
|
212
|
+
}), Ve = /* @__PURE__ */ Z(ue, [["__scopeId", "data-v-d74ef13d"]]);
|
|
207
213
|
export {
|
|
208
214
|
Ve as default
|
|
209
215
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./pluginManager-itCTrGag.cjs"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./pluginManager-itCTrGag.cjs"),c=require("./index-CFryUxKc.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;
|