epic-designer-gold 0.0.31 → 0.0.33
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-CkDUbzuR.cjs → attributeView-CkX6fubE.cjs} +1 -1
- package/dist/{attributeView-DpkfKqtd.js → attributeView-DVqMH1xY.js} +1 -1
- package/dist/core/components/builder/src/builder.vue.d.ts +2 -0
- package/dist/core/components/node/src/node.vue.d.ts +2 -0
- package/dist/{index-CiMLQy__.js → index-B07zwTz2.js} +1 -1
- package/dist/{index-FHGseiDc.js → index-BGKInHWa.js} +1 -1
- package/dist/{index-C5H0qK7d.cjs → index-BffcOK9E.cjs} +1 -1
- package/dist/{index-jV4vV6jn.cjs → index-Bl9bHpGb.cjs} +1 -1
- package/dist/{index-CpxsakMD.cjs → index-BqPBE6Y2.cjs} +1 -1
- package/dist/{index-DbioQCL7.cjs → index-BvRS3i9N.cjs} +1 -1
- package/dist/{index-ZbUi21VA.cjs → index-C7Rkr11-.cjs} +1 -1
- package/dist/{index-Bc7J-Fgw.js → index-C8_p36X3.js} +1 -1
- package/dist/{index-BhIZKk9i.cjs → index-CKl_FM23.cjs} +1 -1
- package/dist/{index-rE2p5Gmx.js → index-CY8bzSIr.js} +1 -1
- package/dist/{index-BPt8U8n9.js → index-CYyckZuN.js} +1 -1
- package/dist/{index-D8Dlr8aX.js → index-DQBowkLQ.js} +1 -1
- package/dist/{index-D0T4HwOl.cjs → index-DWA3Pa6_.cjs} +1 -1
- package/dist/{index-CH2IxHQE.js → index-QcfCoknU.js} +372 -368
- package/dist/{index-UQLDWqfT.js → index-bup0iSFb.js} +1 -1
- package/dist/{index-Bb8XSoYT.cjs → index-i26diW3P.cjs} +1 -1
- package/dist/index-rlyOYH5_.cjs +10 -0
- package/dist/index-zlm7L3aS.js +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{radio-ChBAvqeY.js → radio-B_7sUIiA.js} +1 -3
- package/dist/sign-CpJ83zt4.cjs +1 -0
- package/dist/sign-d-TCl0NS.js +150 -0
- package/dist/style.css +1 -1
- package/dist/{styleView-CEaoc1Q1.js → styleView-DNbMFObZ.js} +1 -1
- package/dist/{styleView-sGpDpZDg.cjs → styleView-D_DJWtjt.cjs} +1 -1
- package/dist/ui/elementPlus/index.cjs +1 -1
- package/dist/ui/elementPlus/index.js +2 -2
- package/package.json +1 -1
- package/dist/index-CTjIY8cx.cjs +0 -10
- package/dist/index-CtNfh-CD.js +0 -4
- package/dist/sign-BDZCr3wJ.js +0 -137
- package/dist/sign-Gwu2PIRy.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=Object.create;var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var f=(e,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let t of u(l))!b.call(e,t)&&t!==o&&r(e,t,{get:()=>l[t],enumerable:!(a=d(l,t))||a.enumerable});return e};var p=(e,l,o)=>(o=e!=null?s(m(e)):{},f(l||!e||!e.__esModule?r(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("epic-designer-gold"),n=require("element-plus"),h={component:async()=>(await import("element-plus")).ElInput,groupName:"表单",icon:"icon--epic--border-color-outline-rounded",sort:700,defaultSchema:{label:"输入框",type:"input",field:"input",input:!0,componentProps:{placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"input",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",defaultValue:"default",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大输入长度",type:"number",field:"componentProps.maxlength",componentProps:{placeholder:"请输入",min:0}},{label:"统计字数",type:"switch",field:"componentProps.showWordLimit",show:({values:e})=>e.componentProps.maxlength},{label:"输入类型",type:"select",defaultValue:"text",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"text",value:"text"},{label:"number",value:"number"},{label:"password",value:"password"}]},field:"componentProps.type"},{label:"显示切换图标",type:"switch",field:"componentProps.showPassword",show:({values:e})=>e.componentProps.type==="password"},{label:"只读",type:"switch",field:"componentProps.readonly"},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值时"},{type:"change",describe:"值修改时"},{type:"focus",describe:"获取焦点时"},{type:"blur",describe:"失去焦点时"},{type:"clear",describe:"点击清空按钮时"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"clear",describe:"清除 input 值"},{type:"select",describe:"选中 input 中的文字"}]}},P={component:async()=>(await import("element-plus")).ElInput,icon:"icon--epic--edit-square-outline-rounded",groupName:"表单",sort:705,defaultSchema:{label:"文本域",type:"textarea",field:"textarea",input:!0,componentProps:{placeholder:"请输入",type:"textarea"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"textarea",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大输入长度",type:"number",field:"componentProps.maxlength",componentProps:{placeholder:"请输入",min:0}},{label:"统计字数",type:"switch",field:"componentProps.showWordLimit",show:({values:e})=>e.componentProps.maxlength},{label:"最小行数",type:"number",field:"componentProps.autosize.minRows",componentProps:{placeholder:"请输入"}},{label:"最大行数",type:"number",field:"componentProps.autosize.maxRows",componentProps:{placeholder:"请输入"}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值"},{type:"change",describe:"值修改"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"clear",describe:"清除 input 值"},{type:"select",describe:"选中 input 中的文字"}]}},v={component:async()=>(await import("element-plus")).ElInputNumber,groupName:"表单",icon:"icon--epic--123-rounded",sort:710,defaultSchema:{label:"数字输入框",type:"number",field:"number",input:!0,componentProps:{placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"number",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大值",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"}},{label:"最小值",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"}},{label:"步长",type:"number",field:"componentProps.step",componentProps:{placeholder:"请输入"}},{label:"控制按钮位置",type:"select",defaultValue:"",componentProps:{options:[{label:"default",value:""},{label:"right",value:"right"}],placeholder:"请选择",clearable:!0},field:"componentProps.controlsPosition"},{label:"精度",type:"number",field:"componentProps.precision",componentProps:{placeholder:"请输入"}},{label:"输入控制为步长的倍数",type:"switch",field:"componentProps.stepStrictly"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"number"}}],event:[{type:"change",describe:"值变化时"}]}},w={component:()=>Promise.resolve().then(()=>require("../../form-CthzLIgs.cjs")),groupName:"表单",icon:"icon--epic--list-alt-outline-rounded",sort:600,defaultSchema:{label:"表单",type:"form",componentProps:{name:"default",labelWidth:"100px","label-position":"left"},children:[]},config:{attribute:[{label:"Name",type:"input",field:"componentProps.name"},{label:"标签位置",type:"radio",field:"componentProps.label-position",componentProps:{clearable:!0,radioButton:!0,options:[{label:"左边",value:"left"},{label:"右边",value:"right"},{label:"顶部",value:"top"}]}},{label:"标签宽度",type:"EInputSize",field:"componentProps.labelWidth"},{label:"标签后缀",type:"input",field:"componentProps.labelSuffix",componentProps:{placeholder:"请输入"}},{label:"表单尺寸",type:"select",field:"componentProps.size",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]}},{label:"星号位置",type:"select",field:"componentProps.require-asterisk-position",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"左边",value:"left"},{label:"右边",value:"right"}]}},{label:"行内展示校验信息",type:"switch",field:"componentProps.inline-message"},{label:"校验反馈图标",type:"switch",field:"componentProps.status-icon"},{label:"滚动校验错误处",type:"switch",field:"componentProps.scroll-to-error"},{label:"行内模式",type:"switch",field:"componentProps.inline"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}],action:[{type:"getData",describe:"获取表单数据"},{type:"setData",describe:"设置表单数据"},{type:"validate",describe:"校验表单"}]}},g={component:()=>Promise.resolve().then(()=>require("../../formItem-BVnNs1Q9.cjs")),defaultSchema:{label:"表单项",type:"form-item"},config:{}},E={component:()=>Promise.resolve().then(()=>require("../../button-Cc4KYk3v.cjs")),groupName:"表单",icon:"icon--epic--fit-screen-rounded",sort:1200,defaultSchema:{label:"按钮",type:"button",field:"input",input:!1},config:{attribute:[{label:"标题",type:"input",field:"label"},{label:"类型",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"primary",value:"primary"},{label:"success",value:"success"},{label:"info",value:"info"},{label:"warning",value:"warning"},{label:"danger",value:"danger"}]},field:"componentProps.type"},{label:"操作类型",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"button",value:"button"},{label:"submit",value:"submit"},{label:"reset",value:"reset"}]},field:"componentProps.native-type"},{label:"自定义颜色",type:"color-picker",field:"componentProps.color",componentProps:{type:"color"}},{label:"朴素按钮",type:"switch",field:"componentProps.plain"},{label:"圆角按钮",type:"switch",field:"componentProps.round"},{label:"圆形按钮",type:"switch",field:"componentProps.circle"},{label:"文字按钮",type:"switch",field:"componentProps.text"},{label:"加载状态",type:"switch",field:"componentProps.loading"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}],event:[{type:"click",describe:"点击按钮时"},{type:"dblclick",describe:"双击按钮时"}]}},S={component:()=>Promise.resolve().then(()=>require("../../card-BowzD9vN.cjs")),groupName:"布局",icon:"icon--epic--wysiwyg-rounded",sort:700,defaultSchema:{label:"卡片布局",type:"card",children:[],componentProps:{}},config:{attribute:[{label:"标题",type:"input",field:"label"},{label:"阴影时机",type:"select",componentProps:{options:[{label:"always",value:"always"},{label:"hover",value:"hover"},{label:"never",value:"never"}],placeholder:"请选择",clearable:!0},field:"componentProps.shadow"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},x={component:()=>Promise.resolve().then(()=>require("../../row-NNlPGZRG.cjs")),groupName:"布局",icon:"icon--epic--width-normal-outline",sort:800,defaultSchema:{label:"栅格布局",type:"row",children:[{type:"col",children:[],componentProps:{span:12}},{type:"col",children:[],componentProps:{span:12}}]},editConstraints:{childImmovable:!0},config:{attribute:[{label:"垂直对齐方式",type:"select",componentProps:{style:{width:"100%"},options:[{label:"top",value:"top"},{label:"middle",value:"middle"},{label:"bottom",value:"bottom"}],placeholder:"请选择"},field:"componentProps.align"},{label:"水平排列方式",type:"select",componentProps:{style:{width:"100%"},options:[{label:"start",value:"start"},{label:"end",value:"end"},{label:"center",value:"center"},{label:"space-around",value:"space-around"},{label:"space-between",value:"space-between"}],placeholder:"请选择"},field:"componentProps.justify"},{label:"栅格间距",type:"number",field:"componentProps.gutter",componentProps:{placeholder:"请输入"}},{label:"列编辑",type:"EColEditor",field:"children"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},Y={component:()=>Promise.resolve().then(()=>require("../../col-B1GUMkMK.cjs")),defaultSchema:{label:"栅格布局-列",type:"col",children:[],componentProps:{span:6}},config:{attribute:[{label:"占位格数",type:"number",field:"componentProps.span"}]}},V={component:()=>Promise.resolve().then(()=>require("../../select-D6bRz5G2.cjs")),groupName:"表单",icon:"icon--epic--select",sort:900,defaultSchema:{label:"选择框",type:"select",field:"select",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],dynamicId:"",placeholder:"请选择",size:"default",effect:"light",placement:"bottom-start"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"select",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"可多选",type:"switch",field:"componentProps.multiple",onChange:({value:e,values:l})=>{e?l.componentProps.defaultValue=[]:l.componentProps.defaultValue=null}},{label:"多选隐藏",type:"switch",field:"componentProps.collapseTags",show:({values:e})=>e.componentProps.multiple},{label:"隐藏提示",type:"switch",field:"componentProps.collapseTagsTooltip",show:({values:e})=>e.componentProps.multiple&&e.componentProps.collapseTags},{label:"保留搜索关键字",type:"switch",field:"componentProps.reserveKeyword",show:({values:e})=>e.componentProps.multiple},{label:"标签类型",type:"select",defaultValue:"info",componentProps:{options:[{label:"success",value:"success"},{label:"info",value:"info"},{label:"warning",value:"warning"},{label:"danger",value:"danger"}]},show:({values:e})=>e.componentProps.multiple,field:"componentProps.tagType"},{label:"多选限制",type:"number",field:"componentProps.multipleLimit",show:({values:e})=>e.componentProps.multiple},{label:"提示主题",type:"select",componentProps:{options:[{label:"light",value:"light"},{label:"dark",value:"dark"}]},field:"componentProps.effect"},{label:"可筛选",type:"switch",field:"componentProps.filterable"},{label:"允许创建条目",type:"switch",field:"componentProps.allowCreate"},{label:"下拉框位置",type:"select",defaultValue:"bottom-start",componentProps:{options:[{label:"top",value:"top"},{label:"top-start",value:"top-start"},{label:"top-end",value:"top-end"},{label:"bottom",value:"bottom"},{label:"bottom-start",value:"bottom-start"},{label:"bottom-end",value:"bottom-end"},{label:"left",value:"left"},{label:"left-start",value:"left-start"},{label:"left-end",value:"left-end"},{label:"right",value:"right"},{label:"right-start",value:"right-start"},{label:"right-end",value:"right-end"}]},field:"componentProps.placement"},{label:"下拉框宽度与输入框相同",type:"switch",field:"componentProps.fitInputWidth"},{label:"无数据时文本",type:"input",field:"componentProps.noDataText",componentProps:{placeholder:"请输入"}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options",describe:"配置选项"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"值变化时"}]}},C={component:()=>Promise.resolve().then(()=>require("../../radio-D3AHEMXb.cjs")),groupName:"表单",icon:"icon--epic--radio-button-checked-outline",sort:850,defaultSchema:{label:"单选框",type:"radio",field:"radio",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],size:"default"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"radio",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"按钮模式",type:"switch",field:"componentProps.radioButton"},{label:"选项文本颜色",type:"color-picker",layout:"horizontal",field:"componentProps.textColor",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"选项按钮颜色",type:"color-picker",layout:"horizontal",field:"componentProps.fill",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"值变化时"}]}},k={component:()=>Promise.resolve().then(()=>require("../../checkbox-CMr5pERY.cjs")),groupName:"表单",icon:"icon--epic--dialogs-outline-rounded",sort:860,defaultSchema:{label:"复选框",type:"checkbox",field:"checkbox",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}]}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"checkbox",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大选中数",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"}},{label:"最小选中数",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"}},{label:"按钮模式",type:"switch",field:"componentProps.radioButton"},{label:"选项文本颜色",type:"color-picker",layout:"horizontal",field:"componentProps.textColor",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"选项按钮颜色",type:"color-picker",layout:"horizontal",field:"componentProps.fill",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"值变化时"}]}},T={component:async()=>(await import("element-plus")).ElSlider,groupName:"表单",icon:"icon--epic--switches",sort:930,defaultSchema:{label:"滑块",type:"slider",field:"slider",input:!0,componentProps:{placement:"top-start",showTooltip:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"slider",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最小值",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"},onChange:({value:e,values:l,componentAttributes:o})=>{const a=o.value.findIndex(i=>i.field==="componentProps.max"),t=o.value[a];t.componentProps={min:e},(l.componentProps.max??0)<e&&(l.componentProps.max=e)}},{label:"最大值",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"},onChange:({value:e,values:l,componentAttributes:o})=>{const a=o.value.findIndex(i=>i.field==="componentProps.min"),t=o.value[a];t.componentProps={max:e},(l.componentProps.min??0)>e&&(l.componentProps.min=e)}},{label:"步长",type:"number",field:"componentProps.step",componentProps:{placeholder:"请输入"}},{label:"显示间断点",type:"switch",field:"componentProps.showStops"},{label:"提示信息",type:"switch",field:"componentProps.showTooltip"},{label:"开启选择范围",type:"switch",field:"componentProps.range"},{label:"垂直模式",type:"switch",field:"componentProps.vertical"},{label:"高度",type:"EInputSize",field:"componentProps.height",show:({values:e})=>e.componentProps.vertical},{label:"显示数字框",type:"switch",field:"componentProps.showInput",onChange:({value:e,values:l})=>{e&&(l.componentProps.showInputControls=!0)}},{label:"控制按钮",type:"switch",field:"componentProps.showInputControls",show:({values:e})=>e.componentProps.showInput},{label:"提示框位置",type:"select",defaultValue:"bottom-start",componentProps:{options:[{label:"top",value:"top"},{label:"top-start",value:"top-start"},{label:"top-end",value:"top-end"},{label:"bottom",value:"bottom"},{label:"bottom-start",value:"bottom-start"},{label:"bottom-end",value:"bottom-end"},{label:"left",value:"left"},{label:"left-start",value:"left-start"},{label:"left-end",value:"left-end"},{label:"right",value:"right"},{label:"right-start",value:"right-start"},{label:"right-end",value:"right-end"}]},field:"componentProps.placement"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"number"}}],event:[{type:"input",describe:"拖拽实时触发"},{type:"change",describe:"拖拽结束改变值时"}]}},D={component:async()=>(await import("element-plus")).ElColorPicker,groupName:"表单",icon:"icon--epic--palette-outline",sort:950,defaultSchema:{label:"颜色选择器",type:"color-picker",field:"color-picker",input:!0},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"color-picker",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"格式",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"hsl",value:"hsl"},{label:"hsv",value:"hsv"},{label:"hex",value:"hex"},{label:"rgb",value:"rgb"}]},field:"componentProps.colorFormat"},{label:"透明度选择",type:"switch",field:"componentProps.showAlpha"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}],action:[]}},I={component:async()=>(await import("element-plus")).ElSwitch,groupName:"表单",icon:"icon--epic--toggle-off-outline",sort:930,defaultSchema:{label:"开关",type:"switch",field:"switch",input:!0,componentProps:{defaultValue:!1}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"switch",field:"componentProps.defaultValue"},{label:"ON状态值",type:"input",field:"componentProps.activeValue",componentProps:{placeholder:"请输入"},onChange(e){setTimeout(()=>c(e))}},{label:"OFF状态值",type:"input",field:"componentProps.inactiveValue",componentProps:{placeholder:"请输入"},onChange(e){setTimeout(()=>c(e))}},{label:"ON状态描述",type:"input",field:"componentProps.activeText",componentProps:{placeholder:"请输入"}},{label:"OFF状态描述",type:"input",field:"componentProps.inactiveText",componentProps:{placeholder:"请输入"}},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"宽度",type:"number",field:"componentProps.width",componentProps:{min:50,placeholder:"请输入"}},{label:"文本点内显示",type:"switch",field:"componentProps.inlinePrompt"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"boolean"}}],event:[{type:"change",describe:"状态发生变化时"}]}};function c(e){var o;let l=((o=e.values.componentProps)==null?void 0:o.inactiveValue)||!1;e.values.componentProps.unCheckedValue===""&&delete e.values.componentProps.unCheckedValue,e.values.componentProps.activeValue===""&&delete e.values.componentProps.activeValue,e.values.componentProps?e.values.componentProps.defaultValue=l:e.values.componentProps={defaultValue:l}}const z={component:async()=>(await import("element-plus")).ElCascader,groupName:"表单",icon:"icon--epic--full-coverage-outline",sort:900,defaultSchema:{label:"级联选择器",type:"cascader",field:"cascader",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],placeholder:"请选择",props:{expandTrigger:"click"}}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"cascader",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"分割符",type:"input",componentProps:{placeholder:"请输入"},field:"componentProps.separator"},{label:"次级菜单展开方式",type:"select",field:"componentProps.props.expandTrigger",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"click",value:"click"},{label:"hover",value:"hover"}]}},{label:"可搜索",type:"switch",field:"componentProps.filterable"},{label:"可多选",type:"switch",field:"componentProps.props.multiple",onChange:({value:e,values:l})=>{e?l.componentProps.defaultValue=[]:l.componentProps.defaultValue=null}},{label:"折叠Tag",type:"switch",field:"componentProps.collapseTags",show:({values:e})=>e.componentProps.props.multiple},{label:"显示被折叠标签",type:"switch",field:"componentProps.collapseTagsTooltip",show:({values:e})=>e.componentProps.props.multiple&&e.componentProps.collapseTags},{label:"不显示路径",type:"switch",componentProps:{activeValue:!1,inactiveValue:!0},field:"componentProps.showAllLevels"},{label:"父级可选",type:"switch",field:"componentProps.props.checkStrictly",describe:"父子节点不互相关联"},{label:"只获取选中节点",type:"switch",field:"componentProps.props.emitPath",componentProps:{activeValue:!1,inactiveValue:!0}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options",componentProps:{tree:!0},describe:"配置选项"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"选中节点变化时"},{type:"blur",describe:" 当失去焦点时触发"},{type:"focus",describe:"当获得焦点时触发"}],action:[{type:"getCheckedNodes",describe:"获取当前选中节点"},{type:"togglePopperVisible",describe:"切换 popper 可见状态"}]}},F={component:()=>Promise.resolve().then(()=>require("../../collapse-B2AXU6Jz.cjs")),icon:"epic-icon-xiala",defaultSchema:{label:"折叠面板",type:"collapse",children:[{type:"collapse-item",children:[],componentProps:{span:12},id:"g062zikd2jk001"},{type:"collapse-item",children:[],componentProps:{span:12},id:"gy5z9jtfb3s001"}]},config:{attribute:[{label:"折叠项管理",type:"EColEditor",field:"children"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},N={component:()=>Promise.resolve().then(()=>require("../../collapseItem-CAGqWjGg.cjs")),defaultSchema:{label:"折叠项",type:"collapse-item",children:[]},config:{attribute:[]}},R={component:async()=>(await import("element-plus")).ElDatePicker,groupName:"表单",icon:"icon--epic--calendar-month-outline-rounded",sort:910,defaultSchema:{label:"日期选择器",type:"date",field:"date",input:!0,componentProps:{type:"date",valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD",placeholder:"请选择",startPlaceholder:"请选择",endPlaceholder:"请选择"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"date",field:"componentProps.defaultValue"},{label:"日期类型",type:"select",field:"componentProps.type",componentProps:{options:[{label:"日期",value:"date"},{label:"周",value:"week"},{label:"月份",value:"month"},{label:"年份",value:"year"},{label:"时间",value:"datetime"},{label:"时间范围",value:"datetimerange"},{label:"日期范围",value:"daterange"},{label:"月份范围",value:"monthrange"},{label:"多个日期",value:"dates"}]},onChange({values:e,value:l}){e.componentProps.defaultValue=null,["date","daterange","dates"].includes(l)?(e.componentProps.format="YYYY-MM-DD",e.componentProps.valueFormat="YYYY-MM-DD"):["week"].includes(l)?(e.componentProps.format="ww [周]",e.componentProps.valueFormat="YYYY-MM-DD"):["month","monthrange"].includes(l)?(e.componentProps.format="YYYY-MM",e.componentProps.valueFormat="YYYY-MM"):["datetime","datetimerange"].includes(l)?(e.componentProps.format="YYYY-MM-DD HH:mm:ss",e.componentProps.valueFormat="YYYY-MM-DD HH:mm:ss"):["year"].includes(l)&&(e.componentProps.format="YYYY",e.componentProps.valueFormat="YYYY")}},{label:"开始占位符",type:"input",field:"componentProps.startPlaceholder",show({values:e}){return["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"结束占位符",type:"input",field:"componentProps.endPlaceholder",show({values:e}){return["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"占位内容",type:"input",field:"componentProps.placeholder",show({values:e}){return!["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"尺寸",type:"select",defaultValue:"default",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"可输入",type:"switch",field:"componentProps.editable"},{label:"显示格式",type:"input",field:"componentProps.format"},{label:"数据格式",type:"input",field:"componentProps.valueFormat"},{label:"分割符",type:"input",field:"componentProps.rangeSeparator",componentProps:{placeholder:"请输入"},show({values:e}){return["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"只读",type:"switch",field:"componentProps.readonly"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]}},q={component:()=>Promise.resolve().then(()=>require("../../uploadFile-z7Ko58XG.cjs")),groupName:"表单",icon:"icon--epic--upload-rounded",sort:920,defaultSchema:{label:"上传文件",type:"upload-file",field:"uploadFile",input:!0,componentProps:{action:"https://examples.epicjs.cn/static/upload-img.json",name:"file",showFileList:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"请求地址",type:"input",field:"componentProps.action"},{label:"上传文件字段",type:"input",field:"componentProps.name"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"展示文件列表",type:"switch",field:"componentProps.showFileList"},{label:"拖拽上传",type:"switch",field:"componentProps.drag"},{label:"允许上传最大数量",type:"number",field:"componentProps.limit",componentProps:{min:0,placeholder:"请输入"}},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}}]},bindModel:"modelValue"},M={component:()=>Promise.resolve().then(()=>require("../../uploadImage-xU0He_aO.cjs")),groupName:"表单",icon:"icon--epic--imagesmode-outline-rounded",sort:920,defaultSchema:{label:"上传图片",type:"upload-image",field:"uploadImage",input:!0,componentProps:{action:"https://examples.epicjs.cn/static/upload-img.json",name:"file",showFileList:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"请求地址",type:"input",field:"componentProps.action"},{label:"上传文件字段",type:"input",field:"componentProps.name"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"展示文件列表",type:"switch",field:"componentProps.showFileList"},{label:"拖拽上传",type:"switch",field:"componentProps.drag"},{label:"允许上传最大数量",type:"number",field:"componentProps.limit",componentProps:{min:0,placeholder:"请输入"}},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}}]},bindModel:"modelValue"},B={component:()=>Promise.resolve().then(()=>require("../../modal-_fid8E1T.cjs")),defaultSchema:{label:"模态框",type:"modal",children:[]},config:{attribute:[{label:"标题",type:"input",field:"title"}]}},O={component:async()=>await Promise.resolve().then(()=>require("../../sign-Gwu2PIRy.cjs")),icon:"icon--epic--insert-text-outline-rounded",groupName:"表单",sort:705,defaultSchema:{label:"签名板",type:"sign",field:"sign",input:!0,componentProps:{placeholder:"请输入",lineWidth:4,type:"sign",style:{height:"300px"}}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"线条宽度(px)",type:"input",componentProps:{placeholder:"请选择",clearable:!0},field:"componentProps.lineWidth"},{label:"只读",type:"switch",field:"componentProps.readonly"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}]}};function j(e=y.pluginManager){e.component("FormItem",n.ElFormItem),e.component("Form",n.ElForm),e.component("RadioGroup",n.ElRadioGroup),e.component("RadioButton",n.ElRadioButton),e.component("Tabs",n.ElTabs),e.component("TabPane",n.ElTabPane),e.component("Collapse",n.ElCollapse),e.component("CollapseItem",n.ElCollapseItem),e.component("Drawer",n.ElDrawer),[w,g,h,P,v,C,k,R,V,I,D,z,T,q,M,E,S,x,Y,F,N,B,O].forEach(o=>{e.registerComponent(o),e.addBaseComponentTypes(o.defaultSchema.type)}),e.setInitialized(!0)}function L(e){import("element-plus").then(({provideGlobalConfig:l})=>{l(e)})}exports.provideGlobalConfig=L;exports.setupElementPlus=j;
|
|
1
|
+
"use strict";var s=Object.create;var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var f=(e,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let t of u(l))!b.call(e,t)&&t!==o&&r(e,t,{get:()=>l[t],enumerable:!(a=d(l,t))||a.enumerable});return e};var p=(e,l,o)=>(o=e!=null?s(m(e)):{},f(l||!e||!e.__esModule?r(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("epic-designer-gold"),n=require("element-plus"),h={component:async()=>(await import("element-plus")).ElInput,groupName:"表单",icon:"icon--epic--border-color-outline-rounded",sort:700,defaultSchema:{label:"输入框",type:"input",field:"input",input:!0,componentProps:{placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"input",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",defaultValue:"default",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大输入长度",type:"number",field:"componentProps.maxlength",componentProps:{placeholder:"请输入",min:0}},{label:"统计字数",type:"switch",field:"componentProps.showWordLimit",show:({values:e})=>e.componentProps.maxlength},{label:"输入类型",type:"select",defaultValue:"text",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"text",value:"text"},{label:"number",value:"number"},{label:"password",value:"password"}]},field:"componentProps.type"},{label:"显示切换图标",type:"switch",field:"componentProps.showPassword",show:({values:e})=>e.componentProps.type==="password"},{label:"只读",type:"switch",field:"componentProps.readonly"},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值时"},{type:"change",describe:"值修改时"},{type:"focus",describe:"获取焦点时"},{type:"blur",describe:"失去焦点时"},{type:"clear",describe:"点击清空按钮时"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"clear",describe:"清除 input 值"},{type:"select",describe:"选中 input 中的文字"}]}},P={component:async()=>(await import("element-plus")).ElInput,icon:"icon--epic--edit-square-outline-rounded",groupName:"表单",sort:705,defaultSchema:{label:"文本域",type:"textarea",field:"textarea",input:!0,componentProps:{placeholder:"请输入",type:"textarea"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"textarea",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大输入长度",type:"number",field:"componentProps.maxlength",componentProps:{placeholder:"请输入",min:0}},{label:"统计字数",type:"switch",field:"componentProps.showWordLimit",show:({values:e})=>e.componentProps.maxlength},{label:"最小行数",type:"number",field:"componentProps.autosize.minRows",componentProps:{placeholder:"请输入"}},{label:"最大行数",type:"number",field:"componentProps.autosize.maxRows",componentProps:{placeholder:"请输入"}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值"},{type:"change",describe:"值修改"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"clear",describe:"清除 input 值"},{type:"select",describe:"选中 input 中的文字"}]}},v={component:async()=>(await import("element-plus")).ElInputNumber,groupName:"表单",icon:"icon--epic--123-rounded",sort:710,defaultSchema:{label:"数字输入框",type:"number",field:"number",input:!0,componentProps:{placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"number",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大值",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"}},{label:"最小值",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"}},{label:"步长",type:"number",field:"componentProps.step",componentProps:{placeholder:"请输入"}},{label:"控制按钮位置",type:"select",defaultValue:"",componentProps:{options:[{label:"default",value:""},{label:"right",value:"right"}],placeholder:"请选择",clearable:!0},field:"componentProps.controlsPosition"},{label:"精度",type:"number",field:"componentProps.precision",componentProps:{placeholder:"请输入"}},{label:"输入控制为步长的倍数",type:"switch",field:"componentProps.stepStrictly"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"number"}}],event:[{type:"change",describe:"值变化时"}]}},w={component:()=>Promise.resolve().then(()=>require("../../form-CthzLIgs.cjs")),groupName:"表单",icon:"icon--epic--list-alt-outline-rounded",sort:600,defaultSchema:{label:"表单",type:"form",componentProps:{name:"default",labelWidth:"100px","label-position":"left"},children:[]},config:{attribute:[{label:"Name",type:"input",field:"componentProps.name"},{label:"标签位置",type:"radio",field:"componentProps.label-position",componentProps:{clearable:!0,radioButton:!0,options:[{label:"左边",value:"left"},{label:"右边",value:"right"},{label:"顶部",value:"top"}]}},{label:"标签宽度",type:"EInputSize",field:"componentProps.labelWidth"},{label:"标签后缀",type:"input",field:"componentProps.labelSuffix",componentProps:{placeholder:"请输入"}},{label:"表单尺寸",type:"select",field:"componentProps.size",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]}},{label:"星号位置",type:"select",field:"componentProps.require-asterisk-position",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"左边",value:"left"},{label:"右边",value:"right"}]}},{label:"行内展示校验信息",type:"switch",field:"componentProps.inline-message"},{label:"校验反馈图标",type:"switch",field:"componentProps.status-icon"},{label:"滚动校验错误处",type:"switch",field:"componentProps.scroll-to-error"},{label:"行内模式",type:"switch",field:"componentProps.inline"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}],action:[{type:"getData",describe:"获取表单数据"},{type:"setData",describe:"设置表单数据"},{type:"validate",describe:"校验表单"}]}},g={component:()=>Promise.resolve().then(()=>require("../../formItem-BVnNs1Q9.cjs")),defaultSchema:{label:"表单项",type:"form-item"},config:{}},E={component:()=>Promise.resolve().then(()=>require("../../button-Cc4KYk3v.cjs")),groupName:"表单",icon:"icon--epic--fit-screen-rounded",sort:1200,defaultSchema:{label:"按钮",type:"button",field:"input",input:!1},config:{attribute:[{label:"标题",type:"input",field:"label"},{label:"类型",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"primary",value:"primary"},{label:"success",value:"success"},{label:"info",value:"info"},{label:"warning",value:"warning"},{label:"danger",value:"danger"}]},field:"componentProps.type"},{label:"操作类型",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"button",value:"button"},{label:"submit",value:"submit"},{label:"reset",value:"reset"}]},field:"componentProps.native-type"},{label:"自定义颜色",type:"color-picker",field:"componentProps.color",componentProps:{type:"color"}},{label:"朴素按钮",type:"switch",field:"componentProps.plain"},{label:"圆角按钮",type:"switch",field:"componentProps.round"},{label:"圆形按钮",type:"switch",field:"componentProps.circle"},{label:"文字按钮",type:"switch",field:"componentProps.text"},{label:"加载状态",type:"switch",field:"componentProps.loading"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}],event:[{type:"click",describe:"点击按钮时"},{type:"dblclick",describe:"双击按钮时"}]}},S={component:()=>Promise.resolve().then(()=>require("../../card-BowzD9vN.cjs")),groupName:"布局",icon:"icon--epic--wysiwyg-rounded",sort:700,defaultSchema:{label:"卡片布局",type:"card",children:[],componentProps:{}},config:{attribute:[{label:"标题",type:"input",field:"label"},{label:"阴影时机",type:"select",componentProps:{options:[{label:"always",value:"always"},{label:"hover",value:"hover"},{label:"never",value:"never"}],placeholder:"请选择",clearable:!0},field:"componentProps.shadow"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},x={component:()=>Promise.resolve().then(()=>require("../../row-NNlPGZRG.cjs")),groupName:"布局",icon:"icon--epic--width-normal-outline",sort:800,defaultSchema:{label:"栅格布局",type:"row",children:[{type:"col",children:[],componentProps:{span:12}},{type:"col",children:[],componentProps:{span:12}}]},editConstraints:{childImmovable:!0},config:{attribute:[{label:"垂直对齐方式",type:"select",componentProps:{style:{width:"100%"},options:[{label:"top",value:"top"},{label:"middle",value:"middle"},{label:"bottom",value:"bottom"}],placeholder:"请选择"},field:"componentProps.align"},{label:"水平排列方式",type:"select",componentProps:{style:{width:"100%"},options:[{label:"start",value:"start"},{label:"end",value:"end"},{label:"center",value:"center"},{label:"space-around",value:"space-around"},{label:"space-between",value:"space-between"}],placeholder:"请选择"},field:"componentProps.justify"},{label:"栅格间距",type:"number",field:"componentProps.gutter",componentProps:{placeholder:"请输入"}},{label:"列编辑",type:"EColEditor",field:"children"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},Y={component:()=>Promise.resolve().then(()=>require("../../col-B1GUMkMK.cjs")),defaultSchema:{label:"栅格布局-列",type:"col",children:[],componentProps:{span:6}},config:{attribute:[{label:"占位格数",type:"number",field:"componentProps.span"}]}},V={component:()=>Promise.resolve().then(()=>require("../../select-D6bRz5G2.cjs")),groupName:"表单",icon:"icon--epic--select",sort:900,defaultSchema:{label:"选择框",type:"select",field:"select",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],dynamicId:"",placeholder:"请选择",size:"default",effect:"light",placement:"bottom-start"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"select",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"可多选",type:"switch",field:"componentProps.multiple",onChange:({value:e,values:l})=>{e?l.componentProps.defaultValue=[]:l.componentProps.defaultValue=null}},{label:"多选隐藏",type:"switch",field:"componentProps.collapseTags",show:({values:e})=>e.componentProps.multiple},{label:"隐藏提示",type:"switch",field:"componentProps.collapseTagsTooltip",show:({values:e})=>e.componentProps.multiple&&e.componentProps.collapseTags},{label:"保留搜索关键字",type:"switch",field:"componentProps.reserveKeyword",show:({values:e})=>e.componentProps.multiple},{label:"标签类型",type:"select",defaultValue:"info",componentProps:{options:[{label:"success",value:"success"},{label:"info",value:"info"},{label:"warning",value:"warning"},{label:"danger",value:"danger"}]},show:({values:e})=>e.componentProps.multiple,field:"componentProps.tagType"},{label:"多选限制",type:"number",field:"componentProps.multipleLimit",show:({values:e})=>e.componentProps.multiple},{label:"提示主题",type:"select",componentProps:{options:[{label:"light",value:"light"},{label:"dark",value:"dark"}]},field:"componentProps.effect"},{label:"可筛选",type:"switch",field:"componentProps.filterable"},{label:"允许创建条目",type:"switch",field:"componentProps.allowCreate"},{label:"下拉框位置",type:"select",defaultValue:"bottom-start",componentProps:{options:[{label:"top",value:"top"},{label:"top-start",value:"top-start"},{label:"top-end",value:"top-end"},{label:"bottom",value:"bottom"},{label:"bottom-start",value:"bottom-start"},{label:"bottom-end",value:"bottom-end"},{label:"left",value:"left"},{label:"left-start",value:"left-start"},{label:"left-end",value:"left-end"},{label:"right",value:"right"},{label:"right-start",value:"right-start"},{label:"right-end",value:"right-end"}]},field:"componentProps.placement"},{label:"下拉框宽度与输入框相同",type:"switch",field:"componentProps.fitInputWidth"},{label:"无数据时文本",type:"input",field:"componentProps.noDataText",componentProps:{placeholder:"请输入"}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options",describe:"配置选项"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"值变化时"}]}},C={component:()=>Promise.resolve().then(()=>require("../../radio-D3AHEMXb.cjs")),groupName:"表单",icon:"icon--epic--radio-button-checked-outline",sort:850,defaultSchema:{label:"单选框",type:"radio",field:"radio",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],size:"default"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"radio",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"按钮模式",type:"switch",field:"componentProps.radioButton"},{label:"选项文本颜色",type:"color-picker",layout:"horizontal",field:"componentProps.textColor",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"选项按钮颜色",type:"color-picker",layout:"horizontal",field:"componentProps.fill",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"值变化时"}]}},k={component:()=>Promise.resolve().then(()=>require("../../checkbox-CMr5pERY.cjs")),groupName:"表单",icon:"icon--epic--dialogs-outline-rounded",sort:860,defaultSchema:{label:"复选框",type:"checkbox",field:"checkbox",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}]}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"checkbox",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最大选中数",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"}},{label:"最小选中数",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"}},{label:"按钮模式",type:"switch",field:"componentProps.radioButton"},{label:"选项文本颜色",type:"color-picker",layout:"horizontal",field:"componentProps.textColor",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"选项按钮颜色",type:"color-picker",layout:"horizontal",field:"componentProps.fill",show:({values:e})=>e.componentProps.radioButton,describe:"按钮模式下生效"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"值变化时"}]}},T={component:async()=>(await import("element-plus")).ElSlider,groupName:"表单",icon:"icon--epic--switches",sort:930,defaultSchema:{label:"滑块",type:"slider",field:"slider",input:!0,componentProps:{placement:"top-start",showTooltip:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"slider",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"最小值",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"},onChange:({value:e,values:l,componentAttributes:o})=>{const a=o.value.findIndex(i=>i.field==="componentProps.max"),t=o.value[a];t.componentProps={min:e},(l.componentProps.max??0)<e&&(l.componentProps.max=e)}},{label:"最大值",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"},onChange:({value:e,values:l,componentAttributes:o})=>{const a=o.value.findIndex(i=>i.field==="componentProps.min"),t=o.value[a];t.componentProps={max:e},(l.componentProps.min??0)>e&&(l.componentProps.min=e)}},{label:"步长",type:"number",field:"componentProps.step",componentProps:{placeholder:"请输入"}},{label:"显示间断点",type:"switch",field:"componentProps.showStops"},{label:"提示信息",type:"switch",field:"componentProps.showTooltip"},{label:"开启选择范围",type:"switch",field:"componentProps.range"},{label:"垂直模式",type:"switch",field:"componentProps.vertical"},{label:"高度",type:"EInputSize",field:"componentProps.height",show:({values:e})=>e.componentProps.vertical},{label:"显示数字框",type:"switch",field:"componentProps.showInput",onChange:({value:e,values:l})=>{e&&(l.componentProps.showInputControls=!0)}},{label:"控制按钮",type:"switch",field:"componentProps.showInputControls",show:({values:e})=>e.componentProps.showInput},{label:"提示框位置",type:"select",defaultValue:"bottom-start",componentProps:{options:[{label:"top",value:"top"},{label:"top-start",value:"top-start"},{label:"top-end",value:"top-end"},{label:"bottom",value:"bottom"},{label:"bottom-start",value:"bottom-start"},{label:"bottom-end",value:"bottom-end"},{label:"left",value:"left"},{label:"left-start",value:"left-start"},{label:"left-end",value:"left-end"},{label:"right",value:"right"},{label:"right-start",value:"right-start"},{label:"right-end",value:"right-end"}]},field:"componentProps.placement"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"number"}}],event:[{type:"input",describe:"拖拽实时触发"},{type:"change",describe:"拖拽结束改变值时"}]}},D={component:async()=>(await import("element-plus")).ElColorPicker,groupName:"表单",icon:"icon--epic--palette-outline",sort:950,defaultSchema:{label:"颜色选择器",type:"color-picker",field:"color-picker",input:!0},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"color-picker",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"格式",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"hsl",value:"hsl"},{label:"hsv",value:"hsv"},{label:"hex",value:"hex"},{label:"rgb",value:"rgb"}]},field:"componentProps.colorFormat"},{label:"透明度选择",type:"switch",field:"componentProps.showAlpha"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}],action:[]}},I={component:async()=>(await import("element-plus")).ElSwitch,groupName:"表单",icon:"icon--epic--toggle-off-outline",sort:930,defaultSchema:{label:"开关",type:"switch",field:"switch",input:!0,componentProps:{defaultValue:!1}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"switch",field:"componentProps.defaultValue"},{label:"ON状态值",type:"input",field:"componentProps.activeValue",componentProps:{placeholder:"请输入"},onChange(e){setTimeout(()=>c(e))}},{label:"OFF状态值",type:"input",field:"componentProps.inactiveValue",componentProps:{placeholder:"请输入"},onChange(e){setTimeout(()=>c(e))}},{label:"ON状态描述",type:"input",field:"componentProps.activeText",componentProps:{placeholder:"请输入"}},{label:"OFF状态描述",type:"input",field:"componentProps.inactiveText",componentProps:{placeholder:"请输入"}},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"宽度",type:"number",field:"componentProps.width",componentProps:{min:50,placeholder:"请输入"}},{label:"文本点内显示",type:"switch",field:"componentProps.inlinePrompt"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"boolean"}}],event:[{type:"change",describe:"状态发生变化时"}]}};function c(e){var o;let l=((o=e.values.componentProps)==null?void 0:o.inactiveValue)||!1;e.values.componentProps.unCheckedValue===""&&delete e.values.componentProps.unCheckedValue,e.values.componentProps.activeValue===""&&delete e.values.componentProps.activeValue,e.values.componentProps?e.values.componentProps.defaultValue=l:e.values.componentProps={defaultValue:l}}const z={component:async()=>(await import("element-plus")).ElCascader,groupName:"表单",icon:"icon--epic--full-coverage-outline",sort:900,defaultSchema:{label:"级联选择器",type:"cascader",field:"cascader",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],placeholder:"请选择",props:{expandTrigger:"click"}}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"cascader",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"分割符",type:"input",componentProps:{placeholder:"请输入"},field:"componentProps.separator"},{label:"次级菜单展开方式",type:"select",field:"componentProps.props.expandTrigger",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"click",value:"click"},{label:"hover",value:"hover"}]}},{label:"可搜索",type:"switch",field:"componentProps.filterable"},{label:"可多选",type:"switch",field:"componentProps.props.multiple",onChange:({value:e,values:l})=>{e?l.componentProps.defaultValue=[]:l.componentProps.defaultValue=null}},{label:"折叠Tag",type:"switch",field:"componentProps.collapseTags",show:({values:e})=>e.componentProps.props.multiple},{label:"显示被折叠标签",type:"switch",field:"componentProps.collapseTagsTooltip",show:({values:e})=>e.componentProps.props.multiple&&e.componentProps.collapseTags},{label:"不显示路径",type:"switch",componentProps:{activeValue:!1,inactiveValue:!0},field:"componentProps.showAllLevels"},{label:"父级可选",type:"switch",field:"componentProps.props.checkStrictly",describe:"父子节点不互相关联"},{label:"只获取选中节点",type:"switch",field:"componentProps.props.emitPath",componentProps:{activeValue:!1,inactiveValue:!0}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options",componentProps:{tree:!0},describe:"配置选项"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}},{label:"数据源",type:"EDataSource",layout:"vertical",field:"componentProps.dataSource",describe:"数据源配置"}],event:[{type:"change",describe:"选中节点变化时"},{type:"blur",describe:" 当失去焦点时触发"},{type:"focus",describe:"当获得焦点时触发"}],action:[{type:"getCheckedNodes",describe:"获取当前选中节点"},{type:"togglePopperVisible",describe:"切换 popper 可见状态"}]}},F={component:()=>Promise.resolve().then(()=>require("../../collapse-B2AXU6Jz.cjs")),icon:"epic-icon-xiala",defaultSchema:{label:"折叠面板",type:"collapse",children:[{type:"collapse-item",children:[],componentProps:{span:12},id:"g062zikd2jk001"},{type:"collapse-item",children:[],componentProps:{span:12},id:"gy5z9jtfb3s001"}]},config:{attribute:[{label:"折叠项管理",type:"EColEditor",field:"children"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},N={component:()=>Promise.resolve().then(()=>require("../../collapseItem-CAGqWjGg.cjs")),defaultSchema:{label:"折叠项",type:"collapse-item",children:[]},config:{attribute:[]}},R={component:async()=>(await import("element-plus")).ElDatePicker,groupName:"表单",icon:"icon--epic--calendar-month-outline-rounded",sort:910,defaultSchema:{label:"日期选择器",type:"date",field:"date",input:!0,componentProps:{type:"date",valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD",placeholder:"请选择",startPlaceholder:"请选择",endPlaceholder:"请选择"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"date",field:"componentProps.defaultValue"},{label:"日期类型",type:"select",field:"componentProps.type",componentProps:{options:[{label:"日期",value:"date"},{label:"周",value:"week"},{label:"月份",value:"month"},{label:"年份",value:"year"},{label:"时间",value:"datetime"},{label:"时间范围",value:"datetimerange"},{label:"日期范围",value:"daterange"},{label:"月份范围",value:"monthrange"},{label:"多个日期",value:"dates"}]},onChange({values:e,value:l}){e.componentProps.defaultValue=null,["date","daterange","dates"].includes(l)?(e.componentProps.format="YYYY-MM-DD",e.componentProps.valueFormat="YYYY-MM-DD"):["week"].includes(l)?(e.componentProps.format="ww [周]",e.componentProps.valueFormat="YYYY-MM-DD"):["month","monthrange"].includes(l)?(e.componentProps.format="YYYY-MM",e.componentProps.valueFormat="YYYY-MM"):["datetime","datetimerange"].includes(l)?(e.componentProps.format="YYYY-MM-DD HH:mm:ss",e.componentProps.valueFormat="YYYY-MM-DD HH:mm:ss"):["year"].includes(l)&&(e.componentProps.format="YYYY",e.componentProps.valueFormat="YYYY")}},{label:"开始占位符",type:"input",field:"componentProps.startPlaceholder",show({values:e}){return["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"结束占位符",type:"input",field:"componentProps.endPlaceholder",show({values:e}){return["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"占位内容",type:"input",field:"componentProps.placeholder",show({values:e}){return!["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"尺寸",type:"select",defaultValue:"default",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"大号",value:"large"},{label:"中等",value:"default"},{label:"小型",value:"small"}]},field:"componentProps.size"},{label:"可输入",type:"switch",field:"componentProps.editable"},{label:"显示格式",type:"input",field:"componentProps.format"},{label:"数据格式",type:"input",field:"componentProps.valueFormat"},{label:"分割符",type:"input",field:"componentProps.rangeSeparator",componentProps:{placeholder:"请输入"},show({values:e}){return["datetimerange","daterange","monthrange"].includes(e.componentProps.type)}},{label:"可清空",type:"switch",field:"componentProps.clearable"},{label:"只读",type:"switch",field:"componentProps.readonly"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]}},q={component:()=>Promise.resolve().then(()=>require("../../uploadFile-z7Ko58XG.cjs")),groupName:"表单",icon:"icon--epic--upload-rounded",sort:920,defaultSchema:{label:"上传文件",type:"upload-file",field:"uploadFile",input:!0,componentProps:{action:"https://examples.epicjs.cn/static/upload-img.json",name:"file",showFileList:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"请求地址",type:"input",field:"componentProps.action"},{label:"上传文件字段",type:"input",field:"componentProps.name"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"展示文件列表",type:"switch",field:"componentProps.showFileList"},{label:"拖拽上传",type:"switch",field:"componentProps.drag"},{label:"允许上传最大数量",type:"number",field:"componentProps.limit",componentProps:{min:0,placeholder:"请输入"}},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}}]},bindModel:"modelValue"},M={component:()=>Promise.resolve().then(()=>require("../../uploadImage-xU0He_aO.cjs")),groupName:"表单",icon:"icon--epic--imagesmode-outline-rounded",sort:920,defaultSchema:{label:"上传图片",type:"upload-image",field:"uploadImage",input:!0,componentProps:{action:"https://examples.epicjs.cn/static/upload-img.json",name:"file",showFileList:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"请求地址",type:"input",field:"componentProps.action"},{label:"上传文件字段",type:"input",field:"componentProps.name"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"展示文件列表",type:"switch",field:"componentProps.showFileList"},{label:"拖拽上传",type:"switch",field:"componentProps.drag"},{label:"允许上传最大数量",type:"number",field:"componentProps.limit",componentProps:{min:0,placeholder:"请输入"}},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用",componentProps:{ruleType:"array"}}]},bindModel:"modelValue"},B={component:()=>Promise.resolve().then(()=>require("../../modal-_fid8E1T.cjs")),defaultSchema:{label:"模态框",type:"modal",children:[]},config:{attribute:[{label:"标题",type:"input",field:"title"}]}},O={component:async()=>await Promise.resolve().then(()=>require("../../sign-CpJ83zt4.cjs")),icon:"icon--epic--insert-text-outline-rounded",groupName:"表单",sort:705,defaultSchema:{label:"签名板",type:"sign",field:"sign",input:!0,componentProps:{placeholder:"请输入",lineWidth:4,type:"sign",style:{height:"300px"}}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"线条宽度(px)",type:"input",componentProps:{placeholder:"请选择",clearable:!0},field:"componentProps.lineWidth"},{label:"只读",type:"switch",field:"componentProps.readonly"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}]}};function j(e=y.pluginManager){e.component("FormItem",n.ElFormItem),e.component("Form",n.ElForm),e.component("RadioGroup",n.ElRadioGroup),e.component("RadioButton",n.ElRadioButton),e.component("Tabs",n.ElTabs),e.component("TabPane",n.ElTabPane),e.component("Collapse",n.ElCollapse),e.component("CollapseItem",n.ElCollapseItem),e.component("Drawer",n.ElDrawer),[w,g,h,P,v,C,k,R,V,I,D,z,T,q,M,E,S,x,Y,F,N,B,O].forEach(o=>{e.registerComponent(o),e.addBaseComponentTypes(o.defaultSchema.type)}),e.setInitialized(!0)}function L(e){import("element-plus").then(({provideGlobalConfig:l})=>{l(e)})}exports.provideGlobalConfig=L;exports.setupElementPlus=j;
|
|
@@ -1195,7 +1195,7 @@ const h = {
|
|
|
1195
1195
|
]
|
|
1196
1196
|
}
|
|
1197
1197
|
}, C = {
|
|
1198
|
-
component: () => import("../../radio-
|
|
1198
|
+
component: () => import("../../radio-B_7sUIiA.js"),
|
|
1199
1199
|
groupName: "表单",
|
|
1200
1200
|
icon: "icon--epic--radio-button-checked-outline",
|
|
1201
1201
|
sort: 850,
|
|
@@ -2588,7 +2588,7 @@ const z = {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
}, O = {
|
|
2590
2590
|
// component: async () => await import("../../../../packages/core/components/designer/src"),
|
|
2591
|
-
component: async () => await import("../../sign-
|
|
2591
|
+
component: async () => await import("../../sign-d-TCl0NS.js"),
|
|
2592
2592
|
icon: "icon--epic--insert-text-outline-rounded",
|
|
2593
2593
|
groupName: "表单",
|
|
2594
2594
|
sort: 705,
|
package/package.json
CHANGED
package/dist/index-CTjIY8cx.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),D=require("./axios-CYGTE3lR.cjs");function U(t=10){const a="abcdefghijklmnopqrstuvwxyz0123456789";let o="";for(let r=0;r<t;r++){const n=Math.floor(Math.random()*a.length);o+=a[n]}return o}function j(t){return t.charAt(0).toUpperCase()+t.slice(1)}function _(t,a=new WeakMap){if(typeof t!="object"||t===null)return t;if(a.has(t))return a.get(t);if(Array.isArray(t)){const r=t.map(n=>_(n,a));return a.set(t,r),r}const o={};return a.set(t,o),Object.keys(t).forEach(r=>{o[r]=_(t[r],a)}),o}function he(t){const[a]=ne([_(t)],o=>{var n,s;const r={...o,id:`${o.type}_${U(8)}`};return(r.field||r.input)&&!((s=(n=D.pluginManager.getComponentConfingByType(r.type))==null?void 0:n.editConstraints)!=null&&s.fixedField)&&(r.field=r.id),r});return a}function B(t,a,o=!0){for(const[r,n]of Object.entries(a)){let s=t==null?void 0:t[r];s&&n&&typeof s=="object"&&typeof n=="object"?(Array.isArray(s)&&!Array.isArray(n)?s=t[r]={}:!Array.isArray(s)&&Array.isArray(n)&&(s=t[r]=[]),B(s,n,o)):t[r]=n}o&&Object.keys(t).reverse().forEach(r=>{a.hasOwnProperty(r)||(Array.isArray(t)?t.splice(Number(r),1):delete t[r])})}function Z(t,a,o=[],r=new WeakMap){const n=s=>{if(Array.isArray(s))return s.map(n);if(typeof s=="object"&&s!==null){if(r.has(s))return"[Circular]";r.set(s,!0);const i=Object.keys(s).sort(),c={};return i.forEach(d=>{o.includes(d)||(c[d]=n(s[d]))}),r.delete(s),c}else return s};return JSON.stringify(n(t))===JSON.stringify(n(a))}function ee(t,a){const o=[];let r=!1;function n(s){if(o.push(s),s.id===a&&(r=!0),!r&&s.children!=null&&s.children.length>0)for(let i=0;i<s.children.length&&(n(s.children[i]),!r);i++);if(!r&&s.slots)for(let i in s.slots)for(let c=0;c<s.slots[i].length&&(n(s.slots[i][c]),!r);c++);r||o.pop()}return t.forEach(n),r||console.error(`没有查询到id为${a}的节点`),o}function ve(t,a,o){const r=a.split(".");let n=t;for(let s=0;s<r.length;s++){if(n==null)return o;n=n[r[s]]}return n===void 0?o:n}function ge(t,a,o){const r=a.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);let n=t;for(let s=0;s<r.length-1;s++){const i=r[s];n[i]==null&&(n[i]=isNaN(Number(r[s+1]))?{}:[]),n=n[i]}return n[r[r.length-1]]=o,t}function ye(t,a="default"){return te(t,a).map(r=>r.field)}function te(t,a="default"){const o=R(t,n=>{var s;return n.type==="form"&&(((s=n.componentProps)==null?void 0:s.name)??n.name===a)},!0);return R((o==null?void 0:o.children)??[],n=>!!n.input,!1,n=>n.type!=="subform")}function R(t,a,o=!1,r){const n=[],s=[...t];for(;s.length;){const i=s.pop();if(i!=null&&i.children&&(!r||r(i))&&s.push(...i.children),i!=null&&i.slots&&(!r||r(i)))for(let c in i.slots)s.push(...i.slots[c]);if(a(i)&&(n.push(i),o))return i}return o?!1:n}function ne(t,a,o){const r=[...t];for(;r.length;){const n=r.pop();if(n!=null&&n.children&&(!o||o(n))&&r.push(...n.children),n!=null&&n.slots&&(!o||o(n)))for(let s in n.slots)r.push(...n.slots[s]);B(n,a(n))}return t}function we(t,a){const o=R(t,r=>r.id===a,!0);if(!o)throw new Error(`没有查询到id为${a}的节点`);return o}function Se(t,a){const o=[{type:"",children:t}];let r=0,n=null;if(R(o,s=>{if(n=s.children??null,!n){if(s!=null&&s.slots)for(let i in s.slots){n=s.slots[i];for(let c=0;c<n.length;c++)if(n[c].id===a)return r=c,!0}return!1}for(let i=0;i<n.length;i++)if(n[i].id===a)return r=i,!0;return!1},!0),!n)throw new Error(`没有查询到id为${a}的节点`);return{list:n,schema:n[r],index:r}}function be(t){const a={schemas:[{type:"page",id:"root",label:"页面",children:[{label:"表单",type:"form",icon:"epic-icon-daibanshixiang",labelWidth:t.config.labelWidth||100,name:"default",componentProps:{layout:t.config.layout||"horizontal",labelWidth:t.config.labelWidth||100,labelLayout:t.config.labelLayout==="flex"?"fixed":"flex",labelCol:t.config.labelCol||{span:5},wrapperCol:t.config.wrapperCol||{span:19},hideRequiredMark:t.config.hideRequiredMark||!1,colon:t.config.colon||!0,labelAlign:t.config.labelAlign||"right",size:t.config.size||"middle"},children:[],id:"form_"+U()}],componentProps:{style:{padding:"16px"}}}],script:t.script||""};return a.schemas[0].children[0].children=O(t.list),a}function O(t,a){return t.map(o=>{var d,S,g;let r=o.type??"";const n=o.options??{},s=(l,y)=>{r===l&&(r=y,n.defaultValue&&(n.defaultValue=JSON.parse(n.defaultValue)))};if(s("uploadImg","upload-image"),s("uploadFile","upload-file"),r==="date"&&n.range&&(n.type="daterange",delete n.range),(r==="date"||r==="time")&&(n.valueFormat=n.format),r==="textarea"){const{minRows:l,maxRows:y}=n;n.autoSize={minRows:l,maxRows:y},delete n.minRows,delete n.maxRows}r==="number"&&!n.precision&&delete n.precision,n.width&&(n.style={width:n.width},delete n.width),r==="grid"&&(r="row"),a&&a.type==="grid"&&(r="col",n.span=o.span,o.key=U());const i={label:o.label,type:r,icon:o.icon||"",field:o.model,componentProps:n,id:o.key};return(n.noFormItem||!n.showLabel)&&(i.noFormItem=!0,delete n.noFormItem,delete n.showLabel),n.clearable&&(n.allowClear=!0,delete n.clearable),["input","textarea","number","password","select","cascader","checkbox","radio","date","time","slider","switch","color-picker","upload-file","upload-image"].includes(r)&&(i.input=!0,((S=(d=o.rules)==null?void 0:d[0])==null?void 0:S.required)===!1&&o.rules.shift(),((g=o.rules)==null?void 0:g.length)>0&&(i.rules=o.rules)),o.list&&(i.children=O(o.list,o)),o.columns&&(i.children=O(o.columns,o)),o.trs&&(i.children=O(o.trs,o)),o.tds&&(i.children=O(o.tds,o)),i})}function Ce(t,a){let o=null;return(...r)=>{o&&clearTimeout(o),o=setTimeout(()=>{t(...r)},a)}}function Q(){const t=e.ref({}),a=e.ref({}),o=e.ref(!1),r=e.ref([]),n=e.reactive({});function s(h){return t.value[h]}function i(h,w){t.value[h]=w}function c(h){delete t.value[h]}function d(h,w=!1){const v=Object.entries(D.pluginManager.publicMethods).reduce((A,[V,M])=>(A[V]=M.handler,A),{});try{new Function(`const epic = this;${h}`).bind({...v,getComponent:s,find:s,defineExpose:S,publicMethods:v,pluginManager:D.pluginManager})()}catch(A){w&&console.error("[epic:自定义函数]异常:",A)}}function S(h){h!=null&&(a.value=h)}function g(h,...w){if(!h||h.length===0){console.warn("未提供任何动作");return}h.forEach(v=>{const A=v.args?JSON.parse(v.args):w;switch(v.type){case"public":l(v,A);break;case"custom":y(v,A);break;case"component":f(v,A);break;default:console.warn(`未知的动作类型: ${v.type}`);break}})}function l(h,w){var v;try{(v=D.pluginManager.publicMethods[h.methodName])==null||v.handler(...w)}catch(A){console.error(`[Epic:公共函数(${h.methodName})]执行异常:`,A)}}function y(h,w){var v,A;try{(A=(v=a.value)[h.methodName])==null||A.call(v,...w)}catch(V){console.error(`[Epic:自定义函数(${h.methodName})]执行异常:`,V)}}function f(h,w){const v=h.componentId!=null&&s(h.componentId);if(!v){console.warn(`[Epic:组件${h.componentId}]未找到`);return}try{v[h.methodName](...w)}catch(A){console.error(`[Epic:组件${h.componentId}函数(${h.methodName})]执行异常:`,A)}}function p(h=!0){o.value=h}function u(h){const w=R(h,()=>!0);r.value=w.map(v=>v.id)}function k(h,w="default"){if(n[w]){const v=n[w];B(h,v)}n[w]=h}function P(h,w="default"){if(n[w]){B(n[w],h,!1);return}n[w]=h}return{componentInstances:t,funcs:a,isDesignMode:o,defaultComponentIds:r,forms:n,addFormData:k,setFormData:P,getComponentInstance:s,find:s,addComponentInstance:i,removeComponentInstance:c,setMethods:d,doActions:g,setDesignMode:p,setDefaultComponentIds:u}}function oe(){const t=e.ref([]),a=e.ref([]),o=e.ref(null);let r=0;function n(d,S="插入组件"){const g=Date.now();r+150>g||(r=g,o.value!=null&&(t.value.push(o.value),a.value.splice(0,a.value.length)),o.value={type:S,componentSchema:JSON.stringify(d)},t.value.length>60&&t.value.unshift())}function s(){if(t.value.length===0)return!1;const d=t.value.pop();return o.value!=null&&a.value.push(o.value),o.value=d,JSON.parse(d.componentSchema)}function i(){if(a.value.length===0)return!1;const d=a.value.pop();return o.value!=null&&t.value.push(o.value),o.value=d,JSON.parse(d.componentSchema)}function c(){t.value=[],a.value=[],o.value=null}return{recordList:t,undoList:a,currentRecord:o,push:n,undo:s,redo:i,reset:c}}const ke=e.defineComponent({__name:"dynamicFormItem",props:{hasFormItem:{type:Boolean},formItemProps:{}},emits:["updateFormItemRef"],setup(t,{emit:a}){const o=D.pluginManager.getComponent("form-item"),r=t,n=a,s=e.ref(),i=()=>{n("updateFormItemRef",s.value)};return(c,d)=>r.hasFormItem?(e.openBlock(),e.createBlock(e.unref(o),e.mergeProps({key:0,ref_key:"formItemRef",ref:s,onVnodeMounted:i},r.formItemProps),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["onVnodeMounted"])):e.renderSlot(c.$slots,"default",{key:1})}}),re=e.defineComponent({name:"ENode",__name:"node",props:{componentSchema:{},modelValue:{},ruleField:{},resetFormData:{type:Boolean},name:{},dynamicId:{},sourceDateUrl:{}},emits:["update:modelValue","change","update:dynamicId"],setup(t,{emit:a}){const{proxy:o}=e.getCurrentInstance(),r=t,n=e.ref(null);let s=e.inject("formData",e.reactive({}));const i=e.inject("slots",{}),c=e.inject("pageManager",{}),d=e.inject("disabled",{value:!1}),S=e.inject("ruleFieldPrefix",null),g=e.inject("resetFormData",!1);let l=e.reactive(_(r.componentSchema));p();async function y(m){if(["cascader","checkbox","select","radio"].includes(m.type)&&m.componentProps.dynamicId&&r.sourceDateUrl){const C=(await D.axios({url:r.sourceDateUrl,method:"get",params:{id:m.componentProps.dynamicId}})).data.data;let x=await D.axios({url:C.url,method:C.method,data:JSON.parse(C.body),params:JSON.parse(C.params),headers:JSON.parse(C.headers)});if(C&&(C!=null&&C.dataPath)){const fe=C.dataPath.split(".").reduce((pe,me)=>pe[me],x.data);m.componentProps.options=f(fe,C.dataKey,C.dataValue)}else m.componentProps.options=f(x.data,C.dataKey,C.dataValue);return m}return m}function f(m,E,I){return m&&Object.prototype.toString.call(m)==="[object Array]"?m.map(C=>C.children&&C.children.length?{label:C[E],value:C[I]+"",children:f(C.children,E,I)}:{label:C[E],value:C[I]+""}):[]}e.watch(()=>r.componentSchema,m=>{Z(l,m,["children"])||(B(l,_(m)),p())},{deep:!0});function p(){c.isDesignMode.value&&typeof l.field=="string"&&(l.field+="-design-mode")}(r.resetFormData||g)&&(s={});const u=a,k=e.ref(),P=e.ref(),h=m=>{P.value=m},w=e.useAttrs();Object.keys(w).length&&e.provide("nodeAttrs",w);const v=e.shallowRef(null),A=e.computed(()=>{var m,E;return(m=l.componentProps)!=null&&m.hidden?!1:typeof l.show=="boolean"?l.show:((E=l.show)==null?void 0:E.call(l,{values:s}))??!0}),V=e.computed(()=>{var C;const m=A.value&&((C=l.rules)==null?void 0:C.map(x=>({...x,validator:x.validator&&c.funcs.value[x.validator]})));let E=l.field;r.ruleField?E=r.ruleField:S&&l.field&&(E=_(S),E.push(l.field));const I={...l,rules:m,rule:m,field:E};return I.children&&delete I.children,I}),M=e.computed(()=>{var I,C;const m=((I=N.value)==null?void 0:I.bindModel)??"modelValue",E={};return l.on&&Object.keys(l.on).forEach(x=>{E[`on${j(x)}`]=(...X)=>c.doActions(l.on[x],...X)}),{...r,...l.componentProps,disabled:(d==null?void 0:d.value)||((C=l.componentProps)==null?void 0:C.disabled),bindModel:m,...E}}),N=e.computed(()=>D.pluginManager.getComponentConfingByType(l.type)??null);e.watchEffect(()=>{n.value=r.modelValue??s[l.field??""]}),e.watch(()=>n.value,()=>{n.value!==(r.modelValue??s[l.field??""])&&b(n.value)}),e.watch(()=>k.value,()=>{L()},{immediate:!0});function L(){var E;const m=k.value||o;l.id&&m&&(l.input&&(m.setValue=b,m.getValue=()=>s[l.field]||r.modelValue),m.setAttr=(I,C)=>(l.componentProps||(l.componentProps={}),l.componentProps[I]=C),m.getAttr=I=>l.componentProps[I],c.addComponentInstance(l.id,m),(E=N.value)!=null&&E.defaultSchema.input&&l.noFormItem!==!0&&P.value&&c.addComponentInstance(l.id+"formItem",P.value))}function W(){var m;l.id&&(c.removeComponentInstance(l.id),(m=N.value)!=null&&m.defaultSchema.input&&l.noFormItem!==!0&&c.removeComponentInstance(l.id+"formItem"))}async function z(){var E,I,C;if(l=await y(l),typeof((E=l.componentProps)==null?void 0:E.defaultValue)<"u"){const x=c.isDesignMode.value?(I=l.componentProps)==null?void 0:I.defaultValue:s[l.field]??((C=l.componentProps)==null?void 0:C.defaultValue);b(_(x))}if(l.type==="slot"){const x=l.slotName;if(!x)return;v.value=e.defineComponent({setup(){return()=>e.renderSlot(i,x,{componentSchema:l,model:s})}});return}const m=D.pluginManager.getComponent(l.type);if(!m){console.error(`组件${l.type}未注册`);return}if(typeof m=="function"){const x=await m();v.value=x.default??x}else v.value=m}function b(m){u("update:modelValue",m),u("change",m),l.field&&(s[l.field]=m),D.EventBus.emit("updateformData",s)}function T(m){u("update:dynamicId",m)}let Y=null;return e.watch(()=>l,async m=>{const E=JSON.stringify({...m,children:void 0,componentProps:{...m.componentProps,options:null}});if(E===Y)return!1;Y=E,z()},{immediate:!0,deep:!0}),e.onUnmounted(W),(m,E)=>{var C;const I=e.resolveComponent("ENode");return v.value&&A.value?(e.openBlock(),e.createBlock(ke,{key:0,hasFormItem:e.unref(l).noFormItem!==!0&&((C=N.value)==null?void 0:C.defaultSchema.input),formItemProps:V.value,onUpdateFormItemRef:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v.value),e.mergeProps({ref_key:"componentInstance",ref:k,onVnodeMounted:L,model:e.unref(s)},{...M.value},{[M.value.bindModel]:n.value,["onUpdate:"+M.value.bindModel]:E[0]||(E[0]=x=>n.value=x),[`onUpdate:${M.value.bindModel}`||""]:b,"onUpdate:dynamicId":T}),{node:e.withCtx(x=>[e.createVNode(I,e.mergeProps(x,{sourceDateUrl:r.sourceDateUrl}),null,16,["sourceDateUrl"])]),"edit-node":e.withCtx(()=>[e.renderSlot(m.$slots,"edit-node")]),_:3},16,["model"]))]),_:3},8,["hasFormItem","formItemProps"])):e.createCommentVNode("",!0)}}});function Ee(){const t=e.ref(!1),a=Q(),o=e.ref({});function r(){return new Promise(f=>{if(t.value)f();else{const p=e.watch(t,()=>{p(),f()})}})}async function n(f="default"){var u;await r();const p=(u=o.value)==null?void 0:u[f];if(!p)throw new Error(`表单 [name=${f}] 不存在`);return p}async function s(f,p){const u=await n(f);return _(await p(u))}async function i(f="default"){return await s(f,p=>p.getData())}function c(f,p="default"){var k;a.setFormData(f,p);const u=(k=o.value)==null?void 0:k[p];console.log("%c [ form ]-63","font-size:13px; background:pink; color:#bf2c9f;",u),u==null||u.clearValidate()}async function d(f="default"){return await s(f,async p=>(await p.validate(),await p.getData()))}async function S(f){await r();const p={};for(const u in o.value){const k=o.value[u];k&&(p[u]=_(await f(k)))}return p}async function g(){return await S(f=>f.getData())}function l(f){for(const p in f)c(f[p],p)}async function y(){return await S(async f=>(await f.validate(),await f.getData()))}return{ready:t,pageManager:a,forms:o,getData:i,setData:c,validate:d,getForms:g,setForms:l,validateAll:y,getFormInstance:n}}const De={key:0,class:"epic-loading-box"},Ae={class:"epic-builder-main"},xe={class:"epic-loading-box"},ae=e.defineComponent({__name:"builder",props:{pageSchema:{},formData:{},disabled:{type:Boolean},sourceDateUrl:{}},emits:["change","ready"],setup(t,{expose:a,emit:o}){const r=D.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Cap7FkuS.cjs"))),n=o,{ready:s,pageManager:i,forms:c,getData:d,setData:S,validate:g,getForms:l,setForms:y,validateAll:f,getFormInstance:p}=Ee(),u=t,k=e.reactive({schemas:[]});e.watch(()=>u.pageSchema,v=>{B(k,v)},{immediate:!0,deep:!0}),e.watch(()=>u.formData,v=>{v&&S(v)},{immediate:!0,deep:!0}),e.watch(()=>k.script,v=>{v&&i.setMethods(v,!0)},{immediate:!0}),e.provide("slots",e.useSlots()),e.provide("pageManager",i),e.provide("forms",c),e.provide("pageSchema",k),e.provide("disabled",e.computed(()=>u.disabled));const P=e.getCurrentInstance(),h=P==null?void 0:P.proxy;function w(){e.nextTick(()=>{s.value=!0,n("ready",i),h&&i.addComponentInstance("builder",h)})}return D.EventBus.on("updateformData",v=>{console.log("%c [ e ]-122","font-size:13px; background:pink; color:#bf2c9f;",v),n("change",v)}),a({ready:s,pageManager:i,getData:d,setData:S,validate:g,getForms:l,setForms:y,validateAll:f,getFormInstance:p}),(v,A)=>e.unref(D.pluginManager).initialized.value?(e.openBlock(),e.createBlock(e.Suspense,{key:1,onResolve:w},{default:e.withCtx(()=>[e.createElementVNode("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.schemas,(V,M)=>(e.openBlock(),e.createBlock(e.unref(re),{key:M,sourceDateUrl:u.sourceDateUrl,componentSchema:V,onChange:v.getDataChange},null,8,["sourceDateUrl","componentSchema","onChange"]))),128))])]),fallback:e.withCtx(()=>[e.createElementVNode("div",xe,[e.createVNode(e.unref(r))])]),_:1})):(e.openBlock(),e.createElementBlock("div",De))}});function G(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Ie(t){let a=0,o,r;const n=()=>{a-=1,r&&a<=0&&(r.stop(),o=void 0,r=void 0)};return(...s)=>(a+=1,r||(r=e.effectScope(!0),o=r.run(()=>t(...s))),G(n),o)}function $(t){return typeof t=="function"?t():e.unref(t)}const Pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ve=t=>typeof t<"u",_e=Object.prototype.toString,Me=t=>_e.call(t)==="[object Object]",Be=()=>{};function Ne(t){return e.getCurrentInstance()}function Fe(t,a=!0,o){Ne()?e.onMounted(t,o):a?t():e.nextTick(t)}function Oe(t=!1,a={}){const{truthyValue:o=!0,falsyValue:r=!1}=a,n=e.isRef(t),s=e.ref(t);function i(c){if(arguments.length)return s.value=c,s.value;{const d=$(o);return s.value=s.value===d?$(r):d,s.value}}return n?i:[s,i]}function Re(t,a,o){const r=e.watch(t,(...n)=>(e.nextTick(()=>r()),a(...n)),o);return r}const J=Pe?window:void 0;function F(t){var a;const o=$(t);return(a=o==null?void 0:o.$el)!=null?a:o}function $e(...t){let a,o,r,n;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,r,n]=t,a=J):[a,o,r,n]=t,!a)return Be;Array.isArray(o)||(o=[o]),Array.isArray(r)||(r=[r]);const s=[],i=()=>{s.forEach(g=>g()),s.length=0},c=(g,l,y,f)=>(g.addEventListener(l,y,f),()=>g.removeEventListener(l,y,f)),d=e.watch(()=>[F(a),$(n)],([g,l])=>{if(i(),!g)return;const y=Me(l)?{...l}:l;s.push(...o.flatMap(f=>r.map(p=>c(g,f,p,y))))},{immediate:!0,flush:"post"}),S=()=>{d(),i()};return G(S),S}function Te(t){return typeof t=="function"?t:typeof t=="string"?a=>a.key===t:Array.isArray(t)?a=>t.includes(a.key):()=>!0}function se(...t){let a,o,r={};t.length===3?(a=t[0],o=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(a=!0,o=t[0],r=t[1]):(a=t[0],o=t[1]):(a=!0,o=t[0]);const{target:n=J,eventName:s="keydown",passive:i=!1,dedupe:c=!1}=r,d=Te(a);return $e(n,s,g=>{g.repeat&&$(c)||d(g)&&o(g)},i)}function H(t,a,o={}){return se(t,a,{...o,eventName:"keydown"})}function K(t,a,o={}){return se(t,a,{...o,eventName:"keyup"})}function Ue(){const t=e.ref(!1),a=e.getCurrentInstance();return a&&e.onMounted(()=>{t.value=!0},a),t}function qe(t){const a=Ue();return e.computed(()=>(a.value,!!t()))}function Le(t){return JSON.parse(JSON.stringify(t))}function le(t,a,o={}){const{window:r=J,...n}=o;let s;const i=qe(()=>r&&"ResizeObserver"in r),c=()=>{s&&(s.disconnect(),s=void 0)},d=e.computed(()=>{const l=$(t);return Array.isArray(l)?l.map(y=>F(y)):[F(l)]}),S=e.watch(d,l=>{if(c(),i.value&&r){s=new ResizeObserver(a);for(const y of l)y&&s.observe(y,n)}},{immediate:!0,flush:"post"}),g=()=>{c(),S()};return G(g),{isSupported:i,stop:g}}function ze(t,a={width:0,height:0},o={}){const{window:r=J,box:n="content-box"}=o,s=e.computed(()=>{var l,y;return(y=(l=F(t))==null?void 0:l.namespaceURI)==null?void 0:y.includes("svg")}),i=e.ref(a.width),c=e.ref(a.height),{stop:d}=le(t,([l])=>{const y=n==="border-box"?l.borderBoxSize:n==="content-box"?l.contentBoxSize:l.devicePixelContentBoxSize;if(r&&s.value){const f=F(t);if(f){const p=f.getBoundingClientRect();i.value=p.width,c.value=p.height}}else if(y){const f=Array.isArray(y)?y:[y];i.value=f.reduce((p,{inlineSize:u})=>p+u,0),c.value=f.reduce((p,{blockSize:u})=>p+u,0)}else i.value=l.contentRect.width,c.value=l.contentRect.height},o);Fe(()=>{const l=F(t);l&&(i.value="offsetWidth"in l?l.offsetWidth:a.width,c.value="offsetHeight"in l?l.offsetHeight:a.height)});const S=e.watch(()=>F(t),l=>{i.value=l?a.width:0,c.value=l?a.height:0});function g(){d(),S()}return{width:i,height:c,stop:g}}function Je(t,a,o,r={}){var n,s,i;const{clone:c=!1,passive:d=!1,eventName:S,deep:g=!1,defaultValue:l,shouldEmit:y}=r,f=e.getCurrentInstance(),p=o||(f==null?void 0:f.emit)||((n=f==null?void 0:f.$emit)==null?void 0:n.bind(f))||((i=(s=f==null?void 0:f.proxy)==null?void 0:s.$emit)==null?void 0:i.bind(f==null?void 0:f.proxy));let u=S;a||(a="modelValue"),u=u||`update:${a.toString()}`;const k=w=>c?typeof c=="function"?c(w):Le(w):w,P=()=>Ve(t[a])?k(t[a]):l,h=w=>{y?y(w)&&p(u,w):p(u,w)};if(d){const w=P(),v=e.ref(w);let A=!1;return e.watch(()=>t[a],V=>{A||(A=!0,v.value=k(V),e.nextTick(()=>A=!1))}),e.watch(v,V=>{!A&&(V!==t[a]||g)&&h(V)},{deep:g}),v}else return e.computed({get(){return P()},set(w){h(w)}})}function We(){const{isDark:t}=q(),a=Oe(t);return{isDark:t,toggleDark:a}}function ie(){const t=e.ref(!1);return e.onMounted(()=>{ce(t),He(t)}),e.watch(()=>t.value,()=>{t.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),{isDark:t}}function ce(t){var a=document.documentElement;a&&(a.classList.contains("dark")?t.value=!0:t.value=!1)}function He(t){var a=document.querySelector("html"),o=new MutationObserver(function(r){for(var n of r)if(n.type==="attributes"&&n.attributeName==="class"){const s=n.target;new Array(...s.classList).includes("dark")?t.value=!0:t.value=!1}});o.observe(a,{attributes:!0,attributeFilter:["class"]}),e.onUnmounted(()=>{o.disconnect()})}function ue(){const t=e.ref(1),a=e.ref(!1),{isDark:o}=ie(),{pressSpace:r,pressShift:n,pressCtrl:s}=de();return{canvasScale:t,pressSpace:r,pressShift:n,pressCtrl:s,disabledZoom:a,isDark:o}}const q=Ie(ue);function de(){const t=e.ref(!1),a=e.ref(!1),o=e.ref(!1);return H(" ",()=>{t.value=!0}),K(" ",()=>{t.value=!1}),H("Shift",r=>{r.preventDefault(),a.value=!0}),K("Shift",()=>{a.value=!1}),H("Control",r=>{r.preventDefault(),o.value=!0}),K("Control",()=>{o.value=!1}),{pressSpace:t,pressShift:a,pressCtrl:o}}function Ke(t){const{pressSpace:a}=q(),o=new Image(1,1);o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";let r=0,n=0;function s(d){var S;a.value&&(r=d.x,n=d.y,(S=d.dataTransfer)==null||S.setDragImage(document.createElement("div"),0,0))}function i(d){if(d.preventDefault(),!d.x||!d.y||!a.value)return;const S=d.x-r,g=d.y-n;r=d.x,n=d.y,t.value&&(t.value.scrollTop-=g,t.value.scrollLeft-=S)}function c(){a.value=!1}return{handleElementDragStart:s,handleElementDrag:i,handleElementDragEnd:c}}function Ze(t){const{pressCtrl:a,canvasScale:o,disabledZoom:r}=q();function n(s){if(!a.value||r.value)return;s.preventDefault();let i=0;s.deltaY<0?i=o.value+.05:i=o.value-.05,!(i>150||i<.5)&&(o.value=i)}return e.watch(()=>o.value,s=>{t.value&&!r.value&&(t.value.style.transform=`scale(${s})`)}),{handleZoom:n,canvasScale:o}}function Qe(t,a=16.66){let o;function r(){n(),o=window.setInterval(t,a)}function n(){window.clearInterval(o)}return{startTimedQuery:r,stopTimedQuery:n}}const Ge={class:"min-w-750px rounded"},Ye={class:"h-full rounded"},Xe=e.defineComponent({__name:"index",setup(t,{expose:a}){const o=D.pluginManager.getComponent("monacoEditor"),r=D.pluginManager.getComponent("modal"),n=e.ref(null),s=e.ref(!1),i=e.ref(!1),c=e.ref({}),d=e.inject("pageSchema"),S=e.ref(null),g=e.ref("");function l(){i.value=!1}function y(){s.value=!1}function f(){s.value=!0,g.value=U()}async function p(){try{let u=await S.value.validateAll();if(!Object.keys(u).length){alert("请添加表单组件后再尝试!");return}Object.keys(u).length===1&&(u=u.default),c.value=JSON.stringify(u,null,2),e.nextTick(()=>{var k;(k=n.value)==null||k.setValue(c.value)}),i.value=!0}catch(u){console.error(u)}}return a({handleOpen:f}),(u,k)=>(e.openBlock(),e.createBlock(e.unref(r),{modelValue:s.value,"onUpdate:modelValue":k[1]||(k[1]=P=>s.value=P),title:"预览",class:"w-900px",width:"900px",onClose:y,onOk:p,okText:"表单数据"},{default:e.withCtx(()=>[e.createElementVNode("div",Ge,[(e.openBlock(),e.createBlock(e.unref(ae),{key:g.value,ref_key:"kb",ref:S,"page-schema":e.unref(d)},null,8,["page-schema"])),e.createVNode(e.unref(r),{modelValue:i.value,"onUpdate:modelValue":k[0]||(k[0]=P=>i.value=P),title:"表单数据",class:"w-860px",width:"860px",onClose:l,onOk:l},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[e.createVNode(e.unref(o),{ref_key:"monacoEditorRef",ref:n,autoToggleTheme:"",readOnly:"",class:"h-full editor","model-value":c.value},null,8,["model-value"])])]),_:1},8,["modelValue"])])]),_:1},8,["modelValue"]))}}),je={key:0,class:"epic-loading-box"},et={class:"epic-designer-main"},tt={class:"epic-header-container"},nt={class:"epic-loading-box"},ot=e.defineComponent({__name:"designer",props:{disabledZoom:{type:Boolean,default:!1},hiddenHeader:{type:Boolean,default:!1},lockDefaultSchemaEdit:{type:Boolean,default:!1},formMode:{type:Boolean,default:!1},title:{default:"EpicDesigner默认项目"},defaultSchema:{},sourceCodeReadOnly:{type:Boolean},source:{default:[]},updateSourceId:{}},emits:["ready","save","reset","toggleDeviceMode","saveSourceData","deleteSourceData","updateSourceData"],setup(t,{expose:a,emit:o}){const r=D.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-1afOcXnV.cjs"))),n=D.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BJlPL6eL.cjs"))),s=D.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DbioQCL7.cjs"))),i=D.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-C6ceZM1C.cjs"))),c=D.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Cap7FkuS.cjs"))),d=Q(),S=oe(),g=t;let l={schemas:[{type:"form",id:"root",label:"页面",children:[],componentProps:{name:"表单",style:{padding:"16px"}}}],script:`const { defineExpose, find } = epic;
|
|
2
|
-
|
|
3
|
-
function test (){
|
|
4
|
-
console.log('test')
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// 通过defineExpose暴露的函数或者属性
|
|
8
|
-
defineExpose({
|
|
9
|
-
test
|
|
10
|
-
})`};e.watchEffect(()=>{if(g.defaultSchema){l=g.defaultSchema;return}g.source&&D.pluginManager.setSourceData(g.source),g.formMode&&(l.schemas=D.pluginManager.formSchemas)}),d.setDesignMode(),d.setDefaultComponentIds(l.schemas);const y=o,f=e.ref(null),p=e.reactive({checkedNode:null,hoverNode:null,disableHover:!1,matched:[]}),u=e.reactive({schemas:[],script:l.script}),{disabledZoom:k}=q();e.watchEffect(()=>{k.value=g.disabledZoom}),e.watchEffect(()=>{const b=u.script;b&&b!==""&&d.setMethods(b)}),e.provide("pageSchema",u),e.provide("revoke",S),e.provide("pageManager",d),e.provide("designerProps",e.computed(()=>g)),e.provide("designer",{setCheckedNode:h,setHoverNode:w,setDisableHover:A,handleToggleDeviceMode:W,reset:N,state:p}),D.EventBus.on("saveSourceData",b=>{y("saveSourceData",b)}),D.EventBus.on("deleteSourceData",b=>{y("deleteSourceData",b)}),D.EventBus.on("updateSourceData",b=>{y("updateSourceData",b)});function P(){u.schemas=_(l.schemas),h(u.schemas[0]),S.push(u.schemas,"初始化撤销功能")}async function h(b=u.schemas[0]){p.checkedNode=b,p.matched=ee(u.schemas,b.id)}async function w(b=null){var T;if(!b||p.disableHover)return p.hoverNode=null,!1;if((b==null?void 0:b.id)===((T=p.hoverNode)==null?void 0:T.id))return!1;p.hoverNode=b}function v(){e.nextTick(()=>{y("ready",{pageManager:d})})}async function A(b=!1){p.disableHover=b}function V(b){B(u,_(b))}function M(){return e.toRaw(u)}function N(){Z(u.schemas,l.schemas)&&u.script===l.script||(B(u.schemas,l.schemas),u.script=l.script,h(u.schemas[0]),S.push(u.schemas,"重置操作"),y("reset",u))}function L(){y("save",e.toRaw(u))}function W(b){y("toggleDeviceMode",b)}function z(){f.value.handleOpen()}return P(),a({revoke:S,setData:V,getData:M,reset:N,preview:z}),(b,T)=>e.unref(D.pluginManager).initialized.value?(e.openBlock(),e.createBlock(e.Suspense,{key:1,onResolve:v},{default:e.withCtx(()=>[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.renderSlot(b.$slots,"header",{},()=>[g.hiddenHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r),{key:0,onPreview:z,onSave:L},{header:e.withCtx(()=>[e.renderSlot(b.$slots,"header-prefix")]),prefix:e.withCtx(()=>[e.renderSlot(b.$slots,"header-prefix")]),title:e.withCtx(()=>[e.renderSlot(b.$slots,"header-title")]),"right-prefix":e.withCtx(()=>[e.renderSlot(b.$slots,"header-right-prefix")]),"right-action":e.withCtx(()=>[e.renderSlot(b.$slots,"header-right-action")]),"right-suffix":e.withCtx(()=>[e.renderSlot(b.$slots,"header-right-suffix")]),_:3}))])]),e.createElementVNode("div",{class:e.normalizeClass(["epic-split-view-container",{"hidden-header":b.hiddenHeader}])},[e.createVNode(e.unref(n)),e.createVNode(e.unref(s)),e.createVNode(e.unref(i))],2),e.createVNode(Xe,{ref_key:"previewRef",ref:f},null,512)])]),fallback:e.withCtx(()=>[e.createElementVNode("div",nt,[e.createVNode(e.unref(c))])]),_:3})):(e.openBlock(),e.createElementBlock("div",je))}}),rt={component:async()=>await Promise.resolve().then(()=>require("./index-CpxsakMD.cjs")),defaultSchema:{label:"代码编辑器",type:"monacoEditor",field:"monacoEditor",icon:"epic-icon-write",input:!0},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"monacoEditor",field:"componentProps.defaultValue"}]},bindModel:"model-value"},at={component:async()=>await Promise.resolve().then(()=>require("./index-Ch9jeYmj.cjs")),defaultSchema:{label:"页面",type:"page",componentProps:{},children:[]},config:{attribute:[{label:"页面名称",type:"input",componentProps:{placeholder:"请输入"},field:"componentProps.name"}]}};function st(t){t.component("EInputSize",async()=>await Promise.resolve().then(()=>require("./index-DpzLP1Zp.cjs"))),t.component("EColEditor",async()=>await Promise.resolve().then(()=>require("./index-C5H0qK7d.cjs"))),t.component("EActionEditor",async()=>await Promise.resolve().then(()=>require("./index-D0T4HwOl.cjs"))),t.component("ERuleEditor",async()=>await Promise.resolve().then(()=>require("./index-Bb8XSoYT.cjs"))),t.component("EOptionsEditor",async()=>await Promise.resolve().then(()=>require("./index-jV4vV6jn.cjs"))),t.component("ENode",async()=>await Promise.resolve().then(()=>require("./index-BhIZKk9i.cjs"))),t.component("EDataSource",async()=>await Promise.resolve().then(()=>require("./index-B03W7FZR.cjs"))),t.registerActivitybar({id:"component_view",title:"组件",icon:"icon--epic--extension-outline",component:async()=>await Promise.resolve().then(()=>require("./index-ZbUi21VA.cjs"))}),t.registerActivitybar({id:"outline_view",title:"大纲",icon:"icon--epic--account-tree-outline-rounded",component:async()=>await Promise.resolve().then(()=>require("./outline-CJSEUbgc.cjs"))}),t.registerRightSidebar({id:"attribute_view",title:"属性",component:async()=>await Promise.resolve().then(()=>require("./attributeView-CkDUbzuR.cjs"))}),t.registerRightSidebar({id:"style_view",title:"样式",component:async()=>await Promise.resolve().then(()=>require("./styleView-sGpDpZDg.cjs"))}),[rt,at].forEach(o=>{t.registerComponent(o)})}st(D.pluginManager);exports._sfc_main=re;exports._sfc_main$1=ae;exports._sfc_main$2=ot;exports.capitalizeFirstLetter=j;exports.convertKFormData=be;exports.debounce=Ce;exports.deepClone=_;exports.deepCompareAndModify=B;exports.deepEqual=Z;exports.findSchemaById=we;exports.findSchemaInfoById=Se;exports.findSchemas=R;exports.generateNewSchema=he;exports.getDarkState=ce;exports.getFormFields=ye;exports.getFormSchemas=te;exports.getMatchedById=ee;exports.getUUID=U;exports.getValueByPath=ve;exports.initStore=ue;exports.mapSchemas=ne;exports.recursionConvertedNode=O;exports.setValueByPath=ge;exports.useDark=ie;exports.useElementDrag=Ke;exports.useElementSize=ze;exports.useElementZoom=Ze;exports.useKeyPress=de;exports.usePageManager=Q;exports.useResizeObserver=le;exports.useRevoke=oe;exports.useStore=q;exports.useTheme=We;exports.useTimedQuery=Qe;exports.useVModel=Je;exports.watchOnce=Re;
|
package/dist/index-CtNfh-CD.js
DELETED
package/dist/sign-BDZCr3wJ.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { watch as R, nextTick as U, ref as n, onMounted as A, onUnmounted as H, openBlock as N, createElementBlock as O, normalizeStyle as E, createElementVNode as i, createVNode as x, unref as b, withCtx as w, createTextVNode as P } from "vue";
|
|
2
|
-
import { p as F, a as I } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
const L = { class: "btn" }, G = { class: "btns" }, J = {
|
|
5
|
-
__name: "sign",
|
|
6
|
-
props: {
|
|
7
|
-
componentSchema: {
|
|
8
|
-
type: Object,
|
|
9
|
-
require: !0,
|
|
10
|
-
default: () => ({})
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
emits: ["update:modelValue"],
|
|
14
|
-
setup(_, { expose: k, emit: S }) {
|
|
15
|
-
const d = F.getComponent("button"), T = S, a = _;
|
|
16
|
-
R(
|
|
17
|
-
() => a.componentSchema,
|
|
18
|
-
() => {
|
|
19
|
-
U(() => {
|
|
20
|
-
v();
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
{ deep: !0, immediate: !0 }
|
|
24
|
-
);
|
|
25
|
-
const C = new ResizeObserver((t) => {
|
|
26
|
-
for (const e of t)
|
|
27
|
-
e.target && e.target.clientWidth && e.target.clientHeight && v();
|
|
28
|
-
}), l = n(null), s = n(null), o = n(), D = n("");
|
|
29
|
-
function v() {
|
|
30
|
-
var t, e;
|
|
31
|
-
s.value && ((t = s.value) != null && t.clientHeight) && ((e = s.value) != null && e.clientWidth) && (l.value.height = s.value.clientHeight, l.value.width = s.value.clientWidth, o.value = l.value.getContext("2d"), o.value.lineWidth = a.componentSchema.componentProps.lineWidth || 4, a.componentSchema && a.componentSchema.componentProps && a.componentSchema.componentProps.style && a.componentSchema.componentProps.style.color && (o.value.strokeStyle = a.componentSchema.componentProps.style.color), D.value = l.value.getBoundingClientRect());
|
|
32
|
-
}
|
|
33
|
-
const r = n(""), c = n(""), W = n(""), B = n(""), u = n([]), m = n(!1);
|
|
34
|
-
function M(t) {
|
|
35
|
-
t = t || event, t.preventDefault();
|
|
36
|
-
let e = {
|
|
37
|
-
x: t.offsetX,
|
|
38
|
-
y: t.offsetY
|
|
39
|
-
};
|
|
40
|
-
r.value = e.x, c.value = e.y, o.value.beginPath(), o.value.moveTo(e.x, e.y), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), m.value = !0;
|
|
41
|
-
}
|
|
42
|
-
function z(t) {
|
|
43
|
-
if (t = t || event, t.preventDefault(), m.value) {
|
|
44
|
-
let e = {
|
|
45
|
-
x: t.offsetX,
|
|
46
|
-
y: t.offsetY
|
|
47
|
-
};
|
|
48
|
-
W.value = e.x, B.value = e.y, o.value.beginPath(), o.value.moveTo(r.value, c.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), r.value = e.x, c.value = e.y, u.value.push(e);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function V(t) {
|
|
52
|
-
t = t || event, t.preventDefault();
|
|
53
|
-
let e = {
|
|
54
|
-
x: t.offsetX,
|
|
55
|
-
y: t.offsetY
|
|
56
|
-
};
|
|
57
|
-
o.value.beginPath(), o.value.moveTo(r.value, c.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), u.value.push({ x: -1, y: -1 }), m.value = !1;
|
|
58
|
-
}
|
|
59
|
-
function h() {
|
|
60
|
-
o.value.clearRect(0, 0, l.value.width, l.value.height), u.value = [];
|
|
61
|
-
}
|
|
62
|
-
async function f() {
|
|
63
|
-
let t = await X(l.value.toDataURL("image/png"));
|
|
64
|
-
T("update:modelValue", t);
|
|
65
|
-
}
|
|
66
|
-
async function X(t) {
|
|
67
|
-
let e = atob(t.split(",")[1]), y = new ArrayBuffer(e.length), Y = new Uint8Array(y);
|
|
68
|
-
for (let p = 0; p < e.length; p++)
|
|
69
|
-
Y[p] = e.charCodeAt(p);
|
|
70
|
-
let j = new Blob([y], { type: "image/png" }), g = new FormData();
|
|
71
|
-
return g.append("file", j, Date.now() + "png"), (await I({
|
|
72
|
-
method: "post",
|
|
73
|
-
url: "https://ess-ds.com/prod-api/center-file/file/upload",
|
|
74
|
-
data: g,
|
|
75
|
-
headers: {
|
|
76
|
-
"Content-Type": "multipart/form-data"
|
|
77
|
-
}
|
|
78
|
-
})).data.data.url;
|
|
79
|
-
}
|
|
80
|
-
return A(() => {
|
|
81
|
-
v(), C.observe(s.value);
|
|
82
|
-
}), H(() => {
|
|
83
|
-
}), k({
|
|
84
|
-
surewrite: f
|
|
85
|
-
}), (t, e) => (N(), O("div", {
|
|
86
|
-
class: "sign",
|
|
87
|
-
style: E({
|
|
88
|
-
height: a.componentSchema.componentProps.style.height,
|
|
89
|
-
width: a.componentSchema.componentProps.style.width || "100%"
|
|
90
|
-
})
|
|
91
|
-
}, [
|
|
92
|
-
i("div", {
|
|
93
|
-
class: "canvas",
|
|
94
|
-
ref_key: "canvasWrap",
|
|
95
|
-
ref: s
|
|
96
|
-
}, [
|
|
97
|
-
i("canvas", {
|
|
98
|
-
ref_key: "canvas",
|
|
99
|
-
ref: l,
|
|
100
|
-
onMousedown: M,
|
|
101
|
-
onMousemove: z,
|
|
102
|
-
onMouseup: V
|
|
103
|
-
}, null, 544)
|
|
104
|
-
], 512),
|
|
105
|
-
i("div", L, [
|
|
106
|
-
e[2] || (e[2] = i("div", { class: "remark" }, null, -1)),
|
|
107
|
-
i("div", G, [
|
|
108
|
-
x(b(d), {
|
|
109
|
-
type: "info",
|
|
110
|
-
size: "mini",
|
|
111
|
-
onClick: h,
|
|
112
|
-
onTouch: h
|
|
113
|
-
}, {
|
|
114
|
-
default: w(() => e[0] || (e[0] = [
|
|
115
|
-
P("重写")
|
|
116
|
-
])),
|
|
117
|
-
_: 1
|
|
118
|
-
}),
|
|
119
|
-
x(b(d), {
|
|
120
|
-
type: "primary",
|
|
121
|
-
size: "mini",
|
|
122
|
-
onClick: f,
|
|
123
|
-
onTouch: f
|
|
124
|
-
}, {
|
|
125
|
-
default: w(() => e[1] || (e[1] = [
|
|
126
|
-
P("确定")
|
|
127
|
-
])),
|
|
128
|
-
_: 1
|
|
129
|
-
})
|
|
130
|
-
])
|
|
131
|
-
])
|
|
132
|
-
], 4));
|
|
133
|
-
}
|
|
134
|
-
}, ee = /* @__PURE__ */ q(J, [["__scopeId", "data-v-e972b6e0"]]);
|
|
135
|
-
export {
|
|
136
|
-
ee as default
|
|
137
|
-
};
|
package/dist/sign-Gwu2PIRy.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./axios-CYGTE3lR.cjs"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),E={class:"btn"},j={class:"btns"},z={__name:"sign",props:{componentSchema:{type:Object,require:!0,default:()=>({})}},emits:["update:modelValue"],setup(x,{expose:b,emit:w}){const f=g.pluginManager.getComponent("button"),P=w,a=x;t.watch(()=>a.componentSchema,()=>{t.nextTick(()=>{p()})},{deep:!0,immediate:!0});const S=new ResizeObserver(o=>{for(const e of o)e.target&&e.target.clientWidth&&e.target.clientHeight&&p()}),l=t.ref(null),s=t.ref(null),n=t.ref(),_=t.ref("");function p(){var o,e;s.value&&((o=s.value)!=null&&o.clientHeight)&&((e=s.value)!=null&&e.clientWidth)&&(l.value.height=s.value.clientHeight,l.value.width=s.value.clientWidth,n.value=l.value.getContext("2d"),n.value.lineWidth=a.componentSchema.componentProps.lineWidth||4,a.componentSchema&&a.componentSchema.componentProps&&a.componentSchema.componentProps.style&&a.componentSchema.componentProps.style.color&&(n.value.strokeStyle=a.componentSchema.componentProps.style.color),_.value=l.value.getBoundingClientRect())}const r=t.ref(""),i=t.ref(""),T=t.ref(""),k=t.ref(""),u=t.ref([]),v=t.ref(!1);function V(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};r.value=e.x,i.value=e.y,n.value.beginPath(),n.value.moveTo(e.x,e.y),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),u.value.push(e),v.value=!0}function C(o){if(o=o||event,o.preventDefault(),v.value){let e={x:o.offsetX,y:o.offsetY};T.value=e.x,k.value=e.y,n.value.beginPath(),n.value.moveTo(r.value,i.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),r.value=e.x,i.value=e.y,u.value.push(e)}}function N(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};n.value.beginPath(),n.value.moveTo(r.value,i.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),u.value.push(e),u.value.push({x:-1,y:-1}),v.value=!1}function d(){n.value.clearRect(0,0,l.value.width,l.value.height),u.value=[]}async function m(){let o=await D(l.value.toDataURL("image/png"));P("update:modelValue",o)}async function D(o){let e=atob(o.split(",")[1]),h=new ArrayBuffer(e.length),M=new Uint8Array(h);for(let c=0;c<e.length;c++)M[c]=e.charCodeAt(c);let W=new Blob([h],{type:"image/png"}),y=new FormData;return y.append("file",W,Date.now()+"png"),(await g.axios({method:"post",url:"https://ess-ds.com/prod-api/center-file/file/upload",data:y,headers:{"Content-Type":"multipart/form-data"}})).data.data.url}return t.onMounted(()=>{p(),S.observe(s.value)}),t.onUnmounted(()=>{}),b({surewrite:m}),(o,e)=>(t.openBlock(),t.createElementBlock("div",{class:"sign",style:t.normalizeStyle({height:a.componentSchema.componentProps.style.height,width:a.componentSchema.componentProps.style.width||"100%"})},[t.createElementVNode("div",{class:"canvas",ref_key:"canvasWrap",ref:s},[t.createElementVNode("canvas",{ref_key:"canvas",ref:l,onMousedown:V,onMousemove:C,onMouseup:N},null,544)],512),t.createElementVNode("div",E,[e[2]||(e[2]=t.createElementVNode("div",{class:"remark"},null,-1)),t.createElementVNode("div",j,[t.createVNode(t.unref(f),{type:"info",size:"mini",onClick:d,onTouch:d},{default:t.withCtx(()=>e[0]||(e[0]=[t.createTextVNode("重写")])),_:1}),t.createVNode(t.unref(f),{type:"primary",size:"mini",onClick:m,onTouch:m},{default:t.withCtx(()=>e[1]||(e[1]=[t.createTextVNode("确定")])),_:1})])])],4))}},X=B._export_sfc(z,[["__scopeId","data-v-e972b6e0"]]);exports.default=X;
|