@maxtan/ez-ui 0.14.0 → 0.15.0
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/index.cjs +1 -1
- package/dist/index.js +96 -96
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("element-plus"),z=(t,g)=>(t.install=a=>{for(const r of[t,...Object.values({})])r.name?a.component(r.name,r):process.env.NODE_ENV!=="production"&&console.warn("[withInstall] Component is missing name property:",r)},t);function D(t){return e.computed(()=>{const g={};for(const a in t)a==="class"||a==="style"||a.startsWith("on")||(g[a]=t[a]);return g})}var ae={s:{label:{name:"姓名",email:"电子邮件地址",age:"年龄",sex:"性别",column:"列设置",region:"国家/地区",provinces:"洲/省",city:"城市",post:"邮编",address:"详细地址"},hint:{input:"请输入",select:"请选择"},button:{search:"搜索",query:"查询",add:"新增",edit:"编辑",remove:"删除",reset:"重置",export:"导出",cancel:"取消",confirm:"确认",save:"保存",continue:"继续",view:"查看",detail:"详情",operations:"操作",next:"下一步",pre:"上一步",submit:"提交",back:"返回",expand:"展开",collapse:"收起"},message:{empty:"暂无数据",success:"操作成功",fail:"操作失败",hint:"提示",repeat:"请稍后再试",know:"我知道了",uploadFail:"上传失败"},validate:{special:"不可输入特殊字符",upload:{image:"仅支持图片格式",limit:"上传文件大小不能超过 {max} MB!"}},options:{yes:"是",no:"否",enable:"启用",disable:"停用"},date:{label:"日期",year:"年",month:"月",day:"日",hour:"时",minute:"分",second:"秒",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",sun:"周天"}}};const{s:re}=ae;function ne(t,g){return g.split(".").reduce((a,r)=>a&&typeof a=="object"?a[r]:void 0,t)}function se(t,g={}){return t.replace(/\{\s*(\w+)\s*\}/g,(a,r)=>{const i=g[r];return i!==void 0?String(i):`{${r}}`})}function I(){const{t,lang:g}=n.useLocale();return{t:(r,i={})=>{const f=t(r,i);if(f!==r)return f;const o=ne({s:re},r);return typeof o=="string"?se(o,i):r},lang:g}}const ue=e.defineComponent({name:"EzCheckbox",inheritAttrs:!1}),de=e.defineComponent({...ue,props:e.mergeModels({type:{default:"default"},options:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:g}){const a=t,r=g,i=e.useModel(t,"modelValue"),f=e.useAttrs(),o=D(f),E=e.computed(()=>["default","border"].includes(a.type)?n.ElCheckbox:n.ElCheckboxButton),u=h=>{r("change",h)};return(h,d)=>(e.openBlock(),e.createBlock(e.unref(n.ElCheckboxGroup),e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=v=>i.value=v)},e.unref(o),{onChange:u}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.value),e.mergeProps({key:String(v.value),ref_for:!0},v,{border:t.type==="border"}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),_:2},1040,["border"]))),128))]),_:1},16,["modelValue"]))}}),O=z(de);var L=(t=>(t.CANCEL="取消",t.CONFIRM="确定",t))(L||{});const ce={key:1},pe={key:0,class:"ez-dialog__body"},ie={key:1},fe=e.defineComponent({name:"EzDialog",inheritAttrs:!1,directives:{loading:n.ElLoading.directive}}),me=e.defineComponent({...fe,props:e.mergeModels({title:{default:""},loading:{type:Boolean,default:!1},cancelText:{default:L.CANCEL},confirmText:{default:L.CONFIRM}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["cancel","confirm"],["update:modelValue"]),setup(t,{emit:g}){const{t:a}=I(),r=t,i=g,f=e.useModel(t,"modelValue"),o=e.useAttrs(),E=D(o),u=()=>{f.value=!1,i("cancel")},h=()=>{i("confirm")};return(d,v)=>{const _=e.resolveDirective("loading");return e.openBlock(),e.createBlock(e.unref(n.ElDialog),e.mergeProps({modelValue:f.value,"onUpdate:modelValue":v[0]||(v[0]=w=>f.value=w),class:"ez-dialog",width:800,"append-to-body":!1,"close-on-click-modal":!1,"destroy-on-close":!0,"close-on-press-escape":!1},e.unref(E)),{header:e.withCtx(()=>[d.$slots.header?e.renderSlot(d.$slots,"header",{key:0}):(e.openBlock(),e.createElementBlock("p",ce,e.toDisplayString(r.title),1))]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.unref(n.ElScrollbar),null,{default:e.withCtx(()=>[d.$slots.default?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(d.$slots,"default")])):e.createCommentVNode("",!0)]),_:3})),[[_,r.loading]])]),footer:e.withCtx(()=>[d.$slots.footer?e.renderSlot(d.$slots,"footer",{key:0}):(e.openBlock(),e.createElementBlock("div",ie,[r.cancelText?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,type:"default",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.cancelText===e.unref(L).CANCEL?e.unref(a)("s.button.cancel"):r.cancelText),1)]),_:1})):e.createCommentVNode("",!0),r.confirmText?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:1,type:"primary",loading:r.loading,onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.confirmText===e.unref(L).CONFIRM?e.unref(a)("s.button.confirm"):r.confirmText),1)]),_:1},8,["loading"])):e.createCommentVNode("",!0)]))]),_:3},16,["modelValue"])}}}),ee=z(me),ge=e.defineComponent({name:"EzSelect",inheritAttrs:!1}),ve=e.defineComponent({...ge,props:e.mergeModels({options:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const g=t,a=e.useModel(t,"modelValue"),r=o=>typeof o>"u",i=o=>!r(o.options),f=(o,E)=>o.value!=null&&typeof o.value!="object"?String(o.value):E;return(o,E)=>(e.openBlock(),e.createBlock(e.unref(n.ElSelect),e.mergeProps({modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=u=>a.value=u),clearable:""},o.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.options,(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f(u,h)},[i(u)?(e.openBlock(),e.createBlock(e.unref(n.ElOptionGroup),e.mergeProps({key:0,ref_for:!0},u),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.options,d=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),e.mergeProps({key:f(d,d.value)},{ref_for:!0},d),null,16))),128))]),_:2},1040)):(e.openBlock(),e.createBlock(e.unref(n.ElOption),e.mergeProps({key:1,ref_for:!0},u),null,16))],64))),128))]),_:1},16,["modelValue"]))}}),q=z(ve),ke=e.defineComponent({name:"EzRadio",inheritAttrs:!1}),he=e.defineComponent({...ke,props:e.mergeModels({type:{default:"default"},options:{default:()=>[]}},{modelValue:{type:[String,Number,Boolean]},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:g}){const a=t,r=g,i=e.useModel(t,"modelValue"),f=e.useAttrs(),o=D(f),E=e.computed(()=>["default","border"].includes(a.type)?n.ElRadio:n.ElRadioButton),u=h=>{r("change",h)};return(h,d)=>(e.openBlock(),e.createBlock(e.unref(n.ElRadioGroup),e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=v=>i.value=v)},e.unref(o),{onChange:u}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.value),e.mergeProps({key:String(v.value),ref_for:!0},v,{border:t.type==="border"}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),_:2},1040,["border"]))),128))]),_:1},16,["modelValue"]))}}),H=z(he),Ee=e.defineComponent({name:"EzIcon",inheritAttrs:!1}),Ve=e.defineComponent({...Ee,props:{size:{default:20},color:{default:"inherit"}},setup(t){const g=t,a=e.computed(()=>{const{size:r,color:i}=g;return!r&&!i?{}:{fontSize:r?`${r}px`:void 0,color:i}});return(r,i)=>(e.openBlock(),e.createElementBlock("i",e.mergeProps({class:"ez-icon",style:a.value},r.$attrs),[e.renderSlot(r.$slots,"default",{class:"w-[1em] h-[1em]"})],16))}}),N=z(Ve),Be={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},ye=e.defineComponent({name:"ArrowDown",__name:"ArrowDown",setup(t){return(g,a)=>(e.openBlock(),e.createElementBlock("svg",Be,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"m832 340.992-320 312-320-312a28.8 28.8 0 0 0-20.992-8.96 28.8 28.8 0 0 0-20.992 8.96 28.8 28.8 0 0 0-8.96 20.992c0 8 2.624 14.72 8 19.968l340.992 332.032c5.952 6.016 13.312 8.96 22.016 8.96 8.64 0 16-2.944 22.016-8.96l340.992-331.008a31.23 31.23 0 0 0 8-21.504c0-8.32-3.008-15.36-8.96-20.992a29.76 29.76 0 0 0-42.048.448v.064z"},null,-1)])]))}}),Ce={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},be=e.defineComponent({name:"ArrowUp",__name:"ArrowUp",setup(t){return(g,a)=>(e.openBlock(),e.createElementBlock("svg",Ce,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M488.96 344 148.992 700.992a32.26 32.26 0 0 0-8.96 22.016c0 8 2.944 15.36 8.96 22.016v1.024c6.016 5.952 13.184 8.96 21.504 8.96S185.984 752 192 746.048l320-336 320 336c6.016 5.952 13.184 8.96 21.504 8.96s15.488-3.008 21.504-8.96v-1.024a32.26 32.26 0 0 0 8.96-22.016 32.26 32.26 0 0 0-8.96-22.016L534.976 344A31.17 31.17 0 0 0 512 335.04a31.17 31.17 0 0 0-23.04 8.96"},null,-1)])]))}}),_e={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},Y=e.defineComponent({name:"Delete",__name:"delete",setup(t){return(g,a)=>(e.openBlock(),e.createElementBlock("svg",_e,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M218.88 118.592C208 139.968 208 168 208 245.376V272H96a32 32 0 1 0 0 64h832a32 32 0 0 0 0-64H816v-26.624c0-77.44 0-105.408-10.88-126.72a100.03 100.03 0 0 0-43.712-43.776C740.032 64 712 64 634.624 64H389.376c-77.44 0-105.408 0-126.72 10.88-18.88 9.6-34.176 24.96-43.776 43.712M752 272H272v-64c0-28.032 0-42.304 5.568-52.992a50.24 50.24 0 0 1 21.44-21.44C309.76 128.064 323.968 128 352 128h320c28.032 0 42.304 0 52.992 5.568 9.152 4.736 16.64 12.288 21.44 21.44C751.936 165.696 752 179.968 752 208zM192 416a32 32 0 0 0-32 32v358.4c0 53.76.128 81.28 10.688 101.76a96.54 96.54 0 0 0 41.216 41.152C232.384 959.872 259.84 960 313.6 960h396.8c53.76 0 81.28-.128 101.76-10.688a96.54 96.54 0 0 0 41.152-41.216C863.872 887.616 864 860.16 864 806.4V448a32 32 0 0 0-64 0v371.2c0 26.88 0 40.64-5.376 50.88a48.2 48.2 0 0 1-20.544 20.544c-10.24 5.312-24 5.376-50.88 5.376H300.8c-26.88 0-40.64 0-50.88-5.376a48.2 48.2 0 0 1-20.544-20.544c-5.312-10.24-5.376-24-5.376-50.88V448a32 32 0 0 0-32-32m216 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32m208 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32"},null,-1)])]))}}),we={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},J=e.defineComponent({name:"Plus",__name:"plus",setup(t){return(g,a)=>(e.openBlock(),e.createElementBlock("svg",we,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 0-32 32v352H128a32 32 0 1 0 0 64h352v352a32 32 0 0 0 64 0V544h352a32 32 0 0 0 0-64H544V128a32 32 0 0 0-32-32"},null,-1)])]))}}),Se={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},$e=e.defineComponent({name:"Setting",__name:"setting",setup(t){return(g,a)=>(e.openBlock(),e.createElementBlock("svg",Se,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M218.688 848q27.712 48 83.2 48h374.08q55.424 0 83.136-48l187.008-323.968q27.776-48 0-96L759.104 104.064q-27.712-48-83.2-48H301.952q-55.488 0-83.2 48L31.68 428.032q-27.712 48 0 96zm55.424-32L87.104 492.032q-9.216-16 0-32l187.008-323.968q9.28-16 27.776-16h374.08q18.432 0 27.712 16l187.008 323.968q9.28 16 0 32L703.68 816q-9.28 16-27.712 16h-374.08q-18.56 0-27.776-16m54.784-339.968a160 160 0 1 0 320 0 160 160 0 0 0-320 0m64 0a96 96 0 1 1 192 0 96 96 0 0 1-192 0"},null,-1)])]))}}),xe={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},Z=e.defineComponent({name:"ZoomIn",__name:"ZoomIn",setup(t){return(g,a)=>(e.openBlock(),e.createElementBlock("svg",xe,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M764.352 809.6a424 424 0 1 1 45.184-45.184l139.456 139.392a31.936 31.936 0 1 1-45.184 45.184L764.352 809.536zM848 488a360 360 0 1 0-720 0 360 360 0 0 0 720 0"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M294.4 486.4a32 32 0 0 0 32 32h128v128a32 32 0 0 0 64 0v-128h128a32 32 0 0 0 0-64h-128v-128a32 32 0 0 0-64 0v128h-128a32 32 0 0 0-32 32"},null,-1)])]))}}),ze={class:"ez-image-upload"},Te={key:0,class:"ez-image-upload__image"},Ae={key:1,class:"ez-image-upload__list"},Pe={class:"flex items-center justify-center h-full"},Me=e.defineComponent({name:"EzImageUpload",inheritAttrs:!1}),Ne=e.defineComponent({...Me,props:e.mergeModels({api:{type:Function,default:()=>Promise.resolve({url:""})},imageTypes:{default:()=>["image/webp","image/png","image/jpg","image/gif","image/bmp","image/jpeg"]},limitSize:{default:10},style:{default:()=>({width:"100px",height:"100px"})},fit:{default:"contain"},multiple:{type:Boolean,default:!1},limit:{default:9},disabled:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:g}){const a=t,r=e.useAttrs(),i=D(r),{t:f}=I(),o=e.ref(!1),E=e.ref(0),u=e.useModel(t,"modelValue"),h=e.computed(()=>a.multiple),d=/^(https?:\/\/|data:|blob:)/i,v=e.computed(()=>u.value?_(u.value):[]);function _(V){if(!V)return[];const c=/^(https?:\/\/|data:|blob:)/i;let B=[],y="",$=!1;V=V.trim().replace(/,$/,"");const R=V.split(",");for(let x=0;x<R.length;x++){const T=R[x].trim();T&&(c.test(T)?($&&y&&B.push(y.trim()),y=T,$=!0):$?y+=","+T:c.test(T.trim())&&B.push(T.trim()))}return $&&y&&B.push(y.trim()),B.filter(x=>x&&c.test(x))}function w(V){return!V||V.length===0?"":V.filter(c=>c.trim()).map(c=>c.trim()).join(",")}const S=V=>a.disabled?(n.ElMessage.warning(f("s.message.disabled")),!1):a.imageTypes.includes(V.type.toLocaleLowerCase())?V.size>a.limitSize*1024*1024?(n.ElMessage.error(f("s.validate.upload.limit",{max:a.limitSize})),!1):!0:(n.ElMessage.error(f("s.validate.upload.image")),!1),A=async({file:V})=>{if(!a.disabled)try{const{url:c}=await a.api(V);if(!c)throw new Error(f("s.message.uploadFail"));if(h.value){const B=u.value?_(u.value):[];c&&d.test(c)&&(B.push(c),u.value=w(B))}else u.value=c}catch(c){n.ElMessage.error(c.message)}},P=(V,c=0)=>{V&&(E.value=c,o.value=!0)},M=V=>{if(!a.disabled&&!(!V||!u.value))if(h.value){const c=_(u.value),B=c.findIndex(y=>y===V);B!==-1&&(c.splice(B,1),u.value=c.join(","))}else u.value=null},C=e.ref();return g({getUploadRef:()=>C.value,getUrlList:()=>v.value}),(V,c)=>(e.openBlock(),e.createElementBlock("div",ze,[h.value?(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(B,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"ez-image-upload__item",style:e.normalizeStyle(a.style)},[e.createVNode(e.unref(n.ElImage),{src:B,fit:a.fit},null,8,["src","fit"]),e.createElementVNode("div",{class:"ez-image-upload__handler",onClick:c[3]||(c[3]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(e.unref(N),{size:18,onClick:$=>P(B,y)},{default:e.withCtx(()=>[e.createVNode(e.unref(Z))]),_:1},8,["onClick"]),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(N),{key:0,size:18,onClick:$=>M(B)},{default:e.withCtx(()=>[e.createVNode(e.unref(Y))]),_:1},8,["onClick"]))])],4))),128)),v.value.length<a.limit&&!a.disabled||v.value.length===0?(e.openBlock(),e.createBlock(e.unref(n.ElUpload),e.mergeProps({key:0},e.unref(i),{ref_key:"uploadRef",ref:C,action:"",accept:"image/*","show-file-list":!1,"before-upload":S,"http-request":A,style:a.style,disabled:a.disabled,class:[{"is-disabled":a.disabled},"ez-image-upload__item ez-image-upload__button"]}),{default:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createVNode(e.unref(N),null,{default:e.withCtx(()=>[e.createVNode(e.unref(J))]),_:1})])]),_:1},16,["style","disabled","class"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.unref(n.ElUpload),e.mergeProps({key:0},e.unref(i),{ref_key:"uploadRef",ref:C,action:"",accept:"image/*","show-file-list":!1,"before-upload":S,"http-request":A,style:a.style,disabled:a.disabled,class:["ez-image-upload__wrapper",{"is-disabled":a.disabled}]}),{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(n.ElImage),{src:u.value,fit:a.fit},null,8,["src","fit"]),e.createElementVNode("div",{class:"ez-image-upload__handler",onClick:c[2]||(c[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(e.unref(N),{size:18,onClick:c[0]||(c[0]=B=>P(u.value,0))},{default:e.withCtx(()=>[e.createVNode(e.unref(Z))]),_:1}),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(N),{key:0,size:18,onClick:c[1]||(c[1]=B=>M(u.value))},{default:e.withCtx(()=>[e.createVNode(e.unref(Y))]),_:1}))])])):(e.openBlock(),e.createBlock(e.unref(N),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(J))]),_:1}))]),_:1},16,["style","disabled","class"])),o.value?(e.openBlock(),e.createBlock(e.unref(n.ElImageViewer),{key:2,"url-list":h.value?v.value:[u.value],"initial-index":E.value,onClose:c[4]||(c[4]=B=>o.value=!1)},null,8,["url-list","initial-index"])):e.createCommentVNode("",!0)]))}}),G=z(Ne);var p=(t=>(t.INPUT="input",t.TEXTAREA="textarea",t.NUMBER="number",t.PASSWORD="password",t.SELECT="select",t.RADIO="radio",t.CHECKBOX="checkbox",t.DATE="date",t.DATETIME="datetime",t.DATERANGE="daterange",t.DATETIMERANGE="datetimerange",t.TIME="time",t.TIMERANGE="timerange",t.UPLOAD_IMAGES="upload-images",t.SWITCH="switch",t.TREE_SELECT="tree-select",t.CASCADER="cascader",t.TREE="tree",t.SLIDER="slider",t.RATE="rate",t))(p||{});const De=e.defineComponent({name:"EzDynamicForm",inheritAttrs:!1}),Ue=e.defineComponent({...De,props:{items:{default:()=>[]},modelValue:{},cols:{default:1},gutter:{default:20},formProps:{}},emits:["update:modelValue"],setup(t,{expose:g,emit:a}){const r=t,i=a,f=e.shallowRef(),o=e.ref({});let E=!1;const u=e.useAttrs(),h=e.computed(()=>({...D(u).value,...r.formProps||{}})),d=()=>{const s={...r.modelValue||{}};for(const k of r.items)k.defaultValue!==void 0&&!(k.prop in s)&&(s[k.prop]=k.defaultValue);o.value=s},v=e.computed(()=>!r.items||r.items.length===0?[]:r.items.filter(s=>{if(!s.hidden&&!s.show)return!0;if(s.hidden)return!1;if(s.show)try{return s.show(o.value)}catch(k){return console.error(`[EzDynamicForm] Error in show function for field "${s.prop}":`,k),!1}return!0})),_=e.computed(()=>Math.floor(24/r.cols)),w=s=>s.span!==void 0?Math.max(1,Math.min(24,s.span)):_.value,S=new WeakMap,A=s=>{if(s.rules)return s.rules;if(s.required){if(S.has(s))return S.get(s);const l=[{required:!0,message:s.requiredMessage||`请${M(s.type)}${s.label||""}`,trigger:V(s.type)}];return S.set(s,l),l}},P=new Set([p.SELECT,p.RADIO,p.CHECKBOX,p.DATE,p.DATETIME,p.DATERANGE,p.DATETIMERANGE,p.TIME,p.TIMERANGE,p.SWITCH,p.CASCADER,p.TREE,p.TREE_SELECT]),M=s=>s&&P.has(s)?"选择":"输入",C=new Set([p.SELECT,p.RADIO,p.CHECKBOX,p.DATE,p.DATETIME,p.DATERANGE,p.DATETIMERANGE,p.TIME,p.TIMERANGE,p.SWITCH,p.CASCADER,p.TREE,p.TREE_SELECT,p.SLIDER,p.RATE]),V=s=>s&&C.has(s)?"change":"blur",c=s=>{if(s.disabled)return!0;if(s.disabledWhen)try{return s.disabledWhen(o.value)}catch(k){return console.error(`[EzDynamicForm] Error in disabledWhen function for field "${s.prop}":`,k),!1}return!1},B=async()=>{if(!f.value)return console.warn("[EzDynamicForm] Form ref is not available"),!1;try{return await f.value.validate(),!0}catch{return!1}},y=async s=>{if(!f.value)return console.warn("[EzDynamicForm] Form ref is not available"),!1;try{return await f.value.validateField(s),!0}catch{return!1}},$=s=>{if(!f.value){console.warn("[EzDynamicForm] Form ref is not available");return}f.value.clearValidate(s)},R=s=>{if(!f.value){console.warn("[EzDynamicForm] Form ref is not available");return}f.value.resetFields(s),e.nextTick(()=>{d()})},x=()=>({...o.value}),T=(s,k=!0)=>{if(!s||typeof s!="object"){console.warn("[EzDynamicForm] Invalid data provided to setFormData");return}E=!0,o.value=k?{...o.value,...s}:{...s},e.nextTick(()=>{E=!1})};e.watch(()=>r.modelValue,s=>{s&&!E&&typeof s=="object"&&(E=!0,o.value={...s},e.nextTick(()=>{E=!1}))},{deep:!0,flush:"post"});let U=null;return e.watch(o,s=>{E||(U&&clearTimeout(U),U=setTimeout(()=>{i("update:modelValue",{...s}),U=null},0))},{deep:!0,flush:"post"}),e.onMounted(()=>{d()}),g({validate:B,validateField:y,clearValidate:$,resetFields:R,getFormData:x,setFormData:T,formRef:f}),(s,k)=>(e.openBlock(),e.createBlock(e.unref(n.ElForm),e.mergeProps({ref_key:"formRef",ref:f,model:o.value},h.value,{class:"ez-dynamic-form"}),{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElRow),{gutter:r.gutter},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,l=>(e.openBlock(),e.createBlock(e.unref(n.ElCol),{key:l.prop,span:w(l)},{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElFormItem),e.mergeProps({prop:l.prop,label:l.label,rules:A(l)},{ref_for:!0},l.itemAttrs),e.createSlots({default:e.withCtx(()=>[s.$slots[l.prop]?e.renderSlot(s.$slots,l.prop,{key:0,item:l,value:o.value[l.prop],formData:o.value}):l.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps({key:1,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.type===e.unref(p).INPUT||!l.type?(e.openBlock(),e.createBlock(e.unref(n.ElInput),e.mergeProps({key:0,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,placeholder:l.placeholder||`请输入${l.label||""}`,disabled:c(l),clearable:""},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).TEXTAREA?(e.openBlock(),e.createBlock(e.unref(n.ElInput),e.mergeProps({key:1,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,type:"textarea",placeholder:l.placeholder||`请输入${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).NUMBER?(e.openBlock(),e.createBlock(e.unref(n.ElInputNumber),e.mergeProps({key:2,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,placeholder:l.placeholder,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).PASSWORD?(e.openBlock(),e.createBlock(e.unref(n.ElInput),e.mergeProps({key:3,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,type:"password",placeholder:l.placeholder||`请输入${l.label||""}`,disabled:c(l),"show-password":"",clearable:""},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).SELECT?(e.openBlock(),e.createBlock(e.unref(q),e.mergeProps({key:4,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,options:l.options||[],placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","placeholder","disabled"])):l.type===e.unref(p).RADIO?(e.openBlock(),e.createBlock(e.unref(H),e.mergeProps({key:5,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,options:l.options||[],disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","disabled"])):l.type===e.unref(p).CHECKBOX?(e.openBlock(),e.createBlock(e.unref(O),e.mergeProps({key:6,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,options:l.options||[],disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","disabled"])):l.type===e.unref(p).DATE?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:7,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,type:"date",placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).DATETIME?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:8,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,type:"datetime",placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).DATERANGE?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:9,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).DATETIMERANGE?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:10,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).TIME?(e.openBlock(),e.createBlock(e.unref(n.ElTimePicker),e.mergeProps({key:11,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).TIMERANGE?(e.openBlock(),e.createBlock(e.unref(n.ElTimePicker),e.mergeProps({key:12,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,"is-range":"","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).SWITCH?(e.openBlock(),e.createBlock(e.unref(n.ElSwitch),e.mergeProps({key:13,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).TREE_SELECT?(e.openBlock(),e.createBlock(e.unref(n.ElTreeSelect),e.mergeProps({key:14,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,data:l.options,placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","data","placeholder","disabled"])):l.type===e.unref(p).CASCADER?(e.openBlock(),e.createBlock(e.unref(n.ElCascader),e.mergeProps({key:15,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,options:l.options,placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l),clearable:""},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","placeholder","disabled"])):l.type===e.unref(p).TREE?(e.openBlock(),e.createBlock(e.unref(n.ElTree),e.mergeProps({key:16,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,data:l.options,"show-checkbox":"","node-key":"id"},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","data"])):l.type===e.unref(p).SLIDER?(e.openBlock(),e.createBlock(e.unref(n.ElSlider),e.mergeProps({key:17,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).RATE?(e.openBlock(),e.createBlock(e.unref(n.ElRate),e.mergeProps({key:18,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type==="upload-images"&&l.attrs?.api?(e.openBlock(),e.createBlock(e.unref(G),e.mergeProps({key:19,modelValue:o.value[l.prop],"onUpdate:modelValue":m=>o.value[l.prop]=m,api:l.attrs?.api,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","api","disabled"])):e.createCommentVNode("",!0)],64))]),_:2},[s.$slots[`label-${l.prop}`]?{name:"label",fn:e.withCtx(()=>[e.renderSlot(s.$slots,`label-${l.prop}`,{item:l})]),key:"0"}:void 0]),1040,["prop","label","rules"])]),_:2},1032,["span"]))),128))]),_:3},8,["gutter"])]),_:3},16,["model"]))}}),Re=z(Ue),Le=e.defineComponent({name:"EzTable",inheritAttrs:!1}),Ie=e.defineComponent({...Le,props:{data:{default:()=>[]},columns:{default:()=>[]},rowKey:{}},setup(t,{expose:g}){const a=t,r=e.ref(),i=e.useAttrs(),f=D(i),o=u=>{const h=a.columns[a.columns.length-1],d=()=>u.type?!1:u.prop!==h.prop;return{...{align:"center",hidden:1,resizable:!0,reserveSelection:u.type==="selection",showOverflowTooltip:d()},...u}};return g({getTableRef:()=>r.value}),(u,h)=>(e.openBlock(),e.createBlock(e.unref(n.ElTable),e.mergeProps({ref_key:"tableRef",ref:r,data:a.data,border:"","row-key":"id"},e.unref(f)),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.prop},[["selection","index"].includes(d.type)?(e.openBlock(),e.createBlock(e.unref(n.ElTableColumn),e.mergeProps({key:0,ref_for:!0},o(d)),null,16)):d.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.ElTableColumn),e.mergeProps({key:1,ref_for:!0},o(d)),e.createSlots({_:2},[u.$slots[d.prop]?{name:"default",fn:e.withCtx(v=>[e.renderSlot(u.$slots,d.prop,e.mergeProps({ref_for:!0},v))]),key:"0"}:d.transform?{name:"default",fn:e.withCtx(v=>[e.createTextVNode(e.toDisplayString(d.transform(v.row)),1)]),key:"1"}:void 0,u.$slots[`header-${d.prop}`]?{name:"header",fn:e.withCtx(v=>[e.renderSlot(u.$slots,`header-${d.prop}`,e.mergeProps({ref_for:!0},v))]),key:"2"}:void 0]),1040))],64))),128))]),_:2},[u.$slots?.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"append")]),key:"0"}:void 0,u.$slots?.empty?{name:"empty",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"empty")]),key:"1"}:void 0]),1040,["data"]))}}),j=z(Ie),Fe={class:"ez-search-form"},Oe={class:"ez-search-form__operate"},qe=e.defineComponent({name:"EzSearchForm",inheritAttrs:!1}),He=e.defineComponent({...qe,props:e.mergeModels({collapsedHeight:{default:50},reset:{type:Boolean}},{expanded:{default:!1},expandedModifiers:{}}),emits:["update:expanded"],setup(t,{expose:g}){const a=t,{t:r}=I(),i=e.ref(),f=e.ref(0),o=e.useModel(t,"expanded"),E=e.computed(()=>f.value>a.collapsedHeight),u=e.computed(()=>o.value?be:ye),h=e.computed(()=>o.value?r("s.button.collapse"):r("s.button.expand"));let d=null;const v=()=>{i.value&&(f.value=i.value.scrollHeight,console.log(f.value,a.collapsedHeight,E.value))},_=()=>{o.value=!o.value};return e.onMounted(()=>{setTimeout(()=>{i.value&&(v(),d=new ResizeObserver(v),d.observe(i.value))},50)}),e.onUnmounted(()=>{d&&(d.disconnect(),d=null)}),g({countViewHeight:v}),(w,S)=>(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("div",{class:"ez-search-form__wrapper",style:e.normalizeStyle({height:f.value?o.value?`${f.value}px`:`${a.collapsedHeight}px`:"auto"})},[e.createElementVNode("div",Oe,[e.renderSlot(w.$slots,"operate"),E.value?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,icon:u.value,size:"small",title:h.value,circle:"",onClick:S[0]||(S[0]=A=>_())},null,8,["icon","title"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"wrapRef",ref:i},[e.renderSlot(w.$slots,"default")],512)],4)]))}}),W=z(He),Ge=e.defineComponent({name:"EzPagination",inheritAttrs:!1}),je=e.defineComponent({...Ge,props:{currentPage:{},currentPageModifiers:{},pageSize:{},pageSizeModifiers:{}},emits:e.mergeModels(["current-change","size-change"],["update:currentPage","update:pageSize"]),setup(t,{emit:g}){const a=g,r=e.useModel(t,"currentPage"),i=e.useModel(t,"pageSize"),f=e.useAttrs(),o=D(f),E=h=>{a("current-change",h)},u=h=>{a("size-change",h)};return(h,d)=>(e.openBlock(),e.createBlock(e.unref(n.ElPagination),e.mergeProps({"current-page":r.value,"onUpdate:currentPage":d[0]||(d[0]=v=>r.value=v),"page-size":i.value,"onUpdate:pageSize":d[1]||(d[1]=v=>i.value=v),"page-sizes":[10,20,50,100],layout:"total, sizes, prev, pager, next, jumper"},e.unref(o),{onCurrentChange:E,onSizeChange:u}),null,16,["current-page","page-size"]))}}),K=z(je);var F=(t=>(t.ASC="ascending",t.DESC="descending",t[t.EMPTY=null]="EMPTY",t))(F||{});const We=t=>{const g=e.ref([]),a=e.computed(()=>g.value),r=e.computed(()=>g.value.map(o=>o[t]));return{selectionChange:o=>{g.value=o},getSelectedList:a,getSelectedIds:r,getSortParams:({prop:o,order:E})=>{const u={asc:null,desc:null};return E===F.ASC?(u.asc=o,u.desc=null):E===F.DESC&&(u.asc=null,u.desc=o),u}}},Ke=e.defineComponent({__name:"column-config",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{},columns:{default:()=>[]},columnsModifiers:{}},emits:e.mergeModels(["change"],["update:modelValue","update:columns"]),setup(t,{emit:g}){const{t:a}=I(),r=["selection","index","expand"],i=g,f=e.useModel(t,"modelValue"),o=e.useModel(t,"columns"),E=u=>o.value.filter(d=>d.hidden===0).length<2&&u.hidden===0;return(u,h)=>(e.openBlock(),e.createBlock(e.unref(n.ElDrawer),{modelValue:f.value,"onUpdate:modelValue":h[1]||(h[1]=d=>f.value=d),class:"ez-column-wrapper",title:e.unref(a)("s.label.column"),size:"15%"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.prop},[r.includes(d.type)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.ElCheckbox),{key:0,modelValue:d.hidden,"onUpdate:modelValue":v=>d.hidden=v,class:"flex","true-value":0,"false-value":1,label:d.label,checked:"",disabled:E(d),onChange:h[0]||(h[0]=v=>i("change"))},null,8,["modelValue","onUpdate:modelValue","label","disabled"]))],64))),128))]),_:1},8,["modelValue","title"]))}}),Xe={class:"ez-fast-table"},Ye={class:"ez-fast-table_wrapper"},Je={key:0,class:"ez-fast-table_wrapper_header_operation"},Ze={class:"ez-fast-table_pagination"},Qe=e.defineComponent({name:"EzFastTable",directives:{loading:n.ElLoading.directive},inheritAttrs:!1}),el=e.defineComponent({...Qe,props:e.mergeModels({api:{type:Function,default:()=>Promise.resolve()},beforeSearch:{type:Function,default:()=>Promise.resolve()},columnTool:{type:Boolean,default:!0},expanded:{type:Boolean,default:!1},data:{},columns:{},rowKey:{}},{params:{},paramsModifiers:{},columns:{},columnsModifiers:{},loading:{type:Boolean},loadingModifiers:{}}),emits:e.mergeModels(["changePage","reset","query"],["update:params","update:columns","update:loading"]),setup(t,{expose:g,emit:a}){const{t:r}=I(),i=t,f=e.useAttrs(),o=D(f),E=e.ref(i.expanded),{selectionChange:u,getSelectedList:h,getSortParams:d,getSelectedIds:v}=We(i.rowKey),_=e.ref(null),w=e.ref(!1),S=e.ref(null),A=e.ref([]),P=e.ref(0),M=a,C=e.useModel(t,"params"),V=e.useModel(t,"columns"),c=e.useModel(t,"loading"),B=async()=>{try{c.value=!0,await i.beforeSearch(C.value);const{code:k,data:l}=await i.api(C.value);k===200&&l.records?(A.value=l.records||[],P.value=l.total):(A.value=[],P.value=0),M("query")}finally{c.value=!1}},y=()=>{C.value.current=1,B()},$=()=>_.value?.getTableRef(),R=k=>{const l=d(k);C.value={...C.value,...l};const{column:m}=k;m.sortable==="custom"&&y()},x=k=>JSON.parse(JSON.stringify(k)),T=()=>{C.value=x(S.value),M("reset"),e.nextTick(()=>y())},U=k=>{M("changePage",k),k.size?y():B()},s=()=>{$().doLayout()};return e.onMounted(()=>{S.value=x(C.value)}),g({search:y,query:B,getTableRef:$}),(k,l)=>{const m=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Xe,[k.$slots.form?(e.openBlock(),e.createBlock(e.unref(W),{key:0,loading:c.value,expanded:E.value},{default:e.withCtx(b=>[e.renderSlot(k.$slots,"form",e.normalizeProps(e.guardReactiveProps(b)))]),operate:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{type:"primary",loading:c.value,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("s.button.query")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(n.ElButton),{onClick:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("s.button.reset")),1)]),_:1})]),_:3},8,["loading","expanded"])):e.createCommentVNode("",!0),k.$slots.freeArea?e.renderSlot(k.$slots,"freeArea",{key:1}):e.createCommentVNode("",!0),e.createElementVNode("div",Ye,[k.$slots.header||i.columnTool?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ez-fast-table_wrapper_header",k.$slots.header?"justify-between":"justify-end"])},[k.$slots.header?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(k.$slots,"header",{selectList:e.unref(h),selectIds:e.unref(v)})])):e.createCommentVNode("",!0),i.columnTool?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:1,icon:e.unref($e),circle:"",onClick:l[0]||(l[0]=b=>w.value=!0)},null,8,["icon"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(j),e.mergeProps(e.unref(o),{ref_key:"fastTableRef",ref:_,columns:V.value,data:A.value,onSelectionChange:e.unref(u),onSortChange:R}),e.createSlots({_:2},[e.renderList(k.$slots,(b,X,rl)=>({name:X,fn:e.withCtx(te=>[["form"].includes(b.name)?e.createCommentVNode("",!0):e.renderSlot(k.$slots,X,e.normalizeProps(e.mergeProps({key:0},te)))])}))]),1040,["columns","data","onSelectionChange"])),[[m,c.value]]),e.createElementVNode("div",Ze,[e.createVNode(e.unref(K),{"current-page":C.value.current,"onUpdate:currentPage":[l[1]||(l[1]=b=>C.value.current=b),l[3]||(l[3]=b=>U({current:b}))],"page-size":C.value.size,"onUpdate:pageSize":[l[2]||(l[2]=b=>C.value.size=b),l[4]||(l[4]=b=>U({size:b}))],total:P.value},null,8,["current-page","page-size","total"])])]),e.createVNode(Ke,{modelValue:w.value,"onUpdate:modelValue":l[5]||(l[5]=b=>w.value=b),columns:V.value,"onUpdate:columns":l[6]||(l[6]=b=>V.value=b),onChange:s},null,8,["modelValue","columns"])])}}}),le=z(el),Q=Symbol("INSTALLED_KEY");function ll(t=[]){return{install:a=>{a[Q]||(a[Q]=!0,t.forEach(r=>a.use(r)))}}}const ol=[O,ee,le,N,G,K,H,W,q,j],tl=[n.ElInfiniteScroll,n.ElLoading,n.ElMessage,n.ElMessageBox,n.ElNotification,n.ElPopoverDirective],oe=ll([...ol,...tl]),al=oe.install;exports.EzCheckbox=O;exports.EzDialog=ee;exports.EzDynamicForm=Re;exports.EzFastTable=le;exports.EzIcon=N;exports.EzImageUpload=G;exports.EzPagination=K;exports.EzRadio=H;exports.EzSearchForm=W;exports.EzSelect=q;exports.EzTable=j;exports.FormItemType=p;exports.default=oe;exports.install=al;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("element-plus"),z=(t,m)=>(t.install=a=>{for(const r of[t,...Object.values({})])r.name?a.component(r.name,r):process.env.NODE_ENV!=="production"&&console.warn("[withInstall] Component is missing name property:",r)},t);function D(t){return e.computed(()=>{const m={};for(const a in t)a==="class"||a==="style"||a.startsWith("on")||(m[a]=t[a]);return m})}var ae={s:{label:{name:"姓名",email:"电子邮件地址",age:"年龄",sex:"性别",column:"列设置",region:"国家/地区",provinces:"洲/省",city:"城市",post:"邮编",address:"详细地址"},hint:{input:"请输入",select:"请选择"},button:{search:"搜索",query:"查询",add:"新增",edit:"编辑",remove:"删除",reset:"重置",export:"导出",cancel:"取消",confirm:"确认",save:"保存",continue:"继续",view:"查看",detail:"详情",operations:"操作",next:"下一步",pre:"上一步",submit:"提交",back:"返回",expand:"展开",collapse:"收起"},message:{empty:"暂无数据",success:"操作成功",fail:"操作失败",hint:"提示",repeat:"请稍后再试",know:"我知道了",uploadFail:"上传失败"},validate:{special:"不可输入特殊字符",upload:{image:"仅支持图片格式",limit:"上传文件大小不能超过 {max} MB!"}},options:{yes:"是",no:"否",enable:"启用",disable:"停用"},date:{label:"日期",year:"年",month:"月",day:"日",hour:"时",minute:"分",second:"秒",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",sun:"周天"}}};const{s:re}=ae;function ne(t,m){return m.split(".").reduce((a,r)=>a&&typeof a=="object"?a[r]:void 0,t)}function se(t,m={}){return t.replace(/\{\s*(\w+)\s*\}/g,(a,r)=>{const i=m[r];return i!==void 0?String(i):`{${r}}`})}function I(){const{t,lang:m}=n.useLocale();return{t:(r,i={})=>{const g=t(r,i);if(g!==r)return g;const o=ne({s:re},r);return typeof o=="string"?se(o,i):r},lang:m}}const ue=e.defineComponent({name:"EzCheckbox",inheritAttrs:!1}),de=e.defineComponent({...ue,props:e.mergeModels({type:{default:"default"},options:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:m}){const a=t,r=m,i=e.useModel(t,"modelValue"),g=e.useAttrs(),o=D(g),E=e.computed(()=>["default","border"].includes(a.type)?n.ElCheckbox:n.ElCheckboxButton),u=h=>{r("change",h)};return(h,d)=>(e.openBlock(),e.createBlock(e.unref(n.ElCheckboxGroup),e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=v=>i.value=v)},e.unref(o),{onChange:u}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.value),e.mergeProps({key:String(v.value),ref_for:!0},v,{border:t.type==="border"}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),_:2},1040,["border"]))),128))]),_:1},16,["modelValue"]))}}),O=z(de);var L=(t=>(t.CANCEL="取消",t.CONFIRM="确定",t))(L||{});const ce={key:1},pe={key:0,class:"ez-dialog__body"},ie={key:1},fe=e.defineComponent({name:"EzDialog",inheritAttrs:!1,directives:{loading:n.ElLoading.directive}}),me=e.defineComponent({...fe,props:e.mergeModels({title:{default:""},loading:{type:Boolean,default:!1},cancelText:{default:L.CANCEL},confirmText:{default:L.CONFIRM}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["cancel","confirm"],["update:modelValue"]),setup(t,{emit:m}){const{t:a}=I(),r=t,i=m,g=e.useModel(t,"modelValue"),o=e.useAttrs(),E=D(o),u=()=>{g.value=!1,i("cancel")},h=()=>{i("confirm")};return(d,v)=>{const _=e.resolveDirective("loading");return e.openBlock(),e.createBlock(e.unref(n.ElDialog),e.mergeProps({modelValue:g.value,"onUpdate:modelValue":v[0]||(v[0]=w=>g.value=w),class:"ez-dialog",width:800,"append-to-body":!1,"close-on-click-modal":!1,"destroy-on-close":!0,"close-on-press-escape":!1},e.unref(E)),{header:e.withCtx(()=>[d.$slots.header?e.renderSlot(d.$slots,"header",{key:0}):(e.openBlock(),e.createElementBlock("p",ce,e.toDisplayString(r.title),1))]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.unref(n.ElScrollbar),null,{default:e.withCtx(()=>[d.$slots.default?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(d.$slots,"default")])):e.createCommentVNode("",!0)]),_:3})),[[_,r.loading]])]),footer:e.withCtx(()=>[d.$slots.footer?e.renderSlot(d.$slots,"footer",{key:0}):(e.openBlock(),e.createElementBlock("div",ie,[r.cancelText?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,type:"default",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.cancelText===e.unref(L).CANCEL?e.unref(a)("s.button.cancel"):r.cancelText),1)]),_:1})):e.createCommentVNode("",!0),r.confirmText?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:1,type:"primary",loading:r.loading,onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.confirmText===e.unref(L).CONFIRM?e.unref(a)("s.button.confirm"):r.confirmText),1)]),_:1},8,["loading"])):e.createCommentVNode("",!0)]))]),_:3},16,["modelValue"])}}}),ee=z(me),ge=e.defineComponent({name:"EzSelect",inheritAttrs:!1}),ve=e.defineComponent({...ge,props:e.mergeModels({options:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const m=t,a=e.useModel(t,"modelValue"),r=o=>typeof o>"u",i=o=>!r(o.options),g=(o,E)=>o.value!=null&&typeof o.value!="object"?String(o.value):E;return(o,E)=>(e.openBlock(),e.createBlock(e.unref(n.ElSelect),e.mergeProps({modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=u=>a.value=u),clearable:""},o.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.options,(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g(u,h)},[i(u)?(e.openBlock(),e.createBlock(e.unref(n.ElOptionGroup),e.mergeProps({key:0,ref_for:!0},u),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.options,d=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),e.mergeProps({key:g(d,d.value)},{ref_for:!0},d),null,16))),128))]),_:2},1040)):(e.openBlock(),e.createBlock(e.unref(n.ElOption),e.mergeProps({key:1,ref_for:!0},u),null,16))],64))),128))]),_:1},16,["modelValue"]))}}),q=z(ve),ke=e.defineComponent({name:"EzRadio",inheritAttrs:!1}),he=e.defineComponent({...ke,props:e.mergeModels({type:{default:"default"},options:{default:()=>[]}},{modelValue:{type:[String,Number,Boolean]},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:m}){const a=t,r=m,i=e.useModel(t,"modelValue"),g=e.useAttrs(),o=D(g),E=e.computed(()=>["default","border"].includes(a.type)?n.ElRadio:n.ElRadioButton),u=h=>{r("change",h)};return(h,d)=>(e.openBlock(),e.createBlock(e.unref(n.ElRadioGroup),e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=v=>i.value=v)},e.unref(o),{onChange:u}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.value),e.mergeProps({key:String(v.value),ref_for:!0},v,{border:t.type==="border"}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),_:2},1040,["border"]))),128))]),_:1},16,["modelValue"]))}}),H=z(he),Ee=e.defineComponent({name:"EzIcon",inheritAttrs:!1}),Ve=e.defineComponent({...Ee,props:{size:{default:20},color:{default:"inherit"}},setup(t){const m=t,a=e.computed(()=>{const{size:r,color:i}=m;return!r&&!i?{}:{fontSize:r?`${r}px`:void 0,color:i}});return(r,i)=>(e.openBlock(),e.createElementBlock("i",e.mergeProps({class:"ez-icon",style:a.value},r.$attrs),[e.renderSlot(r.$slots,"default",{class:"w-[1em] h-[1em]"})],16))}}),N=z(Ve),Be={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},ye=e.defineComponent({name:"ArrowDown",__name:"ArrowDown",setup(t){return(m,a)=>(e.openBlock(),e.createElementBlock("svg",Be,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"m832 340.992-320 312-320-312a28.8 28.8 0 0 0-20.992-8.96 28.8 28.8 0 0 0-20.992 8.96 28.8 28.8 0 0 0-8.96 20.992c0 8 2.624 14.72 8 19.968l340.992 332.032c5.952 6.016 13.312 8.96 22.016 8.96 8.64 0 16-2.944 22.016-8.96l340.992-331.008a31.23 31.23 0 0 0 8-21.504c0-8.32-3.008-15.36-8.96-20.992a29.76 29.76 0 0 0-42.048.448v.064z"},null,-1)])]))}}),Ce={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},be=e.defineComponent({name:"ArrowUp",__name:"ArrowUp",setup(t){return(m,a)=>(e.openBlock(),e.createElementBlock("svg",Ce,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M488.96 344 148.992 700.992a32.26 32.26 0 0 0-8.96 22.016c0 8 2.944 15.36 8.96 22.016v1.024c6.016 5.952 13.184 8.96 21.504 8.96S185.984 752 192 746.048l320-336 320 336c6.016 5.952 13.184 8.96 21.504 8.96s15.488-3.008 21.504-8.96v-1.024a32.26 32.26 0 0 0 8.96-22.016 32.26 32.26 0 0 0-8.96-22.016L534.976 344A31.17 31.17 0 0 0 512 335.04a31.17 31.17 0 0 0-23.04 8.96"},null,-1)])]))}}),_e={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},Y=e.defineComponent({name:"Delete",__name:"delete",setup(t){return(m,a)=>(e.openBlock(),e.createElementBlock("svg",_e,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M218.88 118.592C208 139.968 208 168 208 245.376V272H96a32 32 0 1 0 0 64h832a32 32 0 0 0 0-64H816v-26.624c0-77.44 0-105.408-10.88-126.72a100.03 100.03 0 0 0-43.712-43.776C740.032 64 712 64 634.624 64H389.376c-77.44 0-105.408 0-126.72 10.88-18.88 9.6-34.176 24.96-43.776 43.712M752 272H272v-64c0-28.032 0-42.304 5.568-52.992a50.24 50.24 0 0 1 21.44-21.44C309.76 128.064 323.968 128 352 128h320c28.032 0 42.304 0 52.992 5.568 9.152 4.736 16.64 12.288 21.44 21.44C751.936 165.696 752 179.968 752 208zM192 416a32 32 0 0 0-32 32v358.4c0 53.76.128 81.28 10.688 101.76a96.54 96.54 0 0 0 41.216 41.152C232.384 959.872 259.84 960 313.6 960h396.8c53.76 0 81.28-.128 101.76-10.688a96.54 96.54 0 0 0 41.152-41.216C863.872 887.616 864 860.16 864 806.4V448a32 32 0 0 0-64 0v371.2c0 26.88 0 40.64-5.376 50.88a48.2 48.2 0 0 1-20.544 20.544c-10.24 5.312-24 5.376-50.88 5.376H300.8c-26.88 0-40.64 0-50.88-5.376a48.2 48.2 0 0 1-20.544-20.544c-5.312-10.24-5.376-24-5.376-50.88V448a32 32 0 0 0-32-32m216 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32m208 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32"},null,-1)])]))}}),we={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},J=e.defineComponent({name:"Plus",__name:"plus",setup(t){return(m,a)=>(e.openBlock(),e.createElementBlock("svg",we,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 0-32 32v352H128a32 32 0 1 0 0 64h352v352a32 32 0 0 0 64 0V544h352a32 32 0 0 0 0-64H544V128a32 32 0 0 0-32-32"},null,-1)])]))}}),Se={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},$e=e.defineComponent({name:"Setting",__name:"setting",setup(t){return(m,a)=>(e.openBlock(),e.createElementBlock("svg",Se,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M218.688 848q27.712 48 83.2 48h374.08q55.424 0 83.136-48l187.008-323.968q27.776-48 0-96L759.104 104.064q-27.712-48-83.2-48H301.952q-55.488 0-83.2 48L31.68 428.032q-27.712 48 0 96zm55.424-32L87.104 492.032q-9.216-16 0-32l187.008-323.968q9.28-16 27.776-16h374.08q18.432 0 27.712 16l187.008 323.968q9.28 16 0 32L703.68 816q-9.28 16-27.712 16h-374.08q-18.56 0-27.776-16m54.784-339.968a160 160 0 1 0 320 0 160 160 0 0 0-320 0m64 0a96 96 0 1 1 192 0 96 96 0 0 1-192 0"},null,-1)])]))}}),xe={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",viewBox:"0 0 1024 1024"},Z=e.defineComponent({name:"ZoomIn",__name:"ZoomIn",setup(t){return(m,a)=>(e.openBlock(),e.createElementBlock("svg",xe,[...a[0]||(a[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M764.352 809.6a424 424 0 1 1 45.184-45.184l139.456 139.392a31.936 31.936 0 1 1-45.184 45.184L764.352 809.536zM848 488a360 360 0 1 0-720 0 360 360 0 0 0 720 0"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M294.4 486.4a32 32 0 0 0 32 32h128v128a32 32 0 0 0 64 0v-128h128a32 32 0 0 0 0-64h-128v-128a32 32 0 0 0-64 0v128h-128a32 32 0 0 0-32 32"},null,-1)])]))}}),ze={class:"ez-image-upload"},Te={key:0,class:"ez-image-upload__image"},Ae={key:1,class:"ez-image-upload__list"},Pe={class:"flex items-center justify-center h-full"},Me=e.defineComponent({name:"EzImageUpload",inheritAttrs:!1}),Ne=e.defineComponent({...Me,props:e.mergeModels({api:{type:Function,default:()=>Promise.resolve({url:""})},imageTypes:{default:()=>["image/webp","image/png","image/jpg","image/gif","image/bmp","image/jpeg"]},limitSize:{default:10},style:{default:()=>({width:"100px",height:"100px"})},fit:{default:"contain"},multiple:{type:Boolean,default:!1},limit:{default:9},disabled:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:m}){const a=t,r=e.useAttrs(),i=D(r),{t:g}=I(),o=e.ref(!1),E=e.ref(0),u=e.useModel(t,"modelValue"),h=e.computed(()=>a.multiple),d=/^(https?:\/\/|data:|blob:)/i,v=e.computed(()=>u.value?_(u.value):[]);function _(V){if(!V)return[];const c=/^(https?:\/\/|data:|blob:)/i;let B=[],y="",$=!1;V=V.trim().replace(/,$/,"");const R=V.split(",");for(let x=0;x<R.length;x++){const T=R[x].trim();T&&(c.test(T)?($&&y&&B.push(y.trim()),y=T,$=!0):$?y+=","+T:c.test(T.trim())&&B.push(T.trim()))}return $&&y&&B.push(y.trim()),B.filter(x=>x&&c.test(x))}function w(V){return!V||V.length===0?"":V.filter(c=>c.trim()).map(c=>c.trim()).join(",")}const S=V=>a.disabled?(n.ElMessage.warning(g("s.message.disabled")),!1):a.imageTypes.includes(V.type.toLocaleLowerCase())?V.size>a.limitSize*1024*1024?(n.ElMessage.error(g("s.validate.upload.limit",{max:a.limitSize})),!1):!0:(n.ElMessage.error(g("s.validate.upload.image")),!1),A=async({file:V})=>{if(!a.disabled)try{const{url:c}=await a.api(V);if(!c)throw new Error(g("s.message.uploadFail"));if(h.value){const B=u.value?_(u.value):[];c&&d.test(c)&&(B.push(c),u.value=w(B))}else u.value=c}catch(c){n.ElMessage.error(c.message)}},P=(V,c=0)=>{V&&(E.value=c,o.value=!0)},M=V=>{if(!a.disabled&&!(!V||!u.value))if(h.value){const c=_(u.value),B=c.findIndex(y=>y===V);B!==-1&&(c.splice(B,1),u.value=c.join(","))}else u.value=null},C=e.ref();return m({getUploadRef:()=>C.value,getUrlList:()=>v.value}),(V,c)=>(e.openBlock(),e.createElementBlock("div",ze,[h.value?(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(B,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"ez-image-upload__item",style:e.normalizeStyle(a.style)},[e.createVNode(e.unref(n.ElImage),{src:B,fit:a.fit},null,8,["src","fit"]),e.createElementVNode("div",{class:"ez-image-upload__handler",onClick:c[3]||(c[3]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(e.unref(N),{size:18,onClick:$=>P(B,y)},{default:e.withCtx(()=>[e.createVNode(e.unref(Z))]),_:1},8,["onClick"]),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(N),{key:0,size:18,onClick:$=>M(B)},{default:e.withCtx(()=>[e.createVNode(e.unref(Y))]),_:1},8,["onClick"]))])],4))),128)),v.value.length<a.limit&&!a.disabled||v.value.length===0?(e.openBlock(),e.createBlock(e.unref(n.ElUpload),e.mergeProps({key:0},e.unref(i),{ref_key:"uploadRef",ref:C,action:"",accept:"image/*","show-file-list":!1,"before-upload":S,"http-request":A,style:a.style,disabled:a.disabled,class:[{"is-disabled":a.disabled},"ez-image-upload__item ez-image-upload__button"]}),{default:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createVNode(e.unref(N),null,{default:e.withCtx(()=>[e.createVNode(e.unref(J))]),_:1})])]),_:1},16,["style","disabled","class"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.unref(n.ElUpload),e.mergeProps({key:0},e.unref(i),{ref_key:"uploadRef",ref:C,action:"",accept:"image/*","show-file-list":!1,"before-upload":S,"http-request":A,style:a.style,disabled:a.disabled,class:["ez-image-upload__wrapper",{"is-disabled":a.disabled}]}),{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(n.ElImage),{src:u.value,fit:a.fit},null,8,["src","fit"]),e.createElementVNode("div",{class:"ez-image-upload__handler",onClick:c[2]||(c[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(e.unref(N),{size:18,onClick:c[0]||(c[0]=B=>P(u.value,0))},{default:e.withCtx(()=>[e.createVNode(e.unref(Z))]),_:1}),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(N),{key:0,size:18,onClick:c[1]||(c[1]=B=>M(u.value))},{default:e.withCtx(()=>[e.createVNode(e.unref(Y))]),_:1}))])])):(e.openBlock(),e.createBlock(e.unref(N),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(J))]),_:1}))]),_:1},16,["style","disabled","class"])),o.value?(e.openBlock(),e.createBlock(e.unref(n.ElImageViewer),{key:2,"url-list":h.value?v.value:[u.value],"initial-index":E.value,onClose:c[4]||(c[4]=B=>o.value=!1)},null,8,["url-list","initial-index"])):e.createCommentVNode("",!0)]))}}),G=z(Ne);var p=(t=>(t.INPUT="input",t.TEXTAREA="textarea",t.NUMBER="number",t.PASSWORD="password",t.SELECT="select",t.RADIO="radio",t.CHECKBOX="checkbox",t.DATE="date",t.DATETIME="datetime",t.DATERANGE="daterange",t.DATETIMERANGE="datetimerange",t.TIME="time",t.TIMERANGE="timerange",t.UPLOAD_IMAGES="upload-images",t.SWITCH="switch",t.TREE_SELECT="tree-select",t.CASCADER="cascader",t.TREE="tree",t.SLIDER="slider",t.RATE="rate",t))(p||{});const De=e.defineComponent({name:"EzDynamicForm",inheritAttrs:!1}),Ue=e.defineComponent({...De,props:{items:{default:()=>[]},modelValue:{},cols:{default:1},gutter:{default:20},formProps:{}},emits:["update:modelValue"],setup(t,{expose:m,emit:a}){const r=t,i=a,g=e.shallowRef(),o=e.ref({});let E=!1;const u=e.useAttrs(),h=e.computed(()=>({...D(u).value,...r.formProps||{}})),d=()=>{const s={...r.modelValue||{}};for(const k of r.items)k.defaultValue!==void 0&&!(k.prop in s)&&(s[k.prop]=k.defaultValue);o.value=s},v=e.computed(()=>!r.items||r.items.length===0?[]:r.items.filter(s=>{if(!s.hidden&&!s.show)return!0;if(s.hidden)return!1;if(s.show)try{return s.show(o.value)}catch(k){return console.error(`[EzDynamicForm] Error in show function for field "${s.prop}":`,k),!1}return!0})),_=e.computed(()=>Math.floor(24/r.cols)),w=s=>s.span!==void 0?Math.max(1,Math.min(24,s.span)):_.value,S=new WeakMap,A=s=>{if(s.rules)return s.rules;if(s.required){if(S.has(s))return S.get(s);const l=[{required:!0,message:s.requiredMessage||`请${M(s.type)}${s.label||""}`,trigger:V(s.type)}];return S.set(s,l),l}},P=new Set([p.SELECT,p.RADIO,p.CHECKBOX,p.DATE,p.DATETIME,p.DATERANGE,p.DATETIMERANGE,p.TIME,p.TIMERANGE,p.SWITCH,p.CASCADER,p.TREE,p.TREE_SELECT]),M=s=>s&&P.has(s)?"选择":"输入",C=new Set([p.SELECT,p.RADIO,p.CHECKBOX,p.DATE,p.DATETIME,p.DATERANGE,p.DATETIMERANGE,p.TIME,p.TIMERANGE,p.SWITCH,p.CASCADER,p.TREE,p.TREE_SELECT,p.SLIDER,p.RATE]),V=s=>s&&C.has(s)?"change":"blur",c=s=>{if(s.disabled)return!0;if(s.disabledWhen)try{return s.disabledWhen(o.value)}catch(k){return console.error(`[EzDynamicForm] Error in disabledWhen function for field "${s.prop}":`,k),!1}return!1},B=async()=>{if(!g.value)return console.warn("[EzDynamicForm] Form ref is not available"),!1;try{return await g.value.validate(),!0}catch{return!1}},y=async s=>{if(!g.value)return console.warn("[EzDynamicForm] Form ref is not available"),!1;try{return await g.value.validateField(s),!0}catch{return!1}},$=s=>{if(!g.value){console.warn("[EzDynamicForm] Form ref is not available");return}g.value.clearValidate(s)},R=s=>{if(!g.value){console.warn("[EzDynamicForm] Form ref is not available");return}g.value.resetFields(s),e.nextTick(()=>{d()})},x=()=>({...o.value}),T=(s,k=!0)=>{if(!s||typeof s!="object"){console.warn("[EzDynamicForm] Invalid data provided to setFormData");return}E=!0,o.value=k?{...o.value,...s}:{...s},e.nextTick(()=>{E=!1})};e.watch(()=>r.modelValue,s=>{s&&!E&&typeof s=="object"&&(E=!0,o.value={...s},e.nextTick(()=>{E=!1}))},{deep:!0,flush:"post"});let U=null;return e.watch(o,s=>{E||(U&&clearTimeout(U),U=setTimeout(()=>{i("update:modelValue",{...s}),U=null},0))},{deep:!0,flush:"post"}),e.onMounted(()=>{d()}),m({validate:B,validateField:y,clearValidate:$,resetFields:R,getFormData:x,setFormData:T,formRef:g}),(s,k)=>(e.openBlock(),e.createBlock(e.unref(n.ElForm),e.mergeProps({ref_key:"formRef",ref:g,model:o.value},h.value,{class:"ez-dynamic-form"}),{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElRow),{gutter:r.gutter},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,l=>(e.openBlock(),e.createBlock(e.unref(n.ElCol),{key:l.prop,span:w(l)},{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElFormItem),e.mergeProps({prop:l.prop,label:l.label,rules:A(l)},{ref_for:!0},l.itemAttrs),e.createSlots({default:e.withCtx(()=>[s.$slots[l.prop]?e.renderSlot(s.$slots,l.prop,{key:0,item:l,value:o.value[l.prop],formData:o.value}):l.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps({key:1,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.type===e.unref(p).INPUT||!l.type?(e.openBlock(),e.createBlock(e.unref(n.ElInput),e.mergeProps({key:0,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,placeholder:l.placeholder||`请输入${l.label||""}`,disabled:c(l),clearable:""},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).TEXTAREA?(e.openBlock(),e.createBlock(e.unref(n.ElInput),e.mergeProps({key:1,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,type:"textarea",placeholder:l.placeholder||`请输入${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).NUMBER?(e.openBlock(),e.createBlock(e.unref(n.ElInputNumber),e.mergeProps({key:2,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,placeholder:l.placeholder,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).PASSWORD?(e.openBlock(),e.createBlock(e.unref(n.ElInput),e.mergeProps({key:3,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,type:"password",placeholder:l.placeholder||`请输入${l.label||""}`,disabled:c(l),"show-password":"",clearable:""},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).SELECT?(e.openBlock(),e.createBlock(e.unref(q),e.mergeProps({key:4,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,options:l.options||[],placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","placeholder","disabled"])):l.type===e.unref(p).RADIO?(e.openBlock(),e.createBlock(e.unref(H),e.mergeProps({key:5,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,options:l.options||[],disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","disabled"])):l.type===e.unref(p).CHECKBOX?(e.openBlock(),e.createBlock(e.unref(O),e.mergeProps({key:6,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,options:l.options||[],disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","disabled"])):l.type===e.unref(p).DATE?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:7,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,type:"date",placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).DATETIME?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:8,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,type:"datetime",placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).DATERANGE?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:9,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).DATETIMERANGE?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),e.mergeProps({key:10,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).TIME?(e.openBlock(),e.createBlock(e.unref(n.ElTimePicker),e.mergeProps({key:11,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type===e.unref(p).TIMERANGE?(e.openBlock(),e.createBlock(e.unref(n.ElTimePicker),e.mergeProps({key:12,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,"is-range":"","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).SWITCH?(e.openBlock(),e.createBlock(e.unref(n.ElSwitch),e.mergeProps({key:13,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).TREE_SELECT?(e.openBlock(),e.createBlock(e.unref(n.ElTreeSelect),e.mergeProps({key:14,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,data:l.options,placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","data","placeholder","disabled"])):l.type===e.unref(p).CASCADER?(e.openBlock(),e.createBlock(e.unref(n.ElCascader),e.mergeProps({key:15,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,options:l.options,placeholder:l.placeholder||`请选择${l.label||""}`,disabled:c(l),clearable:""},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","options","placeholder","disabled"])):l.type===e.unref(p).TREE?(e.openBlock(),e.createBlock(e.unref(n.ElTree),e.mergeProps({key:16,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,data:l.options,"show-checkbox":"","node-key":"id"},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","data"])):l.type===e.unref(p).SLIDER?(e.openBlock(),e.createBlock(e.unref(n.ElSlider),e.mergeProps({key:17,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type===e.unref(p).RATE?(e.openBlock(),e.createBlock(e.unref(n.ElRate),e.mergeProps({key:18,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type==="upload-images"&&l.attrs?.api?(e.openBlock(),e.createBlock(e.unref(G),e.mergeProps({key:19,modelValue:o.value[l.prop],"onUpdate:modelValue":f=>o.value[l.prop]=f,api:l.attrs?.api,disabled:c(l)},{ref_for:!0},l.attrs),null,16,["modelValue","onUpdate:modelValue","api","disabled"])):e.createCommentVNode("",!0)],64))]),_:2},[s.$slots[`label-${l.prop}`]?{name:"label",fn:e.withCtx(()=>[e.renderSlot(s.$slots,`label-${l.prop}`,{item:l})]),key:"0"}:void 0]),1040,["prop","label","rules"])]),_:2},1032,["span"]))),128))]),_:3},8,["gutter"])]),_:3},16,["model"]))}}),Re=z(Ue),Le=e.defineComponent({name:"EzTable",inheritAttrs:!1}),Ie=e.defineComponent({...Le,props:{data:{default:()=>[]},columns:{default:()=>[]},rowKey:{}},setup(t,{expose:m}){const a=t,r=e.ref(),i=e.useAttrs(),g=D(i),o=u=>{const h=a.columns[a.columns.length-1],d=()=>u.type?!1:u.prop!==h.prop;return{...{align:"center",hidden:1,resizable:!0,reserveSelection:u.type==="selection",showOverflowTooltip:d()},...u}};return m({getTableRef:()=>r.value}),(u,h)=>(e.openBlock(),e.createBlock(e.unref(n.ElTable),e.mergeProps({ref_key:"tableRef",ref:r,data:a.data,border:"","row-key":"id"},e.unref(g)),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.prop},[["selection","index"].includes(d.type)?(e.openBlock(),e.createBlock(e.unref(n.ElTableColumn),e.mergeProps({key:0,ref_for:!0},o(d)),null,16)):d.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.ElTableColumn),e.mergeProps({key:1,ref_for:!0},o(d)),e.createSlots({_:2},[u.$slots[d.prop]?{name:"default",fn:e.withCtx(v=>[e.renderSlot(u.$slots,d.prop,e.mergeProps({ref_for:!0},v))]),key:"0"}:d.transform?{name:"default",fn:e.withCtx(v=>[e.createTextVNode(e.toDisplayString(d.transform(v.row)),1)]),key:"1"}:void 0,u.$slots[`header-${d.prop}`]?{name:"header",fn:e.withCtx(v=>[e.renderSlot(u.$slots,`header-${d.prop}`,e.mergeProps({ref_for:!0},v))]),key:"2"}:void 0]),1040))],64))),128))]),_:2},[u.$slots?.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"append")]),key:"0"}:void 0,u.$slots?.empty?{name:"empty",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"empty")]),key:"1"}:void 0]),1040,["data"]))}}),j=z(Ie),Fe={class:"ez-search-form"},Oe={class:"ez-search-form__operate"},qe=e.defineComponent({name:"EzSearchForm",inheritAttrs:!1}),He=e.defineComponent({...qe,props:e.mergeModels({collapsedHeight:{default:50},reset:{type:Boolean}},{expanded:{default:!1},expandedModifiers:{}}),emits:["update:expanded"],setup(t,{expose:m}){const a=t,{t:r}=I(),i=e.ref(),g=e.ref(0),o=e.useModel(t,"expanded"),E=e.computed(()=>g.value>a.collapsedHeight),u=e.computed(()=>o.value?be:ye),h=e.computed(()=>o.value?r("s.button.collapse"):r("s.button.expand"));let d=null;const v=()=>{i.value&&(g.value=i.value.scrollHeight)},_=()=>{o.value=!o.value};return e.onMounted(()=>{setTimeout(()=>{i.value&&(v(),d=new ResizeObserver(v),d.observe(i.value))},50)}),e.onUnmounted(()=>{d&&(d.disconnect(),d=null)}),m({countViewHeight:v}),(w,S)=>(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("div",{class:"ez-search-form__wrapper",style:e.normalizeStyle({height:g.value?o.value?`${g.value}px`:`${a.collapsedHeight}px`:"auto"})},[e.createElementVNode("div",Oe,[e.renderSlot(w.$slots,"operate"),E.value?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,icon:u.value,size:"small",title:h.value,circle:"",onClick:S[0]||(S[0]=A=>_())},null,8,["icon","title"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"wrapRef",ref:i},[e.renderSlot(w.$slots,"default")],512)],4)]))}}),W=z(He),Ge=e.defineComponent({name:"EzPagination",inheritAttrs:!1}),je=e.defineComponent({...Ge,props:{currentPage:{},currentPageModifiers:{},pageSize:{},pageSizeModifiers:{}},emits:e.mergeModels(["current-change","size-change"],["update:currentPage","update:pageSize"]),setup(t,{emit:m}){const a=m,r=e.useModel(t,"currentPage"),i=e.useModel(t,"pageSize"),g=e.useAttrs(),o=D(g),E=h=>{a("current-change",h)},u=h=>{a("size-change",h)};return(h,d)=>(e.openBlock(),e.createBlock(e.unref(n.ElPagination),e.mergeProps({"current-page":r.value,"onUpdate:currentPage":d[0]||(d[0]=v=>r.value=v),"page-size":i.value,"onUpdate:pageSize":d[1]||(d[1]=v=>i.value=v),"page-sizes":[10,20,50,100],layout:"total, sizes, prev, pager, next, jumper"},e.unref(o),{onCurrentChange:E,onSizeChange:u}),null,16,["current-page","page-size"]))}}),K=z(je);var F=(t=>(t.ASC="ascending",t.DESC="descending",t[t.EMPTY=null]="EMPTY",t))(F||{});const We=t=>{const m=e.ref([]),a=e.computed(()=>m.value),r=e.computed(()=>m.value.map(o=>o[t]));return{selectionChange:o=>{m.value=o},getSelectedList:a,getSelectedIds:r,getSortParams:({prop:o,order:E})=>{const u={asc:null,desc:null};return E===F.ASC?(u.asc=o,u.desc=null):E===F.DESC&&(u.asc=null,u.desc=o),u}}},Ke=e.defineComponent({__name:"column-config",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{},columns:{default:()=>[]},columnsModifiers:{}},emits:e.mergeModels(["change"],["update:modelValue","update:columns"]),setup(t,{emit:m}){const{t:a}=I(),r=["selection","index","expand"],i=m,g=e.useModel(t,"modelValue"),o=e.useModel(t,"columns"),E=u=>o.value.filter(d=>d.hidden===0).length<2&&u.hidden===0;return(u,h)=>(e.openBlock(),e.createBlock(e.unref(n.ElDrawer),{modelValue:g.value,"onUpdate:modelValue":h[1]||(h[1]=d=>g.value=d),class:"ez-column-wrapper",title:e.unref(a)("s.label.column"),size:"15%"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.prop},[r.includes(d.type)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.ElCheckbox),{key:0,modelValue:d.hidden,"onUpdate:modelValue":v=>d.hidden=v,class:"flex","true-value":0,"false-value":1,label:d.label,checked:"",disabled:E(d),onChange:h[0]||(h[0]=v=>i("change"))},null,8,["modelValue","onUpdate:modelValue","label","disabled"]))],64))),128))]),_:1},8,["modelValue","title"]))}}),Xe={class:"ez-fast-table"},Ye={class:"ez-fast-table_wrapper"},Je={key:0,class:"ez-fast-table_wrapper_header_operation"},Ze={class:"ez-fast-table_pagination"},Qe=e.defineComponent({name:"EzFastTable",directives:{loading:n.ElLoading.directive},inheritAttrs:!1}),el=e.defineComponent({...Qe,props:e.mergeModels({api:{type:Function,default:()=>Promise.resolve()},beforeSearch:{type:Function,default:()=>Promise.resolve()},columnTool:{type:Boolean,default:!0},expanded:{type:Boolean,default:!1},data:{},columns:{},rowKey:{}},{params:{},paramsModifiers:{},columns:{},columnsModifiers:{},loading:{type:Boolean},loadingModifiers:{}}),emits:e.mergeModels(["changePage","reset","query"],["update:params","update:columns","update:loading"]),setup(t,{expose:m,emit:a}){const{t:r}=I(),i=t,g=e.useAttrs(),o=D(g),E=e.ref(i.expanded),{selectionChange:u,getSelectedList:h,getSortParams:d,getSelectedIds:v}=We(i.rowKey),_=e.ref(null),w=e.ref(!1),S=e.ref(null),A=e.ref([]),P=e.ref(0),M=a,C=e.useModel(t,"params"),V=e.useModel(t,"columns"),c=e.useModel(t,"loading"),B=async()=>{try{c.value=!0,await i.beforeSearch(C.value);const{code:k,data:l}=await i.api(C.value);k===200&&l.records?(A.value=l.records||[],P.value=l.total):(A.value=[],P.value=0),M("query")}finally{c.value=!1}},y=()=>{C.value.current=1,B()},$=()=>_.value?.getTableRef(),R=k=>{const l=d(k);C.value={...C.value,...l};const{column:f}=k;f.sortable==="custom"&&y()},x=k=>JSON.parse(JSON.stringify(k)),T=()=>{C.value=x(S.value),M("reset"),e.nextTick(()=>y())},U=k=>{M("changePage",k),k.size?y():B()},s=()=>{$().doLayout()};return e.onMounted(()=>{S.value=x(C.value)}),m({search:y,query:B,getTableRef:$}),(k,l)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Xe,[k.$slots.form?(e.openBlock(),e.createBlock(e.unref(W),{key:0,loading:c.value,expanded:E.value},{default:e.withCtx(b=>[e.renderSlot(k.$slots,"form",e.normalizeProps(e.guardReactiveProps(b)))]),operate:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{type:"primary",loading:c.value,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("s.button.query")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(n.ElButton),{onClick:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("s.button.reset")),1)]),_:1})]),_:3},8,["loading","expanded"])):e.createCommentVNode("",!0),k.$slots.freeArea?e.renderSlot(k.$slots,"freeArea",{key:1}):e.createCommentVNode("",!0),e.createElementVNode("div",Ye,[k.$slots.header||i.columnTool?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ez-fast-table_wrapper_header",k.$slots.header?"justify-between":"justify-end"])},[k.$slots.header?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(k.$slots,"header",{selectList:e.unref(h),selectIds:e.unref(v)})])):e.createCommentVNode("",!0),i.columnTool?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:1,icon:e.unref($e),circle:"",onClick:l[0]||(l[0]=b=>w.value=!0)},null,8,["icon"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(j),e.mergeProps(e.unref(o),{ref_key:"fastTableRef",ref:_,columns:V.value,data:A.value,onSelectionChange:e.unref(u),onSortChange:R}),e.createSlots({_:2},[e.renderList(k.$slots,(b,X,rl)=>({name:X,fn:e.withCtx(te=>[["form"].includes(b.name)?e.createCommentVNode("",!0):e.renderSlot(k.$slots,X,e.normalizeProps(e.mergeProps({key:0},te)))])}))]),1040,["columns","data","onSelectionChange"])),[[f,c.value]]),e.createElementVNode("div",Ze,[e.createVNode(e.unref(K),{"current-page":C.value.current,"onUpdate:currentPage":[l[1]||(l[1]=b=>C.value.current=b),l[3]||(l[3]=b=>U({current:b}))],"page-size":C.value.size,"onUpdate:pageSize":[l[2]||(l[2]=b=>C.value.size=b),l[4]||(l[4]=b=>U({size:b}))],total:P.value},null,8,["current-page","page-size","total"])])]),e.createVNode(Ke,{modelValue:w.value,"onUpdate:modelValue":l[5]||(l[5]=b=>w.value=b),columns:V.value,"onUpdate:columns":l[6]||(l[6]=b=>V.value=b),onChange:s},null,8,["modelValue","columns"])])}}}),le=z(el),Q=Symbol("INSTALLED_KEY");function ll(t=[]){return{install:a=>{a[Q]||(a[Q]=!0,t.forEach(r=>a.use(r)))}}}const ol=[O,ee,le,N,G,K,H,W,q,j],tl=[n.ElInfiniteScroll,n.ElLoading,n.ElMessage,n.ElMessageBox,n.ElNotification,n.ElPopoverDirective],oe=ll([...ol,...tl]),al=oe.install;exports.EzCheckbox=O;exports.EzDialog=ee;exports.EzDynamicForm=Re;exports.EzFastTable=le;exports.EzIcon=N;exports.EzImageUpload=G;exports.EzPagination=K;exports.EzRadio=H;exports.EzSearchForm=W;exports.EzSelect=q;exports.EzTable=j;exports.FormItemType=p;exports.default=oe;exports.install=al;
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as M, defineComponent as $, mergeModels as I, useModel as P, useAttrs as J, createBlock as p, openBlock as r, unref as l, mergeProps as h, withCtx as b, createElementBlock as w, Fragment as O, renderList as W, resolveDynamicComponent as ce, createTextVNode as le, toDisplayString as Y, resolveDirective as Te, renderSlot as R, createCommentVNode as A, withDirectives as Se, createElementVNode as D, ref as x, createVNode as S, withModifiers as ge, normalizeStyle as Ae, shallowRef as Be, watch as he, nextTick as ue, onMounted as fe, createSlots as de, onUnmounted as Oe, normalizeProps as Ee, guardReactiveProps as He, normalizeClass as qe } from "vue";
|
|
2
2
|
import { useLocale as Fe, ElCheckbox as Ue, ElCheckboxButton as Ge, ElCheckboxGroup as je, ElLoading as ve, ElDialog as We, ElButton as te, ElScrollbar as Ke, ElSelect as Xe, ElOptionGroup as Ye, ElOption as be, ElRadio as Je, ElRadioButton as Ze, ElRadioGroup as Qe, ElUpload as ye, ElImage as _e, ElImageViewer as el, ElMessage as oe, ElForm as ll, ElRow as al, ElCol as tl, ElFormItem as ol, ElInput as ie, ElInputNumber as rl, ElDatePicker as ne, ElTimePicker as Ve, ElSwitch as sl, ElTreeSelect as nl, ElCascader as ul, ElTree as dl, ElSlider as il, ElRate as pl, ElTable as cl, ElTableColumn as we, ElPagination as fl, ElDrawer as vl, ElInfiniteScroll as ml, ElMessageBox as gl, ElNotification as hl, ElPopoverDirective as El } from "element-plus";
|
|
3
|
-
const F = (t,
|
|
3
|
+
const F = (t, m) => (t.install = (o) => {
|
|
4
4
|
for (const s of [t, ...Object.values({})])
|
|
5
5
|
s.name ? o.component(s.name, s) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", s);
|
|
6
6
|
}, t);
|
|
7
7
|
function Z(t) {
|
|
8
8
|
return M(() => {
|
|
9
|
-
const
|
|
9
|
+
const m = {};
|
|
10
10
|
for (const o in t)
|
|
11
|
-
o === "class" || o === "style" || o.startsWith("on") || (
|
|
12
|
-
return
|
|
11
|
+
o === "class" || o === "style" || o.startsWith("on") || (m[o] = t[o]);
|
|
12
|
+
return m;
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
var bl = {
|
|
@@ -93,25 +93,25 @@ var bl = {
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
const { s: yl } = bl;
|
|
96
|
-
function _l(t,
|
|
97
|
-
return
|
|
96
|
+
function _l(t, m) {
|
|
97
|
+
return m.split(".").reduce((o, s) => o && typeof o == "object" ? o[s] : void 0, t);
|
|
98
98
|
}
|
|
99
|
-
function Vl(t,
|
|
99
|
+
function Vl(t, m = {}) {
|
|
100
100
|
return t.replace(/\{\s*(\w+)\s*\}/g, (o, s) => {
|
|
101
|
-
const f =
|
|
101
|
+
const f = m[s];
|
|
102
102
|
return f !== void 0 ? String(f) : `{${s}}`;
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
function se() {
|
|
106
|
-
const { t, lang:
|
|
106
|
+
const { t, lang: m } = Fe();
|
|
107
107
|
return {
|
|
108
108
|
t: (s, f = {}) => {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
109
|
+
const g = t(s, f);
|
|
110
|
+
if (g !== s) return g;
|
|
111
111
|
const a = _l({ s: yl }, s);
|
|
112
112
|
return typeof a == "string" ? Vl(a, f) : s;
|
|
113
113
|
},
|
|
114
|
-
lang:
|
|
114
|
+
lang: m
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
const wl = $({ name: "EzCheckbox", inheritAttrs: !1 }), $l = /* @__PURE__ */ $({
|
|
@@ -124,8 +124,8 @@ const wl = $({ name: "EzCheckbox", inheritAttrs: !1 }), $l = /* @__PURE__ */ $({
|
|
|
124
124
|
modelModifiers: {}
|
|
125
125
|
}),
|
|
126
126
|
emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
|
|
127
|
-
setup(t, { emit:
|
|
128
|
-
const o = t, s =
|
|
127
|
+
setup(t, { emit: m }) {
|
|
128
|
+
const o = t, s = m, f = P(t, "modelValue"), g = J(), a = Z(g), V = M(
|
|
129
129
|
() => ["default", "border"].includes(o.type) ? Ue : Ge
|
|
130
130
|
), u = (_) => {
|
|
131
131
|
s("change", _);
|
|
@@ -167,17 +167,17 @@ const Cl = { key: 1 }, kl = {
|
|
|
167
167
|
modelModifiers: {}
|
|
168
168
|
}),
|
|
169
169
|
emits: /* @__PURE__ */ I(["cancel", "confirm"], ["update:modelValue"]),
|
|
170
|
-
setup(t, { emit:
|
|
171
|
-
const { t: o } = se(), s = t, f =
|
|
172
|
-
|
|
170
|
+
setup(t, { emit: m }) {
|
|
171
|
+
const { t: o } = se(), s = t, f = m, g = P(t, "modelValue"), a = J(), V = Z(a), u = () => {
|
|
172
|
+
g.value = !1, f("cancel");
|
|
173
173
|
}, _ = () => {
|
|
174
174
|
f("confirm");
|
|
175
175
|
};
|
|
176
176
|
return (d, E) => {
|
|
177
177
|
const L = Te("loading");
|
|
178
178
|
return r(), p(l(We), h({
|
|
179
|
-
modelValue:
|
|
180
|
-
"onUpdate:modelValue": E[0] || (E[0] = (N) =>
|
|
179
|
+
modelValue: g.value,
|
|
180
|
+
"onUpdate:modelValue": E[0] || (E[0] = (N) => g.value = N),
|
|
181
181
|
class: "ez-dialog",
|
|
182
182
|
width: 800,
|
|
183
183
|
"append-to-body": !1,
|
|
@@ -239,15 +239,15 @@ const Cl = { key: 1 }, kl = {
|
|
|
239
239
|
}),
|
|
240
240
|
emits: ["update:modelValue"],
|
|
241
241
|
setup(t) {
|
|
242
|
-
const
|
|
242
|
+
const m = t, o = P(t, "modelValue"), s = (a) => typeof a > "u", f = (a) => !s(a.options), g = (a, V) => a.value != null && typeof a.value != "object" ? String(a.value) : V;
|
|
243
243
|
return (a, V) => (r(), p(l(Xe), h({
|
|
244
244
|
modelValue: o.value,
|
|
245
245
|
"onUpdate:modelValue": V[0] || (V[0] = (u) => o.value = u),
|
|
246
246
|
clearable: ""
|
|
247
247
|
}, a.$attrs), {
|
|
248
248
|
default: b(() => [
|
|
249
|
-
(r(!0), w(O, null, W(
|
|
250
|
-
key:
|
|
249
|
+
(r(!0), w(O, null, W(m.options, (u, _) => (r(), w(O, {
|
|
250
|
+
key: g(u, _)
|
|
251
251
|
}, [
|
|
252
252
|
f(u) ? (r(), p(l(Ye), h({
|
|
253
253
|
key: 0,
|
|
@@ -255,7 +255,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
255
255
|
}, u), {
|
|
256
256
|
default: b(() => [
|
|
257
257
|
(r(!0), w(O, null, W(u.options, (d) => (r(), p(l(be), h({
|
|
258
|
-
key:
|
|
258
|
+
key: g(d, d.value)
|
|
259
259
|
}, { ref_for: !0 }, d), null, 16))), 128))
|
|
260
260
|
]),
|
|
261
261
|
_: 2
|
|
@@ -278,8 +278,8 @@ const Cl = { key: 1 }, kl = {
|
|
|
278
278
|
modelModifiers: {}
|
|
279
279
|
}),
|
|
280
280
|
emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
|
|
281
|
-
setup(t, { emit:
|
|
282
|
-
const o = t, s =
|
|
281
|
+
setup(t, { emit: m }) {
|
|
282
|
+
const o = t, s = m, f = P(t, "modelValue"), g = J(), a = Z(g), V = M(() => ["default", "border"].includes(o.type) ? Je : Ze), u = (_) => {
|
|
283
283
|
s("change", _);
|
|
284
284
|
};
|
|
285
285
|
return (_, d) => (r(), p(l(Qe), h({
|
|
@@ -309,8 +309,8 @@ const Cl = { key: 1 }, kl = {
|
|
|
309
309
|
color: { default: "inherit" }
|
|
310
310
|
},
|
|
311
311
|
setup(t) {
|
|
312
|
-
const
|
|
313
|
-
const { size: s, color: f } =
|
|
312
|
+
const m = t, o = M(() => {
|
|
313
|
+
const { size: s, color: f } = m;
|
|
314
314
|
return !s && !f ? {} : {
|
|
315
315
|
fontSize: s ? `${s}px` : void 0,
|
|
316
316
|
color: f
|
|
@@ -332,7 +332,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
332
332
|
name: "ArrowDown",
|
|
333
333
|
__name: "ArrowDown",
|
|
334
334
|
setup(t) {
|
|
335
|
-
return (
|
|
335
|
+
return (m, o) => (r(), w("svg", Il, [...o[0] || (o[0] = [
|
|
336
336
|
D("path", {
|
|
337
337
|
fill: "currentColor",
|
|
338
338
|
d: "m832 340.992-320 312-320-312a28.8 28.8 0 0 0-20.992-8.96 28.8 28.8 0 0 0-20.992 8.96 28.8 28.8 0 0 0-8.96 20.992c0 8 2.624 14.72 8 19.968l340.992 332.032c5.952 6.016 13.312 8.96 22.016 8.96 8.64 0 16-2.944 22.016-8.96l340.992-331.008a31.23 31.23 0 0 0 8-21.504c0-8.32-3.008-15.36-8.96-20.992a29.76 29.76 0 0 0-42.048.448v.064z"
|
|
@@ -348,7 +348,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
348
348
|
name: "ArrowUp",
|
|
349
349
|
__name: "ArrowUp",
|
|
350
350
|
setup(t) {
|
|
351
|
-
return (
|
|
351
|
+
return (m, o) => (r(), w("svg", Nl, [...o[0] || (o[0] = [
|
|
352
352
|
D("path", {
|
|
353
353
|
fill: "currentColor",
|
|
354
354
|
d: "M488.96 344 148.992 700.992a32.26 32.26 0 0 0-8.96 22.016c0 8 2.944 15.36 8.96 22.016v1.024c6.016 5.952 13.184 8.96 21.504 8.96S185.984 752 192 746.048l320-336 320 336c6.016 5.952 13.184 8.96 21.504 8.96s15.488-3.008 21.504-8.96v-1.024a32.26 32.26 0 0 0 8.96-22.016 32.26 32.26 0 0 0-8.96-22.016L534.976 344A31.17 31.17 0 0 0 512 335.04a31.17 31.17 0 0 0-23.04 8.96"
|
|
@@ -364,7 +364,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
364
364
|
name: "Delete",
|
|
365
365
|
__name: "delete",
|
|
366
366
|
setup(t) {
|
|
367
|
-
return (
|
|
367
|
+
return (m, o) => (r(), w("svg", Ol, [...o[0] || (o[0] = [
|
|
368
368
|
D("path", {
|
|
369
369
|
fill: "currentColor",
|
|
370
370
|
d: "M218.88 118.592C208 139.968 208 168 208 245.376V272H96a32 32 0 1 0 0 64h832a32 32 0 0 0 0-64H816v-26.624c0-77.44 0-105.408-10.88-126.72a100.03 100.03 0 0 0-43.712-43.776C740.032 64 712 64 634.624 64H389.376c-77.44 0-105.408 0-126.72 10.88-18.88 9.6-34.176 24.96-43.776 43.712M752 272H272v-64c0-28.032 0-42.304 5.568-52.992a50.24 50.24 0 0 1 21.44-21.44C309.76 128.064 323.968 128 352 128h320c28.032 0 42.304 0 52.992 5.568 9.152 4.736 16.64 12.288 21.44 21.44C751.936 165.696 752 179.968 752 208zM192 416a32 32 0 0 0-32 32v358.4c0 53.76.128 81.28 10.688 101.76a96.54 96.54 0 0 0 41.216 41.152C232.384 959.872 259.84 960 313.6 960h396.8c53.76 0 81.28-.128 101.76-10.688a96.54 96.54 0 0 0 41.152-41.216C863.872 887.616 864 860.16 864 806.4V448a32 32 0 0 0-64 0v371.2c0 26.88 0 40.64-5.376 50.88a48.2 48.2 0 0 1-20.544 20.544c-10.24 5.312-24 5.376-50.88 5.376H300.8c-26.88 0-40.64 0-50.88-5.376a48.2 48.2 0 0 1-20.544-20.544c-5.312-10.24-5.376-24-5.376-50.88V448a32 32 0 0 0-32-32m216 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32m208 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32"
|
|
@@ -380,7 +380,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
380
380
|
name: "Plus",
|
|
381
381
|
__name: "plus",
|
|
382
382
|
setup(t) {
|
|
383
|
-
return (
|
|
383
|
+
return (m, o) => (r(), w("svg", Hl, [...o[0] || (o[0] = [
|
|
384
384
|
D("path", {
|
|
385
385
|
fill: "currentColor",
|
|
386
386
|
d: "M512 96a32 32 0 0 0-32 32v352H128a32 32 0 1 0 0 64h352v352a32 32 0 0 0 64 0V544h352a32 32 0 0 0 0-64H544V128a32 32 0 0 0-32-32"
|
|
@@ -396,7 +396,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
396
396
|
name: "Setting",
|
|
397
397
|
__name: "setting",
|
|
398
398
|
setup(t) {
|
|
399
|
-
return (
|
|
399
|
+
return (m, o) => (r(), w("svg", ql, [...o[0] || (o[0] = [
|
|
400
400
|
D("path", {
|
|
401
401
|
fill: "currentColor",
|
|
402
402
|
d: "M218.688 848q27.712 48 83.2 48h374.08q55.424 0 83.136-48l187.008-323.968q27.776-48 0-96L759.104 104.064q-27.712-48-83.2-48H301.952q-55.488 0-83.2 48L31.68 428.032q-27.712 48 0 96zm55.424-32L87.104 492.032q-9.216-16 0-32l187.008-323.968q9.28-16 27.776-16h374.08q18.432 0 27.712 16l187.008 323.968q9.28 16 0 32L703.68 816q-9.28 16-27.712 16h-374.08q-18.56 0-27.776-16m54.784-339.968a160 160 0 1 0 320 0 160 160 0 0 0-320 0m64 0a96 96 0 1 1 192 0 96 96 0 0 1-192 0"
|
|
@@ -412,7 +412,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
412
412
|
name: "ZoomIn",
|
|
413
413
|
__name: "ZoomIn",
|
|
414
414
|
setup(t) {
|
|
415
|
-
return (
|
|
415
|
+
return (m, o) => (r(), w("svg", Gl, [...o[0] || (o[0] = [
|
|
416
416
|
D("path", {
|
|
417
417
|
fill: "currentColor",
|
|
418
418
|
d: "M764.352 809.6a424 424 0 1 1 45.184-45.184l139.456 139.392a31.936 31.936 0 1 1-45.184 45.184L764.352 809.536zM848 488a360 360 0 1 0-720 0 360 360 0 0 0 720 0"
|
|
@@ -445,8 +445,8 @@ const Cl = { key: 1 }, kl = {
|
|
|
445
445
|
modelModifiers: {}
|
|
446
446
|
}),
|
|
447
447
|
emits: ["update:modelValue"],
|
|
448
|
-
setup(t, { expose:
|
|
449
|
-
const o = t, s = J(), f = Z(s), { t:
|
|
448
|
+
setup(t, { expose: m }) {
|
|
449
|
+
const o = t, s = J(), f = Z(s), { t: g } = se(), a = x(!1), V = x(0), u = P(t, "modelValue"), _ = M(() => o.multiple), d = /^(https?:\/\/|data:|blob:)/i, E = M(() => u.value ? L(u.value) : []);
|
|
450
450
|
function L(C) {
|
|
451
451
|
if (!C) return [];
|
|
452
452
|
const i = /^(https?:\/\/|data:|blob:)/i;
|
|
@@ -462,11 +462,11 @@ const Cl = { key: 1 }, kl = {
|
|
|
462
462
|
function N(C) {
|
|
463
463
|
return !C || C.length === 0 ? "" : C.filter((i) => i.trim()).map((i) => i.trim()).join(",");
|
|
464
464
|
}
|
|
465
|
-
const B = (C) => o.disabled ? (oe.warning(
|
|
465
|
+
const B = (C) => o.disabled ? (oe.warning(g("s.message.disabled")), !1) : o.imageTypes.includes(C.type.toLocaleLowerCase()) ? C.size > o.limitSize * 1024 * 1024 ? (oe.error(g("s.validate.upload.limit", { max: o.limitSize })), !1) : !0 : (oe.error(g("s.validate.upload.image")), !1), j = async ({ file: C }) => {
|
|
466
466
|
if (!o.disabled)
|
|
467
467
|
try {
|
|
468
468
|
const { url: i } = await o.api(C);
|
|
469
|
-
if (!i) throw new Error(
|
|
469
|
+
if (!i) throw new Error(g("s.message.uploadFail"));
|
|
470
470
|
if (_.value) {
|
|
471
471
|
const k = u.value ? L(u.value) : [];
|
|
472
472
|
i && d.test(i) && (k.push(i), u.value = N(k));
|
|
@@ -485,7 +485,7 @@ const Cl = { key: 1 }, kl = {
|
|
|
485
485
|
} else
|
|
486
486
|
u.value = null;
|
|
487
487
|
}, T = x();
|
|
488
|
-
return
|
|
488
|
+
return m({
|
|
489
489
|
getUploadRef: () => T.value,
|
|
490
490
|
getUrlList: () => E.value
|
|
491
491
|
}), (C, i) => (r(), w("div", jl, [
|
|
@@ -621,8 +621,8 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
621
621
|
formProps: {}
|
|
622
622
|
},
|
|
623
623
|
emits: ["update:modelValue"],
|
|
624
|
-
setup(t, { expose:
|
|
625
|
-
const s = t, f = o,
|
|
624
|
+
setup(t, { expose: m, emit: o }) {
|
|
625
|
+
const s = t, f = o, g = Be(), a = x({});
|
|
626
626
|
let V = !1;
|
|
627
627
|
const u = J(), _ = M(() => ({
|
|
628
628
|
...Z(u).value,
|
|
@@ -690,33 +690,33 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
690
690
|
}
|
|
691
691
|
return !1;
|
|
692
692
|
}, k = async () => {
|
|
693
|
-
if (!
|
|
693
|
+
if (!g.value)
|
|
694
694
|
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
695
695
|
try {
|
|
696
|
-
return await
|
|
696
|
+
return await g.value.validate(), !0;
|
|
697
697
|
} catch {
|
|
698
698
|
return !1;
|
|
699
699
|
}
|
|
700
700
|
}, z = async (n) => {
|
|
701
|
-
if (!
|
|
701
|
+
if (!g.value)
|
|
702
702
|
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
703
703
|
try {
|
|
704
|
-
return await
|
|
704
|
+
return await g.value.validateField(n), !0;
|
|
705
705
|
} catch {
|
|
706
706
|
return !1;
|
|
707
707
|
}
|
|
708
708
|
}, H = (n) => {
|
|
709
|
-
if (!
|
|
709
|
+
if (!g.value) {
|
|
710
710
|
console.warn("[EzDynamicForm] Form ref is not available");
|
|
711
711
|
return;
|
|
712
712
|
}
|
|
713
|
-
|
|
713
|
+
g.value.clearValidate(n);
|
|
714
714
|
}, ae = (n) => {
|
|
715
|
-
if (!
|
|
715
|
+
if (!g.value) {
|
|
716
716
|
console.warn("[EzDynamicForm] Form ref is not available");
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
|
|
719
|
+
g.value.resetFields(n), ue(() => {
|
|
720
720
|
d();
|
|
721
721
|
});
|
|
722
722
|
}, q = () => ({ ...a.value }), G = (n, y = !0) => {
|
|
@@ -748,17 +748,17 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
748
748
|
{ deep: !0, flush: "post" }
|
|
749
749
|
), fe(() => {
|
|
750
750
|
d();
|
|
751
|
-
}),
|
|
751
|
+
}), m({
|
|
752
752
|
validate: k,
|
|
753
753
|
validateField: z,
|
|
754
754
|
clearValidate: H,
|
|
755
755
|
resetFields: ae,
|
|
756
756
|
getFormData: q,
|
|
757
757
|
setFormData: G,
|
|
758
|
-
formRef:
|
|
758
|
+
formRef: g
|
|
759
759
|
}), (n, y) => (r(), p(l(ll), h({
|
|
760
760
|
ref_key: "formRef",
|
|
761
|
-
ref:
|
|
761
|
+
ref: g,
|
|
762
762
|
model: a.value
|
|
763
763
|
}, _.value, { class: "ez-dynamic-form" }), {
|
|
764
764
|
default: b(() => [
|
|
@@ -785,33 +785,33 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
785
785
|
}) : e.component ? (r(), p(ce(e.component), h({
|
|
786
786
|
key: 1,
|
|
787
787
|
modelValue: a.value[e.prop],
|
|
788
|
-
"onUpdate:modelValue": (
|
|
788
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
789
789
|
disabled: i(e)
|
|
790
790
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : (r(), w(O, { key: 2 }, [
|
|
791
791
|
e.type === l(c).INPUT || !e.type ? (r(), p(l(ie), h({
|
|
792
792
|
key: 0,
|
|
793
793
|
modelValue: a.value[e.prop],
|
|
794
|
-
"onUpdate:modelValue": (
|
|
794
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
795
795
|
placeholder: e.placeholder || `请输入${e.label || ""}`,
|
|
796
796
|
disabled: i(e),
|
|
797
797
|
clearable: ""
|
|
798
798
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).TEXTAREA ? (r(), p(l(ie), h({
|
|
799
799
|
key: 1,
|
|
800
800
|
modelValue: a.value[e.prop],
|
|
801
|
-
"onUpdate:modelValue": (
|
|
801
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
802
802
|
type: "textarea",
|
|
803
803
|
placeholder: e.placeholder || `请输入${e.label || ""}`,
|
|
804
804
|
disabled: i(e)
|
|
805
805
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).NUMBER ? (r(), p(l(rl), h({
|
|
806
806
|
key: 2,
|
|
807
807
|
modelValue: a.value[e.prop],
|
|
808
|
-
"onUpdate:modelValue": (
|
|
808
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
809
809
|
placeholder: e.placeholder,
|
|
810
810
|
disabled: i(e)
|
|
811
811
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).PASSWORD ? (r(), p(l(ie), h({
|
|
812
812
|
key: 3,
|
|
813
813
|
modelValue: a.value[e.prop],
|
|
814
|
-
"onUpdate:modelValue": (
|
|
814
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
815
815
|
type: "password",
|
|
816
816
|
placeholder: e.placeholder || `请输入${e.label || ""}`,
|
|
817
817
|
disabled: i(e),
|
|
@@ -820,40 +820,40 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
820
820
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).SELECT ? (r(), p(l(De), h({
|
|
821
821
|
key: 4,
|
|
822
822
|
modelValue: a.value[e.prop],
|
|
823
|
-
"onUpdate:modelValue": (
|
|
823
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
824
824
|
options: e.options || [],
|
|
825
825
|
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
826
826
|
disabled: i(e)
|
|
827
827
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "disabled"])) : e.type === l(c).RADIO ? (r(), p(l(xe), h({
|
|
828
828
|
key: 5,
|
|
829
829
|
modelValue: a.value[e.prop],
|
|
830
|
-
"onUpdate:modelValue": (
|
|
830
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
831
831
|
options: e.options || [],
|
|
832
832
|
disabled: i(e)
|
|
833
833
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "disabled"])) : e.type === l(c).CHECKBOX ? (r(), p(l(Re), h({
|
|
834
834
|
key: 6,
|
|
835
835
|
modelValue: a.value[e.prop],
|
|
836
|
-
"onUpdate:modelValue": (
|
|
836
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
837
837
|
options: e.options || [],
|
|
838
838
|
disabled: i(e)
|
|
839
839
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "disabled"])) : e.type === l(c).DATE ? (r(), p(l(ne), h({
|
|
840
840
|
key: 7,
|
|
841
841
|
modelValue: a.value[e.prop],
|
|
842
|
-
"onUpdate:modelValue": (
|
|
842
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
843
843
|
type: "date",
|
|
844
844
|
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
845
845
|
disabled: i(e)
|
|
846
846
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).DATETIME ? (r(), p(l(ne), h({
|
|
847
847
|
key: 8,
|
|
848
848
|
modelValue: a.value[e.prop],
|
|
849
|
-
"onUpdate:modelValue": (
|
|
849
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
850
850
|
type: "datetime",
|
|
851
851
|
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
852
852
|
disabled: i(e)
|
|
853
853
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).DATERANGE ? (r(), p(l(ne), h({
|
|
854
854
|
key: 9,
|
|
855
855
|
modelValue: a.value[e.prop],
|
|
856
|
-
"onUpdate:modelValue": (
|
|
856
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
857
857
|
type: "daterange",
|
|
858
858
|
"range-separator": "至",
|
|
859
859
|
"start-placeholder": "开始日期",
|
|
@@ -862,7 +862,7 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
862
862
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).DATETIMERANGE ? (r(), p(l(ne), h({
|
|
863
863
|
key: 10,
|
|
864
864
|
modelValue: a.value[e.prop],
|
|
865
|
-
"onUpdate:modelValue": (
|
|
865
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
866
866
|
type: "datetimerange",
|
|
867
867
|
"range-separator": "至",
|
|
868
868
|
"start-placeholder": "开始时间",
|
|
@@ -871,13 +871,13 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
871
871
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).TIME ? (r(), p(l(Ve), h({
|
|
872
872
|
key: 11,
|
|
873
873
|
modelValue: a.value[e.prop],
|
|
874
|
-
"onUpdate:modelValue": (
|
|
874
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
875
875
|
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
876
876
|
disabled: i(e)
|
|
877
877
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).TIMERANGE ? (r(), p(l(Ve), h({
|
|
878
878
|
key: 12,
|
|
879
879
|
modelValue: a.value[e.prop],
|
|
880
|
-
"onUpdate:modelValue": (
|
|
880
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
881
881
|
"is-range": "",
|
|
882
882
|
"range-separator": "至",
|
|
883
883
|
"start-placeholder": "开始时间",
|
|
@@ -886,19 +886,19 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
886
886
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).SWITCH ? (r(), p(l(sl), h({
|
|
887
887
|
key: 13,
|
|
888
888
|
modelValue: a.value[e.prop],
|
|
889
|
-
"onUpdate:modelValue": (
|
|
889
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
890
890
|
disabled: i(e)
|
|
891
891
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).TREE_SELECT ? (r(), p(l(nl), h({
|
|
892
892
|
key: 14,
|
|
893
893
|
modelValue: a.value[e.prop],
|
|
894
|
-
"onUpdate:modelValue": (
|
|
894
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
895
895
|
data: e.options,
|
|
896
896
|
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
897
897
|
disabled: i(e)
|
|
898
898
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "data", "placeholder", "disabled"])) : e.type === l(c).CASCADER ? (r(), p(l(ul), h({
|
|
899
899
|
key: 15,
|
|
900
900
|
modelValue: a.value[e.prop],
|
|
901
|
-
"onUpdate:modelValue": (
|
|
901
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
902
902
|
options: e.options,
|
|
903
903
|
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
904
904
|
disabled: i(e),
|
|
@@ -906,24 +906,24 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
906
906
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "disabled"])) : e.type === l(c).TREE ? (r(), p(l(dl), h({
|
|
907
907
|
key: 16,
|
|
908
908
|
modelValue: a.value[e.prop],
|
|
909
|
-
"onUpdate:modelValue": (
|
|
909
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
910
910
|
data: e.options,
|
|
911
911
|
"show-checkbox": "",
|
|
912
912
|
"node-key": "id"
|
|
913
913
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "data"])) : e.type === l(c).SLIDER ? (r(), p(l(il), h({
|
|
914
914
|
key: 17,
|
|
915
915
|
modelValue: a.value[e.prop],
|
|
916
|
-
"onUpdate:modelValue": (
|
|
916
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
917
917
|
disabled: i(e)
|
|
918
918
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).RATE ? (r(), p(l(pl), h({
|
|
919
919
|
key: 18,
|
|
920
920
|
modelValue: a.value[e.prop],
|
|
921
|
-
"onUpdate:modelValue": (
|
|
921
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
922
922
|
disabled: i(e)
|
|
923
923
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "upload-images" && e.attrs?.api ? (r(), p(l(Me), h({
|
|
924
924
|
key: 19,
|
|
925
925
|
modelValue: a.value[e.prop],
|
|
926
|
-
"onUpdate:modelValue": (
|
|
926
|
+
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
927
927
|
api: e.attrs?.api,
|
|
928
928
|
disabled: i(e)
|
|
929
929
|
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "api", "disabled"])) : A("", !0)
|
|
@@ -956,8 +956,8 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
956
956
|
columns: { default: () => [] },
|
|
957
957
|
rowKey: {}
|
|
958
958
|
},
|
|
959
|
-
setup(t, { expose:
|
|
960
|
-
const o = t, s = x(), f = J(),
|
|
959
|
+
setup(t, { expose: m }) {
|
|
960
|
+
const o = t, s = x(), f = J(), g = Z(f), a = (u) => {
|
|
961
961
|
const _ = o.columns[o.columns.length - 1], d = () => u.type ? !1 : u.prop !== _.prop;
|
|
962
962
|
return { ...{
|
|
963
963
|
align: "center",
|
|
@@ -968,7 +968,7 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
968
968
|
showOverflowTooltip: d()
|
|
969
969
|
}, ...u };
|
|
970
970
|
};
|
|
971
|
-
return
|
|
971
|
+
return m({
|
|
972
972
|
getTableRef: () => s.value
|
|
973
973
|
}), (u, _) => (r(), p(l(cl), h({
|
|
974
974
|
ref_key: "tableRef",
|
|
@@ -976,7 +976,7 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
976
976
|
data: o.data,
|
|
977
977
|
border: "",
|
|
978
978
|
"row-key": "id"
|
|
979
|
-
}, l(
|
|
979
|
+
}, l(g)), de({
|
|
980
980
|
default: b(() => [
|
|
981
981
|
(r(!0), w(O, null, W(o.columns, (d) => (r(), w(O, {
|
|
982
982
|
key: d.prop
|
|
@@ -1039,11 +1039,11 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
1039
1039
|
expandedModifiers: {}
|
|
1040
1040
|
}),
|
|
1041
1041
|
emits: ["update:expanded"],
|
|
1042
|
-
setup(t, { expose:
|
|
1043
|
-
const o = t, { t: s } = se(), f = x(),
|
|
1042
|
+
setup(t, { expose: m }) {
|
|
1043
|
+
const o = t, { t: s } = se(), f = x(), g = x(0), a = P(t, "expanded"), V = M(() => g.value > o.collapsedHeight), u = M(() => a.value ? Bl : Ll), _ = M(() => a.value ? s("s.button.collapse") : s("s.button.expand"));
|
|
1044
1044
|
let d = null;
|
|
1045
1045
|
const E = () => {
|
|
1046
|
-
f.value && (
|
|
1046
|
+
f.value && (g.value = f.value.scrollHeight);
|
|
1047
1047
|
}, L = () => {
|
|
1048
1048
|
a.value = !a.value;
|
|
1049
1049
|
};
|
|
@@ -1053,13 +1053,13 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
1053
1053
|
}, 50);
|
|
1054
1054
|
}), Oe(() => {
|
|
1055
1055
|
d && (d.disconnect(), d = null);
|
|
1056
|
-
}),
|
|
1056
|
+
}), m({
|
|
1057
1057
|
countViewHeight: E
|
|
1058
1058
|
}), (N, B) => (r(), w("div", aa, [
|
|
1059
1059
|
D("div", {
|
|
1060
1060
|
class: "ez-search-form__wrapper",
|
|
1061
1061
|
style: Ae({
|
|
1062
|
-
height:
|
|
1062
|
+
height: g.value ? a.value ? `${g.value}px` : `${o.collapsedHeight}px` : "auto"
|
|
1063
1063
|
})
|
|
1064
1064
|
}, [
|
|
1065
1065
|
D("div", ta, [
|
|
@@ -1091,8 +1091,8 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
1091
1091
|
pageSizeModifiers: {}
|
|
1092
1092
|
},
|
|
1093
1093
|
emits: /* @__PURE__ */ I(["current-change", "size-change"], ["update:currentPage", "update:pageSize"]),
|
|
1094
|
-
setup(t, { emit:
|
|
1095
|
-
const o =
|
|
1094
|
+
setup(t, { emit: m }) {
|
|
1095
|
+
const o = m, s = P(t, "currentPage"), f = P(t, "pageSize"), g = J(), a = Z(g), V = (_) => {
|
|
1096
1096
|
o("current-change", _);
|
|
1097
1097
|
}, u = (_) => {
|
|
1098
1098
|
o("size-change", _);
|
|
@@ -1112,10 +1112,10 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
1112
1112
|
}), Le = F(na);
|
|
1113
1113
|
var pe = /* @__PURE__ */ ((t) => (t.ASC = "ascending", t.DESC = "descending", t[t.EMPTY = null] = "EMPTY", t))(pe || {});
|
|
1114
1114
|
const ua = (t) => {
|
|
1115
|
-
const
|
|
1115
|
+
const m = x([]), o = M(() => m.value), s = M(() => m.value.map((a) => a[t]));
|
|
1116
1116
|
return {
|
|
1117
1117
|
selectionChange: (a) => {
|
|
1118
|
-
|
|
1118
|
+
m.value = a;
|
|
1119
1119
|
},
|
|
1120
1120
|
getSelectedList: o,
|
|
1121
1121
|
getSelectedIds: s,
|
|
@@ -1133,11 +1133,11 @@ const ua = (t) => {
|
|
|
1133
1133
|
columnsModifiers: {}
|
|
1134
1134
|
},
|
|
1135
1135
|
emits: /* @__PURE__ */ I(["change"], ["update:modelValue", "update:columns"]),
|
|
1136
|
-
setup(t, { emit:
|
|
1137
|
-
const { t: o } = se(), s = ["selection", "index", "expand"], f =
|
|
1136
|
+
setup(t, { emit: m }) {
|
|
1137
|
+
const { t: o } = se(), s = ["selection", "index", "expand"], f = m, g = P(t, "modelValue"), a = P(t, "columns"), V = (u) => a.value.filter((d) => d.hidden === 0).length < 2 && u.hidden === 0;
|
|
1138
1138
|
return (u, _) => (r(), p(l(vl), {
|
|
1139
|
-
modelValue:
|
|
1140
|
-
"onUpdate:modelValue": _[1] || (_[1] = (d) =>
|
|
1139
|
+
modelValue: g.value,
|
|
1140
|
+
"onUpdate:modelValue": _[1] || (_[1] = (d) => g.value = d),
|
|
1141
1141
|
class: "ez-column-wrapper",
|
|
1142
1142
|
title: l(o)("s.label.column"),
|
|
1143
1143
|
size: "15%"
|
|
@@ -1189,8 +1189,8 @@ const ua = (t) => {
|
|
|
1189
1189
|
loadingModifiers: {}
|
|
1190
1190
|
}),
|
|
1191
1191
|
emits: /* @__PURE__ */ I(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
|
|
1192
|
-
setup(t, { expose:
|
|
1193
|
-
const { t: s } = se(), f = t,
|
|
1192
|
+
setup(t, { expose: m, emit: o }) {
|
|
1193
|
+
const { t: s } = se(), f = t, g = J(), a = Z(g), V = x(f.expanded), { selectionChange: u, getSelectedList: _, getSortParams: d, getSelectedIds: E } = ua(f.rowKey), L = x(null), N = x(!1), B = x(null), j = x([]), K = x(0), X = o, T = P(t, "params"), C = P(t, "columns"), i = P(t, "loading"), k = async () => {
|
|
1194
1194
|
try {
|
|
1195
1195
|
i.value = !0, await f.beforeSearch(T.value);
|
|
1196
1196
|
const { code: y, data: e } = await f.api(T.value);
|
|
@@ -1203,8 +1203,8 @@ const ua = (t) => {
|
|
|
1203
1203
|
}, H = () => L.value?.getTableRef(), ae = (y) => {
|
|
1204
1204
|
const e = d(y);
|
|
1205
1205
|
T.value = { ...T.value, ...e };
|
|
1206
|
-
const { column:
|
|
1207
|
-
|
|
1206
|
+
const { column: v } = y;
|
|
1207
|
+
v.sortable === "custom" && z();
|
|
1208
1208
|
}, q = (y) => JSON.parse(JSON.stringify(y)), G = () => {
|
|
1209
1209
|
T.value = q(B.value), X("reset"), ue(() => z());
|
|
1210
1210
|
}, Q = (y) => {
|
|
@@ -1214,8 +1214,8 @@ const ua = (t) => {
|
|
|
1214
1214
|
};
|
|
1215
1215
|
return fe(() => {
|
|
1216
1216
|
B.value = q(T.value);
|
|
1217
|
-
}),
|
|
1218
|
-
const
|
|
1217
|
+
}), m({ search: z, query: k, getTableRef: H }), (y, e) => {
|
|
1218
|
+
const v = Te("loading");
|
|
1219
1219
|
return r(), w("div", ia, [
|
|
1220
1220
|
y.$slots.form ? (r(), p(l(Ie), {
|
|
1221
1221
|
key: 0,
|
|
@@ -1279,7 +1279,7 @@ const ua = (t) => {
|
|
|
1279
1279
|
])
|
|
1280
1280
|
}))
|
|
1281
1281
|
]), 1040, ["columns", "data", "onSelectionChange"])), [
|
|
1282
|
-
[
|
|
1282
|
+
[v, i.value]
|
|
1283
1283
|
]),
|
|
1284
1284
|
D("div", fa, [
|
|
1285
1285
|
S(l(Le), {
|