form-designer-xinyi 1.5.5 → 1.5.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/core/components/builder/src/builder.vue.d.ts +3 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +275 -266
- package/package.json +1 -1
|
@@ -13,8 +13,10 @@ declare function validate(formName?: string): Promise<FormDataModel | boolean>;
|
|
|
13
13
|
/**
|
|
14
14
|
* 设置表单数据
|
|
15
15
|
* @param data
|
|
16
|
+
* @param formName
|
|
17
|
+
* @returns Promise<void>
|
|
16
18
|
*/
|
|
17
|
-
declare function setData(data: FormDataModel, formName?: string):
|
|
19
|
+
declare function setData(data: FormDataModel, formName?: string): Promise<void>;
|
|
18
20
|
/**
|
|
19
21
|
* 获取表单实例的异步函数
|
|
20
22
|
* @param {string} formName - 表单名称,默认为 'default'
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-eB0GTk5O.cjs"),e=require("vue"),t=require("./revoke-Bbm2vFx2.cjs");function R(){const{isDark:n}=
|
|
2
|
-
请添加表单组件后再尝试!`),console.error(v)}}return
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-eB0GTk5O.cjs"),e=require("vue"),t=require("./revoke-Bbm2vFx2.cjs");function R(){const{isDark:n}=_(),r=M.useToggle(n);return{isDark:n,toggleDark:r}}function A(){const n=e.ref(!1);return e.onMounted(()=>{T(n),q(n)}),e.watch(()=>n.value,()=>{n.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),{isDark:n}}function T(n){var r=document.documentElement;r&&(r.classList.contains("dark")?n.value=!0:n.value=!1)}function q(n){var r=document.querySelector("html"),a=new MutationObserver(function(s){for(var c of s)if(c.type==="attributes"&&c.attributeName==="class"){const p=c.target;new Array(...p.classList).includes("dark")?n.value=!0:n.value=!1}});a.observe(r,{attributes:!0,attributeFilter:["class"]}),e.onUnmounted(()=>{a.disconnect()})}function P(){const n=e.ref(1),r=e.ref(!1),{isDark:a}=A(),{pressSpace:s,pressShift:c,pressCtrl:p}=$();return{canvasScale:n,pressSpace:s,pressShift:c,pressCtrl:p,disabledZoom:r,isDark:a}}const _=M.createSharedComposable(P);function $(){const n=e.ref(!1),r=e.ref(!1),a=e.ref(!1);return M.onKeyDown(" ",s=>{var c=s.target;["INPUT","TEXTAREA"].includes(c.tagName)||s.preventDefault(),n.value=!0}),M.onKeyUp(" ",()=>{n.value=!1}),M.onKeyDown("Shift",s=>{s.preventDefault(),r.value=!0}),M.onKeyUp("Shift",()=>{r.value=!1}),M.onKeyDown("Control",s=>{s.preventDefault(),a.value=!0}),M.onKeyUp("Control",()=>{a.value=!1}),{pressSpace:n,pressShift:r,pressCtrl:a}}function U(n){const{pressSpace:r}=_();let a=0,s=0;function c(d){var f;a=d.x,s=d.y,(f=d.dataTransfer)==null||f.setDragImage(document.createElement("div"),0,0)}function p(d){if(d.preventDefault(),!d.x||!d.y||!r.value)return;const f=d.x-a,h=d.y-s;a=d.x,s=d.y,n.value&&(n.value.scrollTop-=h,n.value.scrollLeft-=f)}function y(){r.value=!1}return{handleElementDragStart:c,handleElementDrag:p,handleElementDragEnd:y}}function K(n){const{pressCtrl:r,canvasScale:a,disabledZoom:s}=_();function c(p){if(!r.value||s.value)return;p.preventDefault();let y=0;p.deltaY<0?y=a.value+.05:y=a.value-.05,!(y>150||y<.5)&&(a.value=y)}return e.watch(()=>a.value,p=>{n.value&&!s.value&&(n.value.style.transform=`scale(${p})`)}),{handleZoom:c,canvasScale:a}}function H(n,r=16.66){let a;function s(){c(),a=window.setInterval(n,r)}function c(){window.clearInterval(a)}return{startTimedQuery:s,stopTimedQuery:c}}function L(n,r){let a=null;return(...s)=>{a&&clearTimeout(a),a=setTimeout(()=>{n.apply(this,s)},r)}}function V(){const n=e.ref({}),r=e.ref({}),a=e.ref(!1),s=e.ref([]);function c(o){return n.value[o]}function p(o,l){n.value[o]=l}function y(o){delete n.value[o]}function d(o,l=!1){const m=Object.entries(t.pluginManager.publicMethods).reduce((v,[g,E])=>(v[g]=E.handler,v),{});try{new Function(`const epic = this;${o}`).bind({...m,getComponent:c,find:c,defineExpose:f,publicMethods:m,pluginManager:t.pluginManager})()}catch(v){l&&console.error("[epic-desinger:自定义函数]异常:",v)}}function f(o){o!=null&&(r.value=o)}function h(o,...l){o==null||o.forEach(m=>{var v,g,E;if(m.type==="public"&&((v=t.pluginManager.publicMethods[m.methodName])==null||v.handler(...l)),m.type==="custom"&&((E=(g=r.value)[m.methodName])==null||E.call(g,...l)),m.type==="component"){(m.componentId!=null&&c(m.componentId))[m.methodName](...m.args?JSON.parse(m.args):l);return}})}function C(o=!0){a.value=o}function D(o){const l=t.findSchemas(o,()=>!0);s.value=l.map(m=>m.id)}return{componentInstances:n,funcs:r,isDesignMode:a,defaultComponentIds:s,getComponentInstance:c,find:c,addComponentInstance:p,removeComponentInstance:y,setMethods:d,doActions:h,setDesignMode:C,setDefaultComponentIds:D}}const O={key:0,class:"epic-loading-box"},Z={class:"epic-builder-main"},z={class:"epic-loading-box"},F=e.defineComponent({__name:"builder",props:{pageSchema:{},disabled:{type:Boolean}},emits:["ready"],setup(n,{expose:r,emit:a}){const s=t.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Da6i5WD2.cjs"))),c=V(),p=a,y=e.useSlots(),d=e.ref({}),f=e.ref(!1),h=n,C=e.reactive({schemas:[]});e.watch(()=>h.pageSchema,u=>{t.deepCompareAndModify(C,u)},{immediate:!0,deep:!0}),e.watch(()=>C.script,u=>{u&&u!==""&&c.setMethods(u,!0)},{immediate:!0}),e.provide("slots",y),e.provide("pageManager",c),e.provide("forms",d),e.provide("pageSchema",C),e.provide("disabled",e.computed(()=>h.disabled));function D(u="default"){return new Promise(async(w,k)=>{var b;if(!f.value){const B=e.watch(f,async()=>{B(),w(await D(u))});return}const S=(b=d.value)==null?void 0:b[u];if(!S)return k(`表单 [name=${u}] 不存在`),!1;const x=t.deepClone(await S.getData());w(x)})}function o(u="default"){return new Promise(async(w,k)=>{var x;if(!f.value){const b=e.watch(f,async()=>{b(),w(await o(u))});return}const S=(x=d.value)==null?void 0:x[u];if(!S)return k(`表单 [name=${u}] 不存在`),!1;try{await S.validate();const b=await S.getData();w(b)}catch(b){k(b)}})}function l(u,w="default"){return new Promise(k=>{if(!f.value){const S=e.watch(f,()=>{S(),e.nextTick(()=>{m(u,w),k()})});return}e.nextTick(()=>{m(u,w),k()})})}function m(u,w="default"){var S;const k=(S=d.value)==null?void 0:S[w];if(!k)return console.error(`表单 [name=${w}] 不存在`),!1;k.setData(u)}function v(u="default"){return new Promise(async(w,k)=>{var x;if(!f.value){const b=e.watch(f,async()=>{b(),w(await v(u))});return}const S=(x=d.value)==null?void 0:x[u];if(!S)return k(`表单 [name=${u}] 不存在`),!1;w(S)})}const{proxy:g}=e.getCurrentInstance();function E(){e.nextTick(()=>{f.value=!0,p("ready",c),g&&c.addComponentInstance("builder",g)})}return r({ready:f,getData:D,setData:l,validate:o,getFormInstance:v}),(u,w)=>e.unref(t.pluginManager).initialized.value?(e.openBlock(),e.createBlock(e.Suspense,{key:1,onResolve:E},{default:e.withCtx(()=>[e.createElementVNode("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.schemas,(k,S)=>(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:S,componentSchema:k},null,8,["componentSchema"]))),128))])]),fallback:e.withCtx(()=>[e.createElementVNode("div",z,[e.createVNode(e.unref(s))])]),_:1})):(e.openBlock(),e.createElementBlock("div",O))}}),Q={class:"min-w-750px rounded"},X={class:"h-full rounded"},Y=e.defineComponent({__name:"index",setup(n,{expose:r}){const a=t.pluginManager.getComponent("monacoEditor"),s=t.pluginManager.getComponent("modal"),c=e.ref(null),p=e.ref(!1),y=e.ref(!1),d=e.ref({}),f=e.inject("pageSchema"),h=e.ref(null),C=e.ref("");function D(){y.value=!1}function o(){p.value=!1}function l(){p.value=!0,C.value=t.getUUID()}async function m(){try{const v=await h.value.validate();console.log("表单结果为:",v),d.value=JSON.stringify(v,null,2),e.nextTick(()=>{var g;(g=c.value)==null||g.setValue(d.value)}),y.value=!0}catch(v){typeof v=="string"&&alert(v+`\r
|
|
2
|
+
请添加表单组件后再尝试!`),console.error(v)}}return r({handleOpen:l}),(v,g)=>(e.openBlock(),e.createBlock(e.unref(s),{modelValue:p.value,"onUpdate:modelValue":g[1]||(g[1]=E=>p.value=E),title:"预览",class:"w-900px",width:"900px",onClose:o,onOk:m,okText:"输出结果"},{default:e.withCtx(()=>[e.createElementVNode("div",Q,[(e.openBlock(),e.createBlock(e.unref(F),{key:C.value,ref_key:"kb",ref:h,"page-schema":e.unref(f)},null,8,["page-schema"])),e.createVNode(e.unref(s),{modelValue:y.value,"onUpdate:modelValue":g[0]||(g[0]=E=>y.value=E),title:"表单数据",class:"w-860px",width:"860px",onClose:D,onOk:D},{default:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(e.unref(a),{ref_key:"monacoEditorRef",ref:c,autoToggleTheme:"",class:"h-full editor","model-value":d.value},null,8,["model-value"])])]),_:1},8,["modelValue"])])]),_:1},8,["modelValue"]))}}),j={key:0,class:"epic-loading-box"},J={class:"epic-designer-main"},G={class:"epic-header-container"},W={class:"epic-loading-box"},ee=e.defineComponent({__name:"designer",props:{disabledZoom:{type:Boolean,default:!1},hiddenHeader:{type:Boolean,default:!1},lockDefaultSchemaEdit:{type:Boolean,default:!1},title:{default:"EpicDesigner默认项目"},defaultSchema:{default:()=>({schemas:[{type:"page",id:"root",label:"页面",children:[],componentProps:{style:{padding:"16px"}}}],script:`const { defineExpose, find } = epic;
|
|
3
3
|
|
|
4
4
|
function test (){
|
|
5
5
|
console.log('test')
|
|
@@ -8,4 +8,4 @@ function test (){
|
|
|
8
8
|
// 通过defineExpose暴露的函数或者属性
|
|
9
9
|
defineExpose({
|
|
10
10
|
test
|
|
11
|
-
})`})}},emits:["ready","save","reset","toggleDeviceMode"],setup(n,{expose:
|
|
11
|
+
})`})}},emits:["ready","save","reset","toggleDeviceMode"],setup(n,{expose:r,emit:a}){const s=t.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-n2IR3pLH.cjs"))),c=t.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-fsDcHxrd.cjs"))),p=t.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Bcut6lHO.cjs"))),y=t.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BsH-8kV3.cjs"))),d=t.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Da6i5WD2.cjs"))),f=V(),h=n;f.setDesignMode(),f.setDefaultComponentIds(h.defaultSchema.schemas);const C=a,D=e.ref(null),o=e.reactive({checkedNode:null,hoverNode:null,disableHover:!1,matched:[]}),l=e.reactive({schemas:[],script:h.defaultSchema.script}),{disabledZoom:m}=_();e.watch(()=>h.disabledZoom,i=>{m.value=i},{immediate:!0}),e.watch(()=>l.script,i=>{i&&i!==""&&f.setMethods(i)},{immediate:!0}),e.provide("pageSchema",l),e.provide("pageManager",f),e.provide("designerProps",e.computed(()=>h)),e.provide("designer",{setCheckedNode:g,setHoverNode:E,setDisableHover:w,handleToggleDeviceMode:B,reset:x,state:o});function v(){l.schemas=t.deepClone(h.defaultSchema.schemas),g(l.schemas[0]),t.revoke.push(l.schemas,"初始化撤销功能")}async function g(i=l.schemas[0]){o.checkedNode=i,o.matched=t.getMatchedById(l.schemas,i.id)}async function E(i=null){var N;if(!i||o.disableHover)return o.hoverNode=null,!1;if((i==null?void 0:i.id)===((N=o.hoverNode)==null?void 0:N.id))return!1;o.hoverNode=i}function u(){e.nextTick(()=>{C("ready",{pageManager:f})})}async function w(i=!1){o.disableHover=i}function k(i){t.deepCompareAndModify(l,i)}function S(){return e.toRaw(l)}function x(){t.deepEqual(l.schemas,h.defaultSchema.schemas)&&l.script===h.defaultSchema.script||(t.deepCompareAndModify(l.schemas,h.defaultSchema.schemas),l.script=h.defaultSchema.script,g(l.schemas[0]),t.revoke.push(l.schemas,"重置操作"),C("reset",l))}function b(){C("save",e.toRaw(l))}function B(i){C("toggleDeviceMode",i)}function I(){D.value.handleOpen()}return v(),r({setData:k,getData:S,reset:x,preview:I}),(i,N)=>e.unref(t.pluginManager).initialized.value?(e.openBlock(),e.createBlock(e.Suspense,{key:1,onResolve:u},{default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createElementVNode("div",G,[e.renderSlot(i.$slots,"header",{},()=>[h.hiddenHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(s),{key:0,onPreview:I,onSave:b},{header:e.withCtx(()=>[e.renderSlot(i.$slots,"header-prefix")]),prefix:e.withCtx(()=>[e.renderSlot(i.$slots,"header-prefix")]),title:e.withCtx(()=>[e.renderSlot(i.$slots,"header-title")]),"right-prefix":e.withCtx(()=>[e.renderSlot(i.$slots,"header-right-prefix")]),"right-action":e.withCtx(()=>[e.renderSlot(i.$slots,"header-right-action")]),"right-suffix":e.withCtx(()=>[e.renderSlot(i.$slots,"header-right-suffix")]),_:3}))])]),e.createElementVNode("div",{class:e.normalizeClass(["epic-split-view-container",{"hidden-header":i.hiddenHeader}])},[e.createVNode(e.unref(c)),e.createVNode(e.unref(p)),e.createVNode(e.unref(y))],2),e.createVNode(Y,{ref_key:"previewRef",ref:D},null,512)])]),fallback:e.withCtx(()=>[e.createElementVNode("div",W,[e.createVNode(e.unref(d))])]),_:3})):(e.openBlock(),e.createElementBlock("div",j))}});exports.ENode=M._sfc_main;exports.PluginManager=t.PluginManager;exports.capitalizeFirstLetter=t.capitalizeFirstLetter;exports.convertKFormData=t.convertKFormData;exports.deepClone=t.deepClone;exports.deepCompareAndModify=t.deepCompareAndModify;exports.deepEqual=t.deepEqual;exports.findSchemaById=t.findSchemaById;exports.findSchemaInfoById=t.findSchemaInfoById;exports.findSchemas=t.findSchemas;exports.generateNewSchema=t.generateNewSchema;exports.getAttributeValue=t.getAttributeValue;exports.getFormFields=t.getFormFields;exports.getFormSchemas=t.getFormSchemas;exports.getMatchedById=t.getMatchedById;exports.getUUID=t.getUUID;exports.loadAsyncComponent=t.loadAsyncComponent;exports.mapSchemas=t.mapSchemas;exports.pluginManager=t.pluginManager;exports.recursionConvertedNode=t.recursionConvertedNode;exports.revoke=t.revoke;exports.setAttributeValue=t.setAttributeValue;exports.useRevoke=t.useRevoke;exports.EBuilder=F;exports.EDesigner=ee;exports.debounce=L;exports.getDarkState=T;exports.useDark=A;exports.useElementDrag=U;exports.useElementZoom=K;exports.useKeyPress=$;exports.usePageManager=V;exports.useShareStore=_;exports.useStore=P;exports.useTheme=R;exports.useTimedQuery=H;
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { u as ee, c as te, o as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { p as
|
|
1
|
+
import { u as ee, c as te, o as O, a as U, _ as ae } from "./index-DcCbSncC.js";
|
|
2
|
+
import { ref as v, onMounted as ne, watch as M, onUnmounted as se, defineComponent as q, useSlots as oe, reactive as Z, provide as I, computed as j, getCurrentInstance as re, unref as w, openBlock as $, createElementBlock as K, createBlock as R, Suspense as J, withCtx as E, createElementVNode as N, Fragment as le, renderList as ie, createVNode as T, nextTick as A, inject as ce, renderSlot as V, createCommentVNode as ue, normalizeClass as de, toRaw as X } from "vue";
|
|
3
|
+
import { p as B, f as fe, l as P, d as z, a as G, g as me, b as pe, c as he, r as Y } from "./revoke-iScTU0eW.js";
|
|
4
4
|
import { P as Ze, t as Ke, o as ze, k as qe, n as Qe, e as Xe, h as Ye, i as je, j as Je, m as Ge, q as We, s as et, u as tt } from "./revoke-iScTU0eW.js";
|
|
5
5
|
function Pe() {
|
|
6
|
-
const { isDark: e } =
|
|
6
|
+
const { isDark: e } = H(), n = ee(e);
|
|
7
7
|
return {
|
|
8
8
|
isDark: e,
|
|
9
|
-
toggleDark:
|
|
9
|
+
toggleDark: n
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function ve() {
|
|
13
|
-
const e =
|
|
13
|
+
const e = v(!1);
|
|
14
14
|
return ne(() => {
|
|
15
15
|
ge(e), ye(e);
|
|
16
|
-
}),
|
|
16
|
+
}), M(
|
|
17
17
|
() => e.value,
|
|
18
18
|
() => {
|
|
19
19
|
e.value ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
@@ -23,18 +23,18 @@ function ve() {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function ge(e) {
|
|
26
|
-
var
|
|
27
|
-
|
|
26
|
+
var n = document.documentElement;
|
|
27
|
+
n && (n.classList.contains("dark") ? e.value = !0 : e.value = !1);
|
|
28
28
|
}
|
|
29
29
|
function ye(e) {
|
|
30
|
-
var
|
|
31
|
-
for (var
|
|
32
|
-
if (
|
|
33
|
-
const f =
|
|
30
|
+
var n = document.querySelector("html"), t = new MutationObserver(function(s) {
|
|
31
|
+
for (var r of s)
|
|
32
|
+
if (r.type === "attributes" && r.attributeName === "class") {
|
|
33
|
+
const f = r.target;
|
|
34
34
|
new Array(...f.classList).includes("dark") ? e.value = !0 : e.value = !1;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
t.observe(
|
|
37
|
+
t.observe(n, {
|
|
38
38
|
attributes: !0,
|
|
39
39
|
attributeFilter: ["class"]
|
|
40
40
|
}), se(() => {
|
|
@@ -42,305 +42,314 @@ function ye(e) {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
function Se() {
|
|
45
|
-
const e =
|
|
45
|
+
const e = v(1), n = v(!1), { isDark: t } = ve(), { pressSpace: s, pressShift: r, pressCtrl: f } = be();
|
|
46
46
|
return {
|
|
47
47
|
canvasScale: e,
|
|
48
|
-
pressSpace:
|
|
49
|
-
pressShift:
|
|
48
|
+
pressSpace: s,
|
|
49
|
+
pressShift: r,
|
|
50
50
|
pressCtrl: f,
|
|
51
|
-
disabledZoom:
|
|
51
|
+
disabledZoom: n,
|
|
52
52
|
isDark: t
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const H = te(Se);
|
|
56
56
|
function be() {
|
|
57
|
-
const e =
|
|
58
|
-
return
|
|
59
|
-
var
|
|
60
|
-
["INPUT", "TEXTAREA"].includes(
|
|
61
|
-
}),
|
|
57
|
+
const e = v(!1), n = v(!1), t = v(!1);
|
|
58
|
+
return O(" ", (s) => {
|
|
59
|
+
var r = s.target;
|
|
60
|
+
["INPUT", "TEXTAREA"].includes(r.tagName) || s.preventDefault(), e.value = !0;
|
|
61
|
+
}), U(" ", () => {
|
|
62
62
|
e.value = !1;
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
}),
|
|
68
|
-
|
|
69
|
-
}),
|
|
63
|
+
}), O("Shift", (s) => {
|
|
64
|
+
s.preventDefault(), n.value = !0;
|
|
65
|
+
}), U("Shift", () => {
|
|
66
|
+
n.value = !1;
|
|
67
|
+
}), O("Control", (s) => {
|
|
68
|
+
s.preventDefault(), t.value = !0;
|
|
69
|
+
}), U("Control", () => {
|
|
70
70
|
t.value = !1;
|
|
71
|
-
}), { pressSpace: e, pressShift:
|
|
71
|
+
}), { pressSpace: e, pressShift: n, pressCtrl: t };
|
|
72
72
|
}
|
|
73
73
|
function Re(e) {
|
|
74
|
-
const { pressSpace:
|
|
75
|
-
let t = 0,
|
|
76
|
-
function
|
|
74
|
+
const { pressSpace: n } = H();
|
|
75
|
+
let t = 0, s = 0;
|
|
76
|
+
function r(c) {
|
|
77
77
|
var u;
|
|
78
|
-
t = c.x,
|
|
78
|
+
t = c.x, s = c.y, (u = c.dataTransfer) == null || u.setDragImage(document.createElement("div"), 0, 0);
|
|
79
79
|
}
|
|
80
80
|
function f(c) {
|
|
81
|
-
if (c.preventDefault(), !c.x || !c.y || !
|
|
81
|
+
if (c.preventDefault(), !c.x || !c.y || !n.value)
|
|
82
82
|
return;
|
|
83
|
-
const u = c.x - t, m = c.y -
|
|
84
|
-
t = c.x,
|
|
83
|
+
const u = c.x - t, m = c.y - s;
|
|
84
|
+
t = c.x, s = c.y, e.value && (e.value.scrollTop -= m, e.value.scrollLeft -= u);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
86
|
+
function g() {
|
|
87
|
+
n.value = !1;
|
|
88
88
|
}
|
|
89
|
-
return { handleElementDragStart:
|
|
89
|
+
return { handleElementDragStart: r, handleElementDrag: f, handleElementDragEnd: g };
|
|
90
90
|
}
|
|
91
91
|
function Ae(e) {
|
|
92
|
-
const { pressCtrl:
|
|
93
|
-
function
|
|
94
|
-
if (!
|
|
92
|
+
const { pressCtrl: n, canvasScale: t, disabledZoom: s } = H();
|
|
93
|
+
function r(f) {
|
|
94
|
+
if (!n.value || s.value)
|
|
95
95
|
return;
|
|
96
96
|
f.preventDefault();
|
|
97
|
-
let
|
|
98
|
-
f.deltaY < 0 ?
|
|
97
|
+
let g = 0;
|
|
98
|
+
f.deltaY < 0 ? g = t.value + 0.05 : g = t.value - 0.05, !(g > 150 || g < 0.5) && (t.value = g);
|
|
99
99
|
}
|
|
100
|
-
return
|
|
100
|
+
return M(
|
|
101
101
|
() => t.value,
|
|
102
102
|
(f) => {
|
|
103
|
-
e.value && !
|
|
103
|
+
e.value && !s.value && (e.value.style.transform = `scale(${f})`);
|
|
104
104
|
}
|
|
105
|
-
), { handleZoom:
|
|
105
|
+
), { handleZoom: r, canvasScale: t };
|
|
106
106
|
}
|
|
107
|
-
function He(e,
|
|
107
|
+
function He(e, n = 16.66) {
|
|
108
108
|
let t;
|
|
109
|
-
function
|
|
110
|
-
|
|
109
|
+
function s() {
|
|
110
|
+
r(), t = window.setInterval(e, n);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function r() {
|
|
113
113
|
window.clearInterval(t);
|
|
114
114
|
}
|
|
115
115
|
return {
|
|
116
|
-
startTimedQuery:
|
|
117
|
-
stopTimedQuery:
|
|
116
|
+
startTimedQuery: s,
|
|
117
|
+
stopTimedQuery: r
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function Fe(e,
|
|
120
|
+
function Fe(e, n) {
|
|
121
121
|
let t = null;
|
|
122
|
-
return (...
|
|
122
|
+
return (...s) => {
|
|
123
123
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
124
|
-
e.apply(this,
|
|
125
|
-
},
|
|
124
|
+
e.apply(this, s);
|
|
125
|
+
}, n);
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const e =
|
|
130
|
-
function
|
|
128
|
+
function W() {
|
|
129
|
+
const e = v({}), n = v({}), t = v(!1), s = v([]);
|
|
130
|
+
function r(a) {
|
|
131
131
|
return e.value[a];
|
|
132
132
|
}
|
|
133
|
-
function f(a,
|
|
134
|
-
e.value[a] =
|
|
133
|
+
function f(a, o) {
|
|
134
|
+
e.value[a] = o;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function g(a) {
|
|
137
137
|
delete e.value[a];
|
|
138
138
|
}
|
|
139
|
-
function c(a,
|
|
139
|
+
function c(a, o = !1) {
|
|
140
140
|
const d = Object.entries(
|
|
141
|
-
|
|
142
|
-
).reduce((p, [
|
|
141
|
+
B.publicMethods
|
|
142
|
+
).reduce((p, [h, k]) => (p[h] = k.handler, p), {});
|
|
143
143
|
try {
|
|
144
144
|
new Function(`const epic = this;${a}`).bind({
|
|
145
145
|
...d,
|
|
146
|
-
getComponent:
|
|
147
|
-
find:
|
|
146
|
+
getComponent: r,
|
|
147
|
+
find: r,
|
|
148
148
|
defineExpose: u,
|
|
149
149
|
publicMethods: d,
|
|
150
|
-
pluginManager:
|
|
150
|
+
pluginManager: B
|
|
151
151
|
})();
|
|
152
152
|
} catch (p) {
|
|
153
|
-
|
|
153
|
+
o && console.error("[epic-desinger:自定义函数]异常:", p);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function u(a) {
|
|
157
|
-
a != null && (
|
|
157
|
+
a != null && (n.value = a);
|
|
158
158
|
}
|
|
159
|
-
function m(a, ...
|
|
159
|
+
function m(a, ...o) {
|
|
160
160
|
a == null || a.forEach((d) => {
|
|
161
|
-
var p,
|
|
162
|
-
if (d.type === "public" && ((p =
|
|
163
|
-
(d.componentId != null &&
|
|
164
|
-
...d.args ? JSON.parse(d.args) :
|
|
161
|
+
var p, h, k;
|
|
162
|
+
if (d.type === "public" && ((p = B.publicMethods[d.methodName]) == null || p.handler(...o)), d.type === "custom" && ((k = (h = n.value)[d.methodName]) == null || k.call(h, ...o)), d.type === "component") {
|
|
163
|
+
(d.componentId != null && r(d.componentId))[d.methodName](
|
|
164
|
+
...d.args ? JSON.parse(d.args) : o
|
|
165
165
|
);
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function D(a = !0) {
|
|
171
171
|
t.value = a;
|
|
172
172
|
}
|
|
173
173
|
function x(a) {
|
|
174
|
-
const
|
|
175
|
-
|
|
174
|
+
const o = fe(a, () => !0);
|
|
175
|
+
s.value = o.map((d) => d.id);
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
178
178
|
componentInstances: e,
|
|
179
|
-
funcs:
|
|
179
|
+
funcs: n,
|
|
180
180
|
isDesignMode: t,
|
|
181
|
-
defaultComponentIds:
|
|
182
|
-
getComponentInstance:
|
|
181
|
+
defaultComponentIds: s,
|
|
182
|
+
getComponentInstance: r,
|
|
183
183
|
// 简化查询函数, 推荐使用
|
|
184
|
-
find:
|
|
184
|
+
find: r,
|
|
185
185
|
addComponentInstance: f,
|
|
186
|
-
removeComponentInstance:
|
|
186
|
+
removeComponentInstance: g,
|
|
187
187
|
setMethods: c,
|
|
188
188
|
doActions: m,
|
|
189
|
-
setDesignMode:
|
|
189
|
+
setDesignMode: D,
|
|
190
190
|
setDefaultComponentIds: x
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
const De = {
|
|
194
194
|
key: 0,
|
|
195
195
|
class: "epic-loading-box"
|
|
196
|
-
}, we = { class: "epic-builder-main" }, ke = { class: "epic-loading-box" }, _e = /* @__PURE__ */
|
|
196
|
+
}, we = { class: "epic-builder-main" }, ke = { class: "epic-loading-box" }, _e = /* @__PURE__ */ q({
|
|
197
197
|
__name: "builder",
|
|
198
198
|
props: {
|
|
199
199
|
pageSchema: {},
|
|
200
200
|
disabled: { type: Boolean }
|
|
201
201
|
},
|
|
202
202
|
emits: ["ready"],
|
|
203
|
-
setup(e, { expose:
|
|
204
|
-
const
|
|
203
|
+
setup(e, { expose: n, emit: t }) {
|
|
204
|
+
const s = P(() => import("./index-B4P9zbh-.js")), r = W(), f = t, g = oe(), c = v({}), u = v(!1), m = e, D = Z({
|
|
205
205
|
schemas: []
|
|
206
206
|
});
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
M(() => m.pageSchema, (i) => {
|
|
208
|
+
z(D, i);
|
|
209
209
|
}, {
|
|
210
210
|
immediate: !0,
|
|
211
211
|
deep: !0
|
|
212
|
-
}),
|
|
213
|
-
|
|
212
|
+
}), M(() => D.script, (i) => {
|
|
213
|
+
i && i !== "" && r.setMethods(i, !0);
|
|
214
214
|
}, {
|
|
215
215
|
immediate: !0
|
|
216
|
-
}),
|
|
217
|
-
function x(
|
|
218
|
-
return new Promise(async (
|
|
219
|
-
var
|
|
216
|
+
}), I("slots", g), I("pageManager", r), I("forms", c), I("pageSchema", D), I("disabled", j(() => m.disabled));
|
|
217
|
+
function x(i = "default") {
|
|
218
|
+
return new Promise(async (S, b) => {
|
|
219
|
+
var _;
|
|
220
220
|
if (!u.value) {
|
|
221
|
-
const
|
|
222
|
-
|
|
221
|
+
const F = M(u, async () => {
|
|
222
|
+
F(), S(await x(i));
|
|
223
223
|
});
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
228
|
-
return
|
|
229
|
-
const
|
|
230
|
-
|
|
226
|
+
const y = (_ = c.value) == null ? void 0 : _[i];
|
|
227
|
+
if (!y)
|
|
228
|
+
return b(`表单 [name=${i}] 不存在`), !1;
|
|
229
|
+
const C = G(await y.getData());
|
|
230
|
+
S(C);
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
function a(
|
|
234
|
-
return new Promise(async (
|
|
235
|
-
var
|
|
233
|
+
function a(i = "default") {
|
|
234
|
+
return new Promise(async (S, b) => {
|
|
235
|
+
var C;
|
|
236
236
|
if (!u.value) {
|
|
237
|
-
const
|
|
238
|
-
|
|
237
|
+
const _ = M(u, async () => {
|
|
238
|
+
_(), S(await a(i));
|
|
239
239
|
});
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
|
-
const
|
|
243
|
-
if (!
|
|
244
|
-
return
|
|
242
|
+
const y = (C = c.value) == null ? void 0 : C[i];
|
|
243
|
+
if (!y)
|
|
244
|
+
return b(`表单 [name=${i}] 不存在`), !1;
|
|
245
245
|
try {
|
|
246
|
-
await
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
} catch (
|
|
250
|
-
|
|
246
|
+
await y.validate();
|
|
247
|
+
const _ = await y.getData();
|
|
248
|
+
S(_);
|
|
249
|
+
} catch (_) {
|
|
250
|
+
b(_);
|
|
251
251
|
}
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
function o(i, S = "default") {
|
|
255
|
+
return new Promise((b) => {
|
|
256
|
+
if (!u.value) {
|
|
257
|
+
const y = M(u, () => {
|
|
258
|
+
y(), A(() => {
|
|
259
|
+
d(i, S), b();
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
A(() => {
|
|
265
|
+
d(i, S), b();
|
|
259
266
|
});
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
const w = (S = c.value) == null ? void 0 : S[y];
|
|
263
|
-
if (!w)
|
|
264
|
-
return console.error(`表单 [name=${y}] 不存在`), !1;
|
|
265
|
-
w.setData(s);
|
|
267
|
+
});
|
|
266
268
|
}
|
|
267
|
-
function d(
|
|
268
|
-
|
|
269
|
-
|
|
269
|
+
function d(i, S = "default") {
|
|
270
|
+
var y;
|
|
271
|
+
const b = (y = c.value) == null ? void 0 : y[S];
|
|
272
|
+
if (!b)
|
|
273
|
+
return console.error(`表单 [name=${S}] 不存在`), !1;
|
|
274
|
+
b.setData(i);
|
|
275
|
+
}
|
|
276
|
+
function p(i = "default") {
|
|
277
|
+
return new Promise(async (S, b) => {
|
|
278
|
+
var C;
|
|
270
279
|
if (!u.value) {
|
|
271
|
-
const
|
|
272
|
-
|
|
280
|
+
const _ = M(u, async () => {
|
|
281
|
+
_(), S(await p(i));
|
|
273
282
|
});
|
|
274
283
|
return;
|
|
275
284
|
}
|
|
276
|
-
const
|
|
277
|
-
if (!
|
|
278
|
-
return
|
|
279
|
-
y
|
|
285
|
+
const y = (C = c.value) == null ? void 0 : C[i];
|
|
286
|
+
if (!y)
|
|
287
|
+
return b(`表单 [name=${i}] 不存在`), !1;
|
|
288
|
+
S(y);
|
|
280
289
|
});
|
|
281
290
|
}
|
|
282
|
-
const { proxy:
|
|
283
|
-
function
|
|
284
|
-
|
|
285
|
-
u.value = !0, f("ready",
|
|
291
|
+
const { proxy: h } = re();
|
|
292
|
+
function k() {
|
|
293
|
+
A(() => {
|
|
294
|
+
u.value = !0, f("ready", r), h && r.addComponentInstance("builder", h);
|
|
286
295
|
});
|
|
287
296
|
}
|
|
288
|
-
return
|
|
297
|
+
return n({
|
|
289
298
|
ready: u,
|
|
290
299
|
getData: x,
|
|
291
|
-
setData:
|
|
300
|
+
setData: o,
|
|
292
301
|
validate: a,
|
|
293
|
-
getFormInstance:
|
|
294
|
-
}), (
|
|
302
|
+
getFormInstance: p
|
|
303
|
+
}), (i, S) => w(B).initialized.value ? ($(), R(J, {
|
|
295
304
|
key: 1,
|
|
296
|
-
onResolve:
|
|
305
|
+
onResolve: k
|
|
297
306
|
}, {
|
|
298
|
-
default:
|
|
299
|
-
|
|
300
|
-
(
|
|
301
|
-
key:
|
|
302
|
-
componentSchema:
|
|
307
|
+
default: E(() => [
|
|
308
|
+
N("div", we, [
|
|
309
|
+
($(!0), K(le, null, ie(D.schemas, (b, y) => ($(), R(w(ae), {
|
|
310
|
+
key: y,
|
|
311
|
+
componentSchema: b
|
|
303
312
|
}, null, 8, ["componentSchema"]))), 128))
|
|
304
313
|
])
|
|
305
314
|
]),
|
|
306
|
-
fallback:
|
|
307
|
-
|
|
308
|
-
|
|
315
|
+
fallback: E(() => [
|
|
316
|
+
N("div", ke, [
|
|
317
|
+
T(w(s))
|
|
309
318
|
])
|
|
310
319
|
]),
|
|
311
320
|
_: 1
|
|
312
|
-
})) : (
|
|
321
|
+
})) : ($(), K("div", De));
|
|
313
322
|
}
|
|
314
|
-
}), Ee = { class: "min-w-750px rounded" }, xe = { class: "h-full rounded" }, Ce = /* @__PURE__ */
|
|
323
|
+
}), Ee = { class: "min-w-750px rounded" }, xe = { class: "h-full rounded" }, Ce = /* @__PURE__ */ q({
|
|
315
324
|
__name: "index",
|
|
316
|
-
setup(e, { expose:
|
|
317
|
-
const t =
|
|
325
|
+
setup(e, { expose: n }) {
|
|
326
|
+
const t = B.getComponent("monacoEditor"), s = B.getComponent("modal"), r = v(null), f = v(!1), g = v(!1), c = v({}), u = ce("pageSchema"), m = v(null), D = v("");
|
|
318
327
|
function x() {
|
|
319
|
-
|
|
328
|
+
g.value = !1;
|
|
320
329
|
}
|
|
321
330
|
function a() {
|
|
322
331
|
f.value = !1;
|
|
323
332
|
}
|
|
324
|
-
function
|
|
325
|
-
f.value = !0,
|
|
333
|
+
function o() {
|
|
334
|
+
f.value = !0, D.value = me();
|
|
326
335
|
}
|
|
327
336
|
async function d() {
|
|
328
337
|
try {
|
|
329
338
|
const p = await m.value.validate();
|
|
330
|
-
console.log("表单结果为:", p), c.value = JSON.stringify(p, null, 2),
|
|
331
|
-
var
|
|
332
|
-
(
|
|
333
|
-
}),
|
|
339
|
+
console.log("表单结果为:", p), c.value = JSON.stringify(p, null, 2), A(() => {
|
|
340
|
+
var h;
|
|
341
|
+
(h = r.value) == null || h.setValue(c.value);
|
|
342
|
+
}), g.value = !0;
|
|
334
343
|
} catch (p) {
|
|
335
344
|
typeof p == "string" && alert(p + `\r
|
|
336
345
|
请添加表单组件后再尝试!`), console.error(p);
|
|
337
346
|
}
|
|
338
347
|
}
|
|
339
|
-
return
|
|
340
|
-
handleOpen:
|
|
341
|
-
}), (p,
|
|
348
|
+
return n({
|
|
349
|
+
handleOpen: o
|
|
350
|
+
}), (p, h) => ($(), R(w(s), {
|
|
342
351
|
modelValue: f.value,
|
|
343
|
-
"onUpdate:modelValue":
|
|
352
|
+
"onUpdate:modelValue": h[1] || (h[1] = (k) => f.value = k),
|
|
344
353
|
title: "预览",
|
|
345
354
|
class: "w-900px",
|
|
346
355
|
width: "900px",
|
|
@@ -348,28 +357,28 @@ const De = {
|
|
|
348
357
|
onOk: d,
|
|
349
358
|
okText: "输出结果"
|
|
350
359
|
}, {
|
|
351
|
-
default:
|
|
352
|
-
|
|
353
|
-
(
|
|
354
|
-
key:
|
|
360
|
+
default: E(() => [
|
|
361
|
+
N("div", Ee, [
|
|
362
|
+
($(), R(w(_e), {
|
|
363
|
+
key: D.value,
|
|
355
364
|
ref_key: "kb",
|
|
356
365
|
ref: m,
|
|
357
|
-
"page-schema":
|
|
366
|
+
"page-schema": w(u)
|
|
358
367
|
}, null, 8, ["page-schema"])),
|
|
359
|
-
|
|
360
|
-
modelValue:
|
|
361
|
-
"onUpdate:modelValue":
|
|
368
|
+
T(w(s), {
|
|
369
|
+
modelValue: g.value,
|
|
370
|
+
"onUpdate:modelValue": h[0] || (h[0] = (k) => g.value = k),
|
|
362
371
|
title: "表单数据",
|
|
363
372
|
class: "w-860px",
|
|
364
373
|
width: "860px",
|
|
365
374
|
onClose: x,
|
|
366
375
|
onOk: x
|
|
367
376
|
}, {
|
|
368
|
-
default:
|
|
369
|
-
|
|
370
|
-
|
|
377
|
+
default: E(() => [
|
|
378
|
+
N("div", xe, [
|
|
379
|
+
T(w(t), {
|
|
371
380
|
ref_key: "monacoEditorRef",
|
|
372
|
-
ref:
|
|
381
|
+
ref: r,
|
|
373
382
|
autoToggleTheme: "",
|
|
374
383
|
class: "h-full editor",
|
|
375
384
|
"model-value": c.value
|
|
@@ -386,7 +395,7 @@ const De = {
|
|
|
386
395
|
}), Me = {
|
|
387
396
|
key: 0,
|
|
388
397
|
class: "epic-loading-box"
|
|
389
|
-
}, Ie = { class: "epic-designer-main" }, $e = { class: "epic-header-container" }, Te = { class: "epic-loading-box" }, Le = /* @__PURE__ */
|
|
398
|
+
}, Ie = { class: "epic-designer-main" }, $e = { class: "epic-header-container" }, Te = { class: "epic-loading-box" }, Le = /* @__PURE__ */ q({
|
|
390
399
|
__name: "designer",
|
|
391
400
|
props: {
|
|
392
401
|
disabledZoom: { type: Boolean, default: !1 },
|
|
@@ -418,134 +427,134 @@ defineExpose({
|
|
|
418
427
|
}) }
|
|
419
428
|
},
|
|
420
429
|
emits: ["ready", "save", "reset", "toggleDeviceMode"],
|
|
421
|
-
setup(e, { expose:
|
|
422
|
-
const
|
|
430
|
+
setup(e, { expose: n, emit: t }) {
|
|
431
|
+
const s = P(() => import("./index-DHI4gLFF.js")), r = P(() => import("./index-H4zzFoVP.js")), f = P(() => import("./index-C6uorzgq.js")), g = P(() => import("./index-DWCjsALD.js")), c = P(() => import("./index-B4P9zbh-.js")), u = W(), m = e;
|
|
423
432
|
u.setDesignMode(), u.setDefaultComponentIds(m.defaultSchema.schemas);
|
|
424
|
-
const
|
|
433
|
+
const D = t, x = v(null), a = Z({
|
|
425
434
|
checkedNode: null,
|
|
426
435
|
hoverNode: null,
|
|
427
436
|
disableHover: !1,
|
|
428
437
|
matched: []
|
|
429
|
-
}),
|
|
438
|
+
}), o = Z({
|
|
430
439
|
schemas: [],
|
|
431
440
|
script: m.defaultSchema.script
|
|
432
|
-
}), { disabledZoom: d } =
|
|
433
|
-
|
|
434
|
-
d.value =
|
|
441
|
+
}), { disabledZoom: d } = H();
|
|
442
|
+
M(() => m.disabledZoom, (l) => {
|
|
443
|
+
d.value = l;
|
|
435
444
|
}, {
|
|
436
445
|
immediate: !0
|
|
437
|
-
}),
|
|
438
|
-
|
|
446
|
+
}), M(() => o.script, (l) => {
|
|
447
|
+
l && l !== "" && u.setMethods(l);
|
|
439
448
|
}, {
|
|
440
449
|
immediate: !0
|
|
441
|
-
}),
|
|
442
|
-
setCheckedNode:
|
|
443
|
-
setHoverNode:
|
|
444
|
-
setDisableHover:
|
|
445
|
-
handleToggleDeviceMode:
|
|
446
|
-
reset:
|
|
450
|
+
}), I("pageSchema", o), I("pageManager", u), I("designerProps", j(() => m)), I("designer", {
|
|
451
|
+
setCheckedNode: h,
|
|
452
|
+
setHoverNode: k,
|
|
453
|
+
setDisableHover: S,
|
|
454
|
+
handleToggleDeviceMode: F,
|
|
455
|
+
reset: C,
|
|
447
456
|
state: a
|
|
448
457
|
});
|
|
449
458
|
function p() {
|
|
450
|
-
|
|
459
|
+
o.schemas = G(m.defaultSchema.schemas), h(o.schemas[0]), Y.push(o.schemas, "初始化撤销功能");
|
|
451
460
|
}
|
|
452
|
-
async function
|
|
453
|
-
a.checkedNode =
|
|
461
|
+
async function h(l = o.schemas[0]) {
|
|
462
|
+
a.checkedNode = l, a.matched = pe(o.schemas, l.id);
|
|
454
463
|
}
|
|
455
|
-
async function
|
|
456
|
-
var
|
|
457
|
-
if (!
|
|
464
|
+
async function k(l = null) {
|
|
465
|
+
var L;
|
|
466
|
+
if (!l || a.disableHover)
|
|
458
467
|
return a.hoverNode = null, !1;
|
|
459
|
-
if ((
|
|
468
|
+
if ((l == null ? void 0 : l.id) === ((L = a.hoverNode) == null ? void 0 : L.id))
|
|
460
469
|
return !1;
|
|
461
|
-
a.hoverNode =
|
|
470
|
+
a.hoverNode = l;
|
|
462
471
|
}
|
|
463
|
-
function
|
|
464
|
-
|
|
465
|
-
|
|
472
|
+
function i() {
|
|
473
|
+
A(() => {
|
|
474
|
+
D("ready", { pageManager: u });
|
|
466
475
|
});
|
|
467
476
|
}
|
|
468
|
-
async function
|
|
469
|
-
a.disableHover =
|
|
477
|
+
async function S(l = !1) {
|
|
478
|
+
a.disableHover = l;
|
|
470
479
|
}
|
|
471
|
-
function
|
|
472
|
-
|
|
480
|
+
function b(l) {
|
|
481
|
+
z(o, l);
|
|
473
482
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
483
|
+
function y() {
|
|
484
|
+
return X(o);
|
|
476
485
|
}
|
|
477
|
-
function
|
|
478
|
-
he(
|
|
486
|
+
function C() {
|
|
487
|
+
he(o.schemas, m.defaultSchema.schemas) && o.script === m.defaultSchema.script || (z(o.schemas, m.defaultSchema.schemas), o.script = m.defaultSchema.script, h(o.schemas[0]), Y.push(o.schemas, "重置操作"), D("reset", o));
|
|
479
488
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
489
|
+
function _() {
|
|
490
|
+
D("save", X(o));
|
|
482
491
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
492
|
+
function F(l) {
|
|
493
|
+
D("toggleDeviceMode", l);
|
|
485
494
|
}
|
|
486
|
-
function
|
|
495
|
+
function Q() {
|
|
487
496
|
x.value.handleOpen();
|
|
488
497
|
}
|
|
489
|
-
return p(),
|
|
490
|
-
setData:
|
|
491
|
-
getData:
|
|
492
|
-
reset:
|
|
493
|
-
preview:
|
|
494
|
-
}), (
|
|
498
|
+
return p(), n({
|
|
499
|
+
setData: b,
|
|
500
|
+
getData: y,
|
|
501
|
+
reset: C,
|
|
502
|
+
preview: Q
|
|
503
|
+
}), (l, L) => w(B).initialized.value ? ($(), R(J, {
|
|
495
504
|
key: 1,
|
|
496
|
-
onResolve:
|
|
505
|
+
onResolve: i
|
|
497
506
|
}, {
|
|
498
|
-
default:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
m.hiddenHeader ? ue("", !0) : (
|
|
507
|
+
default: E(() => [
|
|
508
|
+
N("div", Ie, [
|
|
509
|
+
N("div", $e, [
|
|
510
|
+
V(l.$slots, "header", {}, () => [
|
|
511
|
+
m.hiddenHeader ? ue("", !0) : ($(), R(w(s), {
|
|
503
512
|
key: 0,
|
|
504
|
-
onPreview:
|
|
505
|
-
onSave:
|
|
513
|
+
onPreview: Q,
|
|
514
|
+
onSave: _
|
|
506
515
|
}, {
|
|
507
|
-
header:
|
|
508
|
-
|
|
516
|
+
header: E(() => [
|
|
517
|
+
V(l.$slots, "header-prefix")
|
|
509
518
|
]),
|
|
510
|
-
prefix:
|
|
511
|
-
|
|
519
|
+
prefix: E(() => [
|
|
520
|
+
V(l.$slots, "header-prefix")
|
|
512
521
|
]),
|
|
513
|
-
title:
|
|
514
|
-
|
|
522
|
+
title: E(() => [
|
|
523
|
+
V(l.$slots, "header-title")
|
|
515
524
|
]),
|
|
516
|
-
"right-prefix":
|
|
517
|
-
|
|
525
|
+
"right-prefix": E(() => [
|
|
526
|
+
V(l.$slots, "header-right-prefix")
|
|
518
527
|
]),
|
|
519
|
-
"right-action":
|
|
520
|
-
|
|
528
|
+
"right-action": E(() => [
|
|
529
|
+
V(l.$slots, "header-right-action")
|
|
521
530
|
]),
|
|
522
|
-
"right-suffix":
|
|
523
|
-
|
|
531
|
+
"right-suffix": E(() => [
|
|
532
|
+
V(l.$slots, "header-right-suffix")
|
|
524
533
|
]),
|
|
525
534
|
_: 3
|
|
526
535
|
}))
|
|
527
536
|
])
|
|
528
537
|
]),
|
|
529
|
-
|
|
530
|
-
class: de(["epic-split-view-container", { "hidden-header":
|
|
538
|
+
N("div", {
|
|
539
|
+
class: de(["epic-split-view-container", { "hidden-header": l.hiddenHeader }])
|
|
531
540
|
}, [
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
541
|
+
T(w(r)),
|
|
542
|
+
T(w(f)),
|
|
543
|
+
T(w(g))
|
|
535
544
|
], 2),
|
|
536
|
-
|
|
545
|
+
T(Ce, {
|
|
537
546
|
ref_key: "previewRef",
|
|
538
547
|
ref: x
|
|
539
548
|
}, null, 512)
|
|
540
549
|
])
|
|
541
550
|
]),
|
|
542
|
-
fallback:
|
|
543
|
-
|
|
544
|
-
|
|
551
|
+
fallback: E(() => [
|
|
552
|
+
N("div", Te, [
|
|
553
|
+
T(w(c))
|
|
545
554
|
])
|
|
546
555
|
]),
|
|
547
556
|
_: 3
|
|
548
|
-
})) : (
|
|
557
|
+
})) : ($(), K("div", Me));
|
|
549
558
|
}
|
|
550
559
|
});
|
|
551
560
|
export {
|
|
@@ -556,8 +565,8 @@ export {
|
|
|
556
565
|
Ke as capitalizeFirstLetter,
|
|
557
566
|
ze as convertKFormData,
|
|
558
567
|
Fe as debounce,
|
|
559
|
-
|
|
560
|
-
|
|
568
|
+
G as deepClone,
|
|
569
|
+
z as deepCompareAndModify,
|
|
561
570
|
he as deepEqual,
|
|
562
571
|
qe as findSchemaById,
|
|
563
572
|
Qe as findSchemaInfoById,
|
|
@@ -569,19 +578,19 @@ export {
|
|
|
569
578
|
Je as getFormSchemas,
|
|
570
579
|
pe as getMatchedById,
|
|
571
580
|
me as getUUID,
|
|
572
|
-
|
|
581
|
+
P as loadAsyncComponent,
|
|
573
582
|
Ge as mapSchemas,
|
|
574
|
-
|
|
583
|
+
B as pluginManager,
|
|
575
584
|
We as recursionConvertedNode,
|
|
576
|
-
|
|
585
|
+
Y as revoke,
|
|
577
586
|
et as setAttributeValue,
|
|
578
587
|
ve as useDark,
|
|
579
588
|
Re as useElementDrag,
|
|
580
589
|
Ae as useElementZoom,
|
|
581
590
|
be as useKeyPress,
|
|
582
|
-
|
|
591
|
+
W as usePageManager,
|
|
583
592
|
tt as useRevoke,
|
|
584
|
-
|
|
593
|
+
H as useShareStore,
|
|
585
594
|
Se as useStore,
|
|
586
595
|
Pe as useTheme,
|
|
587
596
|
He as useTimedQuery
|