easy-ep-ui 0.1.0 → 0.1.1
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/easy-ep-ui.js +1 -1
- package/dist/style.css +1 -1
- package/es/components/ee-dict-select/src/index.vue.d.ts +2 -0
- package/es/components/ee-form-dialog/src/index.vue.d.ts +2 -0
- package/es/components/ee-form-table/src/components/FormDrawer.vue.d.ts +38 -0
- package/es/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
- package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +42 -0
- package/es/components/ee-form-table/src/constants.d.ts +31 -0
- package/es/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
- package/es/components/ee-form-table/src/hooks/useCrud.d.ts +39 -0
- package/es/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
- package/es/components/ee-form-table/src/hooks/useExport.d.ts +32 -0
- package/es/components/ee-form-table/src/hooks/useForm.d.ts +31 -0
- package/es/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
- package/es/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
- package/es/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
- package/es/components/ee-form-table/src/index.vue.d.ts +1079 -534
- package/es/components/ee-form-table/types.d.ts +197 -0
- package/es/components/ee-search-bar/src/index.vue.d.ts +2 -0
- package/es/index.d.ts +2 -0
- package/es/index.mjs +1483 -332
- package/es/style.css +1 -1
- package/lib/components/ee-dict-select/src/index.vue.d.ts +2 -0
- package/lib/components/ee-form-dialog/src/index.vue.d.ts +2 -0
- package/lib/components/ee-form-table/src/components/FormDrawer.vue.d.ts +38 -0
- package/lib/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
- package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +42 -0
- package/lib/components/ee-form-table/src/constants.d.ts +31 -0
- package/lib/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
- package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +39 -0
- package/lib/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
- package/lib/components/ee-form-table/src/hooks/useExport.d.ts +32 -0
- package/lib/components/ee-form-table/src/hooks/useForm.d.ts +31 -0
- package/lib/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
- package/lib/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
- package/lib/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
- package/lib/components/ee-form-table/src/index.vue.d.ts +1079 -534
- package/lib/components/ee-form-table/types.d.ts +197 -0
- package/lib/components/ee-search-bar/src/index.vue.d.ts +2 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/style.css +1 -1
- package/package.json +5 -4
package/dist/easy-ep-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.EasyEpUI={},k.Vue,k.ElementPlus))})(this,function(k,e,o){"use strict";const b=e.defineComponent({name:"EeDictSelect",__name:"index",props:{modelValue:{},options:{},request:{},valueField:{default:"value"},labelField:{default:"label"}},emits:["update:modelValue","change","clear","focus","blur"],setup(l,{emit:V}){const d=l,p=V,f=e.ref(!1),m=e.ref([]),c=e.computed(()=>(d.options??m.value).map(i=>({value:String(i[d.valueField]??""),label:String(i[d.labelField]??""),disabled:i.disabled??!1})));async function t(){if(!d.options&&d.request){f.value=!0;try{m.value=await d.request()}finally{f.value=!1}}}return e.onMounted(t),e.watch(()=>d.request,t),(s,i)=>(e.openBlock(),e.createBlock(e.unref(o.ElSelect),e.mergeProps(s.$attrs,{"model-value":l.modelValue,loading:f.value,"onUpdate:modelValue":i[0]||(i[0]=a=>p("update:modelValue",a)),onChange:i[1]||(i[1]=a=>p("change",a)),onClear:i[2]||(i[2]=a=>p("clear")),onFocus:i[3]||(i[3]=a=>p("focus",a)),onBlur:i[4]||(i[4]=a=>p("blur",a))}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,a=>(e.openBlock(),e.createBlock(e.unref(o.ElOption),{key:a.value,label:a.label,value:a.value,disabled:a.disabled},null,8,["label","value","disabled"]))),128))]),_:1},16,["model-value","loading"]))}});b.install=l=>{l.component(b.name??"EeDictSelect",b)};const g=e.defineComponent({name:"EeStatusTag",__name:"index",props:{value:{},mapping:{},fallbackLabel:{},defaultType:{default:"info"},defaultEffect:{default:"light"}},setup(l){const V=l,d=e.computed(()=>V.mapping.find(p=>p.value===V.value));return(p,f)=>{var m,c;return e.openBlock(),e.createBlock(e.unref(o.ElTag),e.mergeProps(p.$attrs,{type:((m=d.value)==null?void 0:m.type)??l.defaultType,effect:((c=d.value)==null?void 0:c.effect)??l.defaultEffect}),{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(((t=d.value)==null?void 0:t.label)??l.fallbackLabel??l.value),1)]}),_:1},16,["type","effect"])}}});g.install=l=>{l.component(g.name??"EeStatusTag",g)};const w={class:"ee-search-bar"},x=e.defineComponent({name:"EeSearchBar",__name:"index",props:{modelValue:{},fields:{},inline:{type:Boolean,default:!0},labelWidth:{default:"auto"},collapsible:{type:Boolean,default:!1},collapsedCount:{default:3}},emits:["update:modelValue","search","reset"],setup(l,{emit:V}){const d=l,p=V,f=e.ref(),m=e.ref(!1),c=e.computed(()=>{const n=24-t.value.reduce((r,u)=>r+(u.span??6),0)%24;return n===24?6:n}),t=e.computed(()=>!d.collapsible||m.value?d.fields:d.fields.slice(0,d.collapsedCount));function s(){p("search",{...d.modelValue})}function i(){const a={};d.fields.forEach(n=>{a[n.prop]=""}),p("update:modelValue",a),p("reset")}return(a,n)=>(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(e.unref(o.ElForm),e.mergeProps({ref_key:"formRef",ref:f,model:l.modelValue,inline:l.inline,"label-width":l.labelWidth},a.$attrs),{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,r=>(e.openBlock(),e.createBlock(e.unref(o.ElCol),{key:r.prop,span:r.span??6},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElFormItem),{label:r.label,prop:r.prop},{default:e.withCtx(()=>[(r.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(o.ElInput),{key:0,modelValue:l.modelValue[r.prop],"onUpdate:modelValue":u=>l.modelValue[r.prop]=u,placeholder:r.placeholder??`请输入${r.label}`,clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):r.type==="select"?(e.openBlock(),e.createBlock(e.unref(o.ElSelect),{key:1,modelValue:l.modelValue[r.prop],"onUpdate:modelValue":u=>l.modelValue[r.prop]=u,placeholder:r.placeholder??`请选择${r.label}`,clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options??[],u=>(e.openBlock(),e.createBlock(e.unref(o.ElOption),{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):r.type==="date"?(e.openBlock(),e.createBlock(e.unref(o.ElDatePicker),{key:2,modelValue:l.modelValue[r.prop],"onUpdate:modelValue":u=>l.modelValue[r.prop]=u,placeholder:r.placeholder??`请选择${r.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):r.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(o.ElDatePicker),{key:3,modelValue:l.modelValue[r.prop],"onUpdate:modelValue":u=>l.modelValue[r.prop]=u,type:"daterange","range-separator":r.placeholder??"至","start-placeholder":r.placeholder??"开始日期","end-placeholder":r.placeholder??"结束日期",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder"])):r.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.component),{key:4,modelValue:l.modelValue[r.prop],"onUpdate:modelValue":u=>l.modelValue[r.prop]=u},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(o.ElCol),{span:c.value},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElButton),{type:"primary",onClick:s},{default:e.withCtx(()=>[...n[1]||(n[1]=[e.createTextVNode(" 搜索 ",-1)])]),_:1}),e.createVNode(e.unref(o.ElButton),{onClick:i},{default:e.withCtx(()=>[...n[2]||(n[2]=[e.createTextVNode(" 重置 ",-1)])]),_:1}),l.collapsible&&l.fields.length>l.collapsedCount?(e.openBlock(),e.createBlock(e.unref(o.ElButton),{key:0,text:"",onClick:n[0]||(n[0]=r=>m.value=!m.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value?"收起":"展开"),1)]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["span"])]),_:1})]),_:1},16,["model","inline","label-width"])]))}}),E=(l,V)=>{const d=l.__vccOpts||l;for(const[p,f]of V)d[p]=f;return d},h=E(x,[["__scopeId","data-v-64bb08e9"]]);h.install=l=>{l.component(h.name??"EeSearchBar",h)};const S={class:"ee-form-dialog-footer"},B=E(e.defineComponent({name:"EeFormDialog",__name:"index",props:{modelValue:{type:Boolean},title:{default:"表单"},formData:{},fields:{},rules:{},width:{default:"600px"},labelWidth:{default:"auto"},loading:{type:Boolean,default:!1}},emits:["update:modelValue","submit","cancel"],setup(l,{emit:V}){const d=l,p=V,f=e.ref(),m=e.computed(()=>{const s={};for(const i of Object.keys(d))["modelValue","title","formData","fields","rules","width","labelWidth","loading"].includes(i)||(s[i]=d[i]);return s});function c(){p("update:modelValue",!1),p("cancel")}async function t(){if(f.value)try{await f.value.validate(),p("submit",{...d.formData})}catch{}}return(s,i)=>(e.openBlock(),e.createBlock(e.unref(o.ElDialog),e.mergeProps(s.$attrs,{"model-value":l.modelValue,title:l.title,width:l.width,"onUpdate:modelValue":i[0]||(i[0]=a=>p("update:modelValue",a)),onClose:c}),{footer:e.withCtx(()=>[e.createElementVNode("span",S,[e.createVNode(e.unref(o.ElButton),{onClick:c},{default:e.withCtx(()=>[...i[1]||(i[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(o.ElButton),{type:"primary",loading:l.loading,onClick:t},{default:e.withCtx(()=>[...i[2]||(i[2]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(o.ElForm),e.mergeProps({ref_key:"formRef",ref:f,model:l.formData,rules:l.rules,"label-width":l.labelWidth},m.value),{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElRow),{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.fields,a=>(e.openBlock(),e.createBlock(e.unref(o.ElCol),{key:a.prop,span:a.span??24},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElFormItem),{label:a.label,prop:a.prop},{default:e.withCtx(()=>[(a.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(o.ElInput),{key:0,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n,placeholder:a.placeholder??`请输入${a.label}`},null,8,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(o.ElInput),{key:1,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n,type:"textarea",placeholder:a.placeholder??`请输入${a.label}`,rows:3},null,8,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="select"?(e.openBlock(),e.createBlock(e.unref(o.ElSelect),{key:2,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n,placeholder:a.placeholder??`请选择${a.label}`,style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options??[],n=>(e.openBlock(),e.createBlock(e.unref(o.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="radio"?(e.openBlock(),e.createBlock(e.unref(o.ElRadioGroup),{key:3,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options??[],n=>(e.openBlock(),e.createBlock(e.unref(o.ElRadio),{key:n.value,label:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):a.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(o.ElCheckboxGroup),{key:4,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options??[],n=>(e.openBlock(),e.createBlock(e.unref(o.ElCheckbox),{key:n.value,label:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):a.type==="switch"?(e.openBlock(),e.createBlock(e.unref(o.ElSwitch),{key:5,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n},null,8,["modelValue","onUpdate:modelValue"])):a.type==="date"?(e.openBlock(),e.createBlock(e.unref(o.ElDatePicker),{key:6,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n,placeholder:a.placeholder??`请选择${a.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):a.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component),{key:7,modelValue:l.formData[a.prop],"onUpdate:modelValue":n=>l.formData[a.prop]=n},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:1})]),_:1},16,["model","rules","label-width"])]),_:1},16,["model-value","title","width"]))}}),[["__scopeId","data-v-0307e8cf"]]);B.install=l=>{l.component(B.name??"EeFormDialog",B)};const D={class:"ee-form-table"},U={key:1,class:"ee-form-table-toolbar"},N={key:2,class:"ee-form-table-pagination"},y=E(e.defineComponent({name:"EeFormTable",__name:"index",props:{data:{},columns:{},searchFields:{},pagination:{},loading:{type:Boolean,default:!1},showSelection:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1},showPagination:{type:Boolean,default:!0},pageSizes:{default:()=>[10,20,50,100]},paginationLayout:{default:"total, sizes, prev, pager, next, jumper"},collapsible:{type:Boolean,default:!1},collapsedCount:{default:3}},emits:["search","reset","selection-change","sort-change","current-change","size-change"],setup(l,{emit:V}){const d=V,p=e.ref(),f=e.ref({});return(m,c)=>(e.openBlock(),e.createElementBlock("div",D,[l.searchFields&&l.searchFields.length?(e.openBlock(),e.createBlock(e.unref(h),{key:0,modelValue:f.value,"onUpdate:modelValue":c[0]||(c[0]=t=>f.value=t),fields:l.searchFields,collapsible:l.collapsible,"collapsed-count":l.collapsedCount,onSearch:c[1]||(c[1]=t=>d("search",t)),onReset:c[2]||(c[2]=t=>d("reset"))},null,8,["modelValue","fields","collapsible","collapsed-count"])):e.createCommentVNode("",!0),m.$slots.toolbar?(e.openBlock(),e.createElementBlock("div",U,[e.renderSlot(m.$slots,"toolbar",{},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(e.unref(o.ElTable),e.mergeProps({ref_key:"tableRef",ref:p},m.$attrs,{data:l.data,loading:l.loading,onSelectionChange:c[3]||(c[3]=t=>d("selection-change",t)),onSortChange:c[4]||(c[4]=t=>d("sort-change",t))}),{default:e.withCtx(()=>[l.showSelection?(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:0,type:"selection",width:"50",fixed:"left"})):e.createCommentVNode("",!0),l.showIndex?(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:1,type:"index",label:"序号",width:"60",fixed:"left"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,t=>(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:t.prop,prop:t.prop,label:t.label,width:t.width,"min-width":t.minWidth,fixed:t.fixed,sortable:t.sortable,align:t.align??"center"},{default:e.withCtx(s=>[e.renderSlot(m.$slots,t.prop,{row:s.row,index:s.$index},()=>[e.createElementVNode("span",null,e.toDisplayString(t.formatter?t.formatter(s.row,t,s.row[t.prop],s.$index):s.row[t.prop]),1)],!0)]),_:2},1032,["prop","label","width","min-width","fixed","sortable","align"]))),128)),e.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},16,["data","loading"]),l.showPagination?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(e.unref(o.ElPagination),{"current-page":l.pagination.current,"onUpdate:currentPage":c[5]||(c[5]=t=>l.pagination.current=t),"page-size":l.pagination.pageSize,"onUpdate:pageSize":c[6]||(c[6]=t=>l.pagination.pageSize=t),total:l.pagination.total,"page-sizes":l.pageSizes,layout:l.paginationLayout,background:"",onCurrentChange:c[7]||(c[7]=t=>d("current-change",t)),onSizeChange:c[8]||(c[8]=t=>d("size-change",t))},null,8,["current-page","page-size","total","page-sizes","layout"])])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-70d01eeb"]]);y.install=l=>{l.component(y.name??"EeFormTable",y)};const F=[b,g,h,B,y];function C(l){F.forEach(V=>{l.use(V)})}const $={install:C};k.EeDictSelect=b,k.EeFormDialog=B,k.EeFormTable=y,k.EeSearchBar=h,k.EeStatusTag=g,k.default=$,k.install=C,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E.EasyEpUI={},E.Vue,E.ElementPlus))})(this,function(E,e,l){"use strict";const U=e.defineComponent({name:"EeDictSelect",__name:"index",props:{modelValue:{},options:{},request:{},valueField:{default:"value"},labelField:{default:"label"},size:{default:"default"}},emits:["update:modelValue","change","clear","focus","blur"],setup(t,{emit:r}){const o=t,a=r,i=e.ref(!1),f=e.ref([]),p=e.computed(()=>(o.options??f.value).map(m=>({value:String(m[o.valueField]??""),label:String(m[o.labelField]??""),disabled:m.disabled??!1})));async function w(){if(!o.options&&o.request){i.value=!0;try{f.value=await o.request()}finally{i.value=!1}}}return e.onMounted(w),e.watch(()=>o.request,w),(b,m)=>(e.openBlock(),e.createBlock(e.unref(l.ElSelect),e.mergeProps(b.$attrs,{"model-value":t.modelValue,loading:i.value,size:t.size,"onUpdate:modelValue":m[0]||(m[0]=n=>a("update:modelValue",n)),onChange:m[1]||(m[1]=n=>a("change",n)),onClear:m[2]||(m[2]=n=>a("clear")),onFocus:m[3]||(m[3]=n=>a("focus",n)),onBlur:m[4]||(m[4]=n=>a("blur",n))}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,n=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:n.value,label:n.label,value:n.value,disabled:n.disabled},null,8,["label","value","disabled"]))),128))]),_:1},16,["model-value","loading","size"]))}});U.install=t=>{t.component(U.name??"EeDictSelect",U)};const R=e.defineComponent({name:"EeStatusTag",__name:"index",props:{value:{},mapping:{},fallbackLabel:{},defaultType:{default:"info"},defaultEffect:{default:"light"}},setup(t){const r=t,o=e.computed(()=>r.mapping.find(a=>a.value===r.value));return(a,i)=>{var f,p;return e.openBlock(),e.createBlock(e.unref(l.ElTag),e.mergeProps(a.$attrs,{type:((f=o.value)==null?void 0:f.type)??t.defaultType,effect:((p=o.value)==null?void 0:p.effect)??t.defaultEffect}),{default:e.withCtx(()=>{var w;return[e.createTextVNode(e.toDisplayString(((w=o.value)==null?void 0:w.label)??t.fallbackLabel??t.value),1)]}),_:1},16,["type","effect"])}}});R.install=t=>{t.component(R.name??"EeStatusTag",R)};const re={class:"ee-search-bar"},ie=e.defineComponent({name:"EeSearchBar",__name:"index",props:{modelValue:{},fields:{},inline:{type:Boolean,default:!0},labelWidth:{default:"auto"},collapsible:{type:Boolean,default:!1},collapsedCount:{default:3},size:{default:"default"}},emits:["update:modelValue","search","reset"],setup(t,{emit:r}){const o=t,a=r,i=e.ref(),f=e.ref(!1),p=e.computed(()=>{const c=24-w.value.reduce((s,h)=>s+(h.span??6),0)%24;return c===24?6:c}),w=e.computed(()=>!o.collapsible||f.value?o.fields:o.fields.slice(0,o.collapsedCount));function b(){a("search",{...o.modelValue})}function m(){const n={};o.fields.forEach(c=>{n[c.prop]=""}),a("update:modelValue",n),a("reset")}return(n,c)=>(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(l.ElForm),e.mergeProps({ref_key:"formRef",ref:i,model:t.modelValue,inline:t.inline,"label-width":t.labelWidth,size:t.size},n.$attrs),{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,s=>(e.openBlock(),e.createBlock(e.unref(l.ElCol),{key:s.prop,span:s.span??6},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),{label:s.label,prop:s.prop},{default:e.withCtx(()=>[(s.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),{key:0,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,placeholder:s.placeholder??`请输入${s.label}`,clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):s.type==="select"?(e.openBlock(),e.createBlock(e.unref(l.ElSelect),{key:1,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,placeholder:s.placeholder??`请选择${s.label}`,clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.options??[],h=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):s.type==="date"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),{key:2,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,placeholder:s.placeholder??`请选择${s.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):s.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),{key:3,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,type:"daterange","range-separator":s.placeholder??"至","start-placeholder":s.placeholder??"开始日期","end-placeholder":s.placeholder??"结束日期",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder"])):s.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.component),{key:4,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(l.ElCol),{span:p.value},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",onClick:b},{default:e.withCtx(()=>[...c[1]||(c[1]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:m},{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["size"]),t.collapsible&&t.fields.length>t.collapsedCount?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,text:"",size:t.size,onClick:c[0]||(c[0]=s=>f.value=!f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["span"])]),_:1})]),_:1},16,["model","inline","label-width","size"])]))}}),X=(t,r)=>{const o=t.__vccOpts||t;for(const[a,i]of r)o[a]=i;return o},A=X(ie,[["__scopeId","data-v-b65c74a4"]]);A.install=t=>{t.component(A.name??"EeSearchBar",A)};const ce={class:"ee-form-dialog-footer"},I=X(e.defineComponent({name:"EeFormDialog",__name:"index",props:{modelValue:{type:Boolean},title:{default:"表单"},formData:{},fields:{},rules:{},width:{default:"600px"},labelWidth:{default:"auto"},loading:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","submit","cancel"],setup(t,{emit:r}){const o=t,a=r,i=e.ref(),f=e.computed(()=>{const b={};for(const m of Object.keys(o))["modelValue","title","formData","fields","rules","width","labelWidth","loading"].includes(m)||(b[m]=o[m]);return b});function p(){a("update:modelValue",!1),a("cancel")}async function w(){if(i.value)try{await i.value.validate(),a("submit",{...o.formData})}catch{}}return(b,m)=>(e.openBlock(),e.createBlock(e.unref(l.ElDialog),e.mergeProps(b.$attrs,{"model-value":t.modelValue,title:t.title,width:t.width,"onUpdate:modelValue":m[0]||(m[0]=n=>a("update:modelValue",n)),onClose:p}),{footer:e.withCtx(()=>[e.createElementVNode("span",ce,[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:p},{default:e.withCtx(()=>[...m[1]||(m[1]=[e.createTextVNode("取消",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",loading:t.loading,onClick:w},{default:e.withCtx(()=>[...m[2]||(m[2]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["size","loading"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(l.ElForm),e.mergeProps({ref_key:"formRef",ref:i,model:t.formData,rules:t.rules,"label-width":t.labelWidth,size:t.size},f.value),{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElRow),{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,n=>(e.openBlock(),e.createBlock(e.unref(l.ElCol),{key:n.prop,span:n.span??24},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),{label:n.label,prop:n.prop},{default:e.withCtx(()=>[(n.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),{key:0,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,placeholder:n.placeholder??`请输入${n.label}`},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),{key:1,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,type:"textarea",placeholder:n.placeholder??`请输入${n.label}`,rows:3},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(l.ElSelect),{key:2,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,placeholder:n.placeholder??`请选择${n.label}`,style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],c=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="radio"?(e.openBlock(),e.createBlock(e.unref(l.ElRadioGroup),{key:3,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],c=>(e.openBlock(),e.createBlock(e.unref(l.ElRadio),{key:c.value,label:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):n.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(l.ElCheckboxGroup),{key:4,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],c=>(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:c.value,label:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(l.ElSwitch),{key:5,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},null,8,["modelValue","onUpdate:modelValue"])):n.type==="date"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),{key:6,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,placeholder:n.placeholder??`请选择${n.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:7,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:1})]),_:1},16,["model","rules","label-width","size"])]),_:1},16,["model-value","title","width"]))}}),[["__scopeId","data-v-560e642c"]]);I.install=t=>{t.component(I.name??"EeFormDialog",I)};const Y=[10,20,50,100],de="total, sizes, prev, pager, next, jumper",Z={show:!0,cols:3,maxRow:2,foldable:!0,foldDefault:!0},J={show:!1},G={show:!0,pageSize:20,pageSizes:Y,background:!0},se={show:!1},Q={show:!0,showView:!1,showEdit:!0,showDelete:!0,confirmDelete:!0,deleteConfirmTitle:"确认删除",deleteConfirmMessage:"确定要删除该条数据吗?"},P={show:!1},fe={show:!0,showAdd:!1,showImport:!1,showExport:!1,showBatchDelete:!1},_={show:!1},me={mode:"drawer",width:"40%",closeOnReset:!0,addTitle:"新增",editTitle:"编辑"},ue=["data","loading","size","stripe","border","height","max-height","highlight-current-row","row-key"],ge=["prop","label","width","minWidth","align","fixed","sortable","show","formatter","dictKey","slotName","search","auth","children","className"];function he(t){const r=e.computed(()=>!!t.authChecker);function o(a){return!a||!t.authChecker?!0:t.authChecker(a)}return{authPass:o,authEnabled:r}}function pe(t){function r(a,i){var f;return a||(i&&((f=t.dictMap)!=null&&f[i])?t.dictMap[i]:[])}function o(a,i){var p;if(!a||!((p=t.dictMap)!=null&&p[a]))return String(i??"");const f=t.dictMap[a].find(w=>w.value===i);return(f==null?void 0:f.label)??String(i??"")}return{resolvedDict:r,dictLabel:o}}function Ce(t){const r=e.ref(!0),o=e.reactive({}),a=e.computed(()=>t.searchConfig===!1?J:t.searchConfig===!0?{...Z}:t.searchConfig?{...Z,...t.searchConfig}:J),i=e.computed(()=>a.value.show),f=e.computed(()=>a.value.cols||3),p=e.computed(()=>t.columns.filter(u=>{var k;return(k=u.search)==null?void 0:k.enable}).map(u=>{const k=u.search;return{...k,prop:u.prop,label:u.label,field:k.field||u.prop,placeholder:k.placeholder||u.label,dictKey:u.dictKey,props:k.props||{}}})),w=e.computed(()=>a.value.maxRow||2),b=e.computed(()=>f.value*w.value),m=e.computed(()=>a.value.foldable!==!1&&p.value.length>b.value);e.onMounted(()=>{a.value.foldDefault!==!1&&(r.value=!1)});const n=e.computed(()=>!r.value&&m.value?p.value.slice(0,b.value):p.value),c=e.computed(()=>24/f.value);function s(){p.value.forEach(u=>{o[u.field]=u.defaultValue??""})}function h(){const u={};return p.value.forEach(k=>{u[k.field]=k.defaultValue??""}),u}function x(){const u={};for(const[k,S]of Object.entries(o))S!==""&&S!==null&&S!==void 0&&(u[k]=S);return u}function z(){Object.assign(o,h())}function D(){r.value=!r.value}return{searchExpanded:r,searchParams:o,searchCfg:a,showSearch:i,searchCols:f,allSearchFields:p,visibleSearchFields:n,showFoldBtn:m,actionColSpan:c,initSearchParams:s,getDefaultSearchParams:h,getActiveSearchParams:x,resetSearchParams:z,toggleFold:D}}function ke(t){const r=e.reactive({current:1,pageSize:20,total:0}),o=e.computed(()=>t.pagination===!1?se:t.pagination===!0?{...G}:t.pagination?{...G,...t.pagination}:{...G,show:!0}),a=e.computed(()=>o.value.show!==!1),i=e.computed(()=>o.value.pageSizes||Y),f=e.computed(()=>o.value.layout||de),p=e.computed(()=>o.value.background!==!1);e.onMounted(()=>{t.pagination&&typeof t.pagination=="object"&&(t.pagination.pageSize&&(r.pageSize=t.pagination.pageSize),t.pagination.total!==void 0&&(r.total=t.pagination.total))}),e.watch(()=>t.pagination,n=>{typeof n=="object"&&n&&(n.total!==void 0&&(r.total=n.total),n.pageSize&&(r.pageSize=n.pageSize))},{deep:!0});function w(n){r.current=n}function b(n){r.pageSize=n}function m(){r.current=1}return{pageState:r,paginationCfg:o,showPagination:a,pageSizesComputed:i,paginationLayoutComputed:f,paginationBgComputed:p,setPage:w,setPageSize:b,resetPage:m}}function we(t,r){const o=e.ref(),a=e.ref([]),i=e.ref(null),f=e.ref(!1),p=e.ref([]),w=e.computed(()=>({show:!1,type:"multiple",reserveSelection:!1,...t.selectionConfig})),b=e.computed(()=>({show:!1,...t.columnSetting})),m=e.computed(()=>b.value.show),n=e.computed(()=>t.columns.filter(u=>u.prop));e.onMounted(()=>{p.value=n.value.map(u=>u.prop)}),e.watch(()=>t.columns,()=>{p.value=[...new Set([...p.value.filter(u=>n.value.some(k=>k.prop===u)),...n.value.map(u=>u.prop)])]},{deep:!0});const c=e.computed(()=>n.value.filter(u=>u.show!==!1&&p.value.includes(u.prop)&&r.authPass(u.auth))),s=e.computed(()=>t.tableHeight||void 0),h=e.computed(()=>t.tableMaxHeight||void 0),x=e.computed(()=>t.autoHeight?{minHeight:`calc(100vh - ${(typeof t.autoHeight=="object"?t.autoHeight:{}).offset||200}px)`}:{});function z(u){a.value=u}function D(u){const k=t.rowKey||"id";i.value=u[k],a.value=[u]}return{tableRef:o,selection:a,singleSelection:i,columnSettingVisible:f,checkedColumns:p,selectionCfg:w,columnSettingCfg:b,showColumnSetting:m,allColumns:n,visibleColumns:c,tableComputedHeight:s,tableMaxHeightProp:h,tableWrapperStyle:x,handleSelectionChange:z,handleSingleSelect:D}}function be(t,r){const o=e.ref([]),a=e.ref(!1),i=e.computed(()=>{var c;return!!((c=t.crudConfig)!=null&&c.api.list)});async function f(){var c;if((c=t.crudConfig)!=null&&c.api.list){a.value=!0;try{const s={page:r.pageState.current,pageSize:r.pageState.pageSize,...t.crudConfig.baseParams},h=r.getActiveSearchParams();Object.assign(s,h);const x=await t.crudConfig.api.list(s);o.value=x.data||[],r.setTotal(x.total??0)}catch(s){r.emit("request-error",s),l.ElMessage.error((s==null?void 0:s.message)||"请求失败")}finally{a.value=!1}}}async function p(){r.resetPage(),await f()}async function w(c){var s;if(!((s=t.crudConfig)!=null&&s.api.delete)){r.emit("delete",c);return}a.value=!0;try{const h=c[t.rowKey||"id"];await t.crudConfig.api.delete(h),l.ElMessage.success("删除成功"),r.emit("delete-success"),await f()}catch(h){r.emit("request-error",h),l.ElMessage.error((h==null?void 0:h.message)||"删除失败")}finally{a.value=!1}}async function b(c,s,h,x){if(!s){await w(c);return}try{await l.ElMessageBox.confirm(x||"确定要删除该条数据吗?",h||"确认删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await w(c)}catch{}}async function m(c){var s;if(!((s=t.crudConfig)!=null&&s.api.batchDelete)){r.emit("batch-delete",c);return}a.value=!0;try{await t.crudConfig.api.batchDelete(c),l.ElMessage.success("批量删除成功"),r.emit("batch-delete-success"),r.selection.value=[],await f()}catch(h){r.emit("request-error",h),l.ElMessage.error((h==null?void 0:h.message)||"批量删除失败")}finally{a.value=!1}}async function n(){const c=r.selection.value;if(c.length!==0)try{await l.ElMessageBox.confirm(`确定要删除选中的 ${c.length} 条数据吗?`,"确认批量删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const s=c.map(h=>h[t.rowKey||"id"]);await m(s)}catch{}}return{internalData:o,loadingState:a,hasCrud:i,fetchData:f,refreshTable:p,doDelete:w,handleDelete:b,doBatchDelete:m,handleBatchDelete:n}}function ye(t){const r=e.ref(!1),o=e.ref(!1),a=e.ref(null),i=e.ref({}),f=e.ref(!1),p={...me,...t.drawerConfig},w=p.mode||"drawer";function b(){o.value=!1,a.value=null,i.value={},r.value=!0}function m(c){o.value=!0,a.value=c,i.value={...c},r.value=!0}function n(){r.value=!1}return{formVisible:r,isEditing:o,editingRow:a,formData:i,saving:f,drawerMode:w,drawerCfg:p,openAdd:b,openEdit:m,closeForm:n}}function Be(t,r){const o=e.ref(!1);async function a(){var i,f,p,w,b;o.value=!0,r.setLoading(!0);try{const m=await import("xlsx").catch(()=>null);if(!m){l.ElMessage.warning("请安装 xlsx 依赖: npm install xlsx");return}const n=((i=t.exportConfig)==null?void 0:i.mode)||"current";let c;if(n==="all"&&((p=(f=t.crudConfig)==null?void 0:f.api)!=null&&p.list)){const u={page:1,pageSize:99999,...t.crudConfig.baseParams},k=r.getActiveSearchParams();Object.assign(u,k),c=(await t.crudConfig.api.list(u)).data||[]}else c=[...r.getCurrentData()];const s=((w=t.exportConfig)==null?void 0:w.ignoreColumn)||[],h=r.visibleColumns.value.filter(u=>!s.includes(u.prop)).map(u=>({prop:u.prop,label:u.label})),x=[h.map(u=>u.label),...c.map(u=>h.map(k=>{var O;if(k.prop==="action")return"";const S=(O=t.columns.find(j=>j.prop===k.prop))==null?void 0:O.dictKey;return S?r.dictLabel(S,u[k.prop]):u[k.prop]??""}))],z=m.utils.aoa_to_sheet(x),D=m.utils.book_new();m.utils.book_append_sheet(D,z,"Sheet1"),m.writeFile(D,((b=t.exportConfig)==null?void 0:b.fileName)||"export.xlsx"),l.ElMessage.success("导出成功")}catch(m){l.ElMessage.error((m==null?void 0:m.message)||"导出失败")}finally{r.setLoading(!1),o.value=!1}}return{handleExport:a,exporting:o}}const Ve={key:0,class:"ee-search-area"},Ee=e.defineComponent({__name:"SearchArea",props:{showSearch:{type:Boolean},searchParams:{},visibleSearchFields:{},searchCols:{},actionColSpan:{},showFoldBtn:{type:Boolean},searchExpanded:{type:Boolean},size:{},resolveDict:{type:Function}},emits:["search","reset","toggle-fold"],setup(t){return(r,o)=>t.showSearch?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(e.unref(l.ElForm),{model:t.searchParams,"label-width":"auto",size:t.size},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElRow),{gutter:12},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleSearchFields,a=>(e.openBlock(),e.createBlock(e.unref(l.ElCol),{key:String(a.prop),span:24/t.searchCols},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),{label:String(a.label)},{default:e.withCtx(()=>[a.type==="input"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),e.mergeProps({key:0,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请输入${a.label}`),clearable:""},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="number"?(e.openBlock(),e.createBlock(e.unref(l.ElInputNumber),e.mergeProps({key:1,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请输入${a.label}`),style:{width:"100%"}},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="select"?(e.openBlock(),e.createBlock(e.unref(l.ElSelect),e.mergeProps({key:2,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请选择${a.label}`),clearable:"",style:{width:"100%"}},{ref_for:!0},a.props||{}),{default:e.withCtx(()=>{var i;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((i=a.props)==null?void 0:i.options,a.dictKey),f=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="radio"?(e.openBlock(),e.createBlock(e.unref(l.ElRadioGroup),e.mergeProps({key:3,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i},{ref_for:!0},a.props||{}),{default:e.withCtx(()=>{var i;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((i=a.props)==null?void 0:i.options,a.dictKey),f=>(e.openBlock(),e.createBlock(e.unref(l.ElRadio),{key:f.value,value:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["value"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue"])):a.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(l.ElCheckboxGroup),e.mergeProps({key:4,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i},{ref_for:!0},a.props||{}),{default:e.withCtx(()=>{var i;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((i=a.props)==null?void 0:i.options,a.dictKey),f=>(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:f.value,value:f.value,label:f.label},null,8,["value","label"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue"])):a.type==="date"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),e.mergeProps({key:5,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请选择${a.label}`),style:{width:"100%"}},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),e.mergeProps({key:6,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",style:{width:"100%"}},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue"])):a.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),e.mergeProps({key:7,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请输入${a.label}`),type:"textarea"},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):e.createCommentVNode("",!0)]),_:2},1032,["label"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(l.ElCol),{span:t.actionColSpan},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{type:"primary",round:"",onClick:o[0]||(o[0]=a=>r.$emit("search"))},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("查询",-1)])]),_:1}),e.createVNode(e.unref(l.ElButton),{round:"",onClick:o[1]||(o[1]=a=>r.$emit("reset"))},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("重置",-1)])]),_:1}),t.showFoldBtn?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,text:"",size:t.size,onClick:o[2]||(o[2]=a=>r.$emit("toggle-fold"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.searchExpanded?"收起":"展开"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"search-action",{params:t.searchParams})]),_:3})]),_:3},8,["span"])]),_:3})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0)}}),xe={key:0,class:"ee-toolbar"},Se={class:"ee-toolbar-left"},ze={class:"ee-toolbar-right"},De=e.defineComponent({__name:"TableToolbar",props:{show:{type:Boolean},toolbarCfg:{},size:{},deps:{}},emits:["add","import","export","batch-delete","refresh","column-setting"],setup(t){return(r,o)=>t.show?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",Se,[t.toolbarCfg.showAdd&&t.deps.authPass(t.toolbarCfg.addAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:"primary",size:t.size,round:"",onClick:o[0]||(o[0]=a=>r.$emit("add"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.addText||"新增"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showImport&&t.deps.authPass(t.toolbarCfg.importAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:1,size:t.size,round:"",onClick:o[1]||(o[1]=a=>r.$emit("import"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.importText||"导入"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showExport&&t.deps.authPass(t.toolbarCfg.exportAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:2,size:t.size,round:"",onClick:o[2]||(o[2]=a=>r.$emit("export"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.exportText||"导出"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showBatchDelete&&t.deps.selectionCount>0&&t.deps.authPass(t.toolbarCfg.batchDeleteAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:3,type:"danger",size:t.size,round:"",onClick:o[3]||(o[3]=a=>r.$emit("batch-delete"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.batchDeleteText||"批量删除"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toolbarCfg.customButtons||[],a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.code},[t.deps.authPass(a.auth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:a.type,size:t.size,round:"",onClick:a.handler},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.text),1)]),_:2},1032,["type","size","onClick"])):e.createCommentVNode("",!0)],64))),128))]),e.createElementVNode("div",ze,[e.createVNode(e.unref(l.ElTooltip),{content:"刷新"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{icon:"Refresh",size:t.size,circle:"",onClick:o[4]||(o[4]=a=>r.$emit("refresh"))},null,8,["size"])]),_:1}),t.deps.showColumnSetting?(e.openBlock(),e.createBlock(e.unref(l.ElTooltip),{key:0,content:"列设置"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{icon:"Setting",size:t.size,circle:"",onClick:o[5]||(o[5]=a=>r.$emit("column-setting"))},null,8,["size"])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"toolbar-right")])])):e.createCommentVNode("",!0)}}),Ne=e.defineComponent({__name:"FormDrawer",props:{visible:{type:Boolean},drawerMode:{},isEditing:{type:Boolean},editingRow:{},formData:{},drawerCfg:{},size:{},saving:{type:Boolean}},emits:["update:visible","save"],setup(t){return(r,o)=>t.drawerMode==="drawer"?(e.openBlock(),e.createBlock(e.unref(l.ElDrawer),{key:0,"model-value":t.visible,"onUpdate:modelValue":o[2]||(o[2]=a=>r.$emit("update:visible",a)),title:t.isEditing?t.drawerCfg.editTitle||"编辑":t.drawerCfg.addTitle||"新增",size:t.drawerCfg.width||"40%","destroy-on-close":t.drawerCfg.closeOnReset!==!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:o[0]||(o[0]=a=>r.$emit("update:visible",!1))},{default:e.withCtx(()=>[...o[6]||(o[6]=[e.createTextVNode("取消",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",loading:t.saving,onClick:o[1]||(o[1]=a=>r.$emit("save"))},{default:e.withCtx(()=>[...o[7]||(o[7]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["size","loading"])]),default:e.withCtx(()=>[e.renderSlot(r.$slots,t.isEditing?"edit-form":"add-form",{row:t.editingRow,formData:t.formData})]),_:3},8,["model-value","title","size","destroy-on-close"])):(e.openBlock(),e.createBlock(e.unref(l.ElDialog),{key:1,"model-value":t.visible,"onUpdate:modelValue":o[5]||(o[5]=a=>r.$emit("update:visible",a)),title:t.isEditing?t.drawerCfg.editTitle||"编辑":t.drawerCfg.addTitle||"新增",width:t.drawerCfg.width||"600px","destroy-on-close":t.drawerCfg.closeOnReset!==!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:o[3]||(o[3]=a=>r.$emit("update:visible",!1))},{default:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("取消",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",loading:t.saving,onClick:o[4]||(o[4]=a=>r.$emit("save"))},{default:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["size","loading"])]),default:e.withCtx(()=>[e.renderSlot(r.$slots,t.isEditing?"edit-form":"add-form",{row:t.editingRow,formData:t.formData})]),_:3},8,["model-value","title","width","destroy-on-close"]))}}),Te={key:0},$e={key:1},Fe={key:2},Ue={key:0,class:"ee-pagination"},L=e.defineComponent({name:"EeFormTable",__name:"index",props:{columns:{},data:{},loading:{type:Boolean,default:!1},searchConfig:{},pagination:{},actionConfig:{type:[Object,Boolean]},toolbarConfig:{type:[Object,Boolean]},crudConfig:{},selectionConfig:{},exportConfig:{},drawerConfig:{},columnSetting:{},autoHeight:{},dictMap:{},authChecker:{},authMode:{default:"hide"},emptyText:{default:"暂无数据"},tableHeight:{},tableMaxHeight:{},size:{default:"default"},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!0},highlightCurrentRow:{type:Boolean,default:!1},rowKey:{default:"id"}},emits:["search","search-reset","page-change","selection-change","current-change","size-change","sort-change","row-click","row-dblclick","view","add","edit","delete","batch-delete","import","export","add-success","edit-success","delete-success","batch-delete-success","request-error","column-visible-change","form-save"],setup(t,{expose:r,emit:o}){const a=t,i=o,f=he(a),p=pe(a),{searchExpanded:w,searchParams:b,showSearch:m,searchCols:n,visibleSearchFields:c,showFoldBtn:s,actionColSpan:h,initSearchParams:x,getActiveSearchParams:z,resetSearchParams:D,toggleFold:u}=Ce(a),{pageState:k,showPagination:S,pageSizesComputed:O,paginationLayoutComputed:j,paginationBgComputed:Ie,setPage:Le,setPageSize:Oe,resetPage:K}=ke(a),{tableRef:ee,selection:M,singleSelection:Me,columnSettingVisible:te,checkedColumns:q,showColumnSetting:He,allColumns:Ge,visibleColumns:ae,tableComputedHeight:je,tableMaxHeightProp:Ke,tableWrapperStyle:qe,selectionCfg:$,handleSelectionChange:We,handleSingleSelect:Xe}=we(a,{authPass:f.authPass}),Ye=be(a,{searchParams:b,getActiveSearchParams:z,pageState:k,resetPage:K,setTotal:g=>{k.total=g},selection:M,emit:(g,...C)=>i(g,...C)}),{internalData:W,loadingState:oe,hasCrud:F,fetchData:N,refreshTable:le,handleDelete:Ze,handleBatchDelete:Je}=Ye,B=ye(a),{handleExport:Qe}=Be(a,{visibleColumns:ae,getActiveSearchParams:z,dictLabel:p.dictLabel,internalData:W,fetchData:N,setLoading:g=>{oe.value=g},getCurrentData:()=>a.data||W.value}),T=e.computed(()=>({visible:!!B.formVisible.value,drawerMode:B.drawerMode,isEditing:B.isEditing.value??!1,editingRow:B.editingRow.value??null,formData:B.formData.value??{},drawerCfg:B.drawerCfg,saving:B.saving.value??!1,onVisibleChange:g=>{B.formVisible.value=g}})),H=e.computed({get:()=>te.value,set:g=>{te.value=g}}),V=e.computed(()=>a.actionConfig===!1?P:a.actionConfig===!0?{...Q}:a.actionConfig?{...Q,...a.actionConfig}:P),ne=e.computed(()=>{if(a.toolbarConfig===!1)return _;const g={...fe};return a.toolbarConfig===!0?{...g,show:!0}:a.toolbarConfig?{...g,...a.toolbarConfig}:_}),Pe=e.computed(()=>F.value?W.value:a.data||[]),_e=e.computed(()=>oe.value||a.loading);function ve(){K();const g=z();i("search",g),F.value&&N()}function et(){D(),i("search-reset"),F.value?N():i("search",{})}function tt(g){Le(g),i("current-change",g),i("page-change",{currentPage:g,pageSize:k.pageSize}),F.value&&N()}function at(g){Oe(g),K(),i("size-change",g),i("page-change",{currentPage:1,pageSize:g}),F.value&&N()}function ot(){B.openAdd(),i("add")}function lt(g){B.openEdit(g),i("edit",g)}function nt(g){Ze(g,V.value.confirmDelete!==!1,V.value.deleteConfirmTitle,V.value.deleteConfirmMessage)}function rt(){Je()}function it(){i("export"),Qe()}async function ct(){var g,C;B.saving.value=!0;try{i("form-save",{...B.formData.value},B.isEditing.value??!1),B.isEditing.value&&((g=a.crudConfig)!=null&&g.api.edit)?(await a.crudConfig.api.edit(B.formData.value),l.ElMessage.success("编辑成功"),i("edit-success")):!B.isEditing.value&&((C=a.crudConfig)!=null&&C.api.add)&&(await a.crudConfig.api.add(B.formData.value),l.ElMessage.success("新增成功"),i("add-success")),B.closeForm(),await N()}catch(d){i("request-error",d)}finally{B.saving.value=!1}}const dt=e.computed(()=>{const g={};for(const C of Object.keys(a))!ue.includes(C)&&!C.startsWith("on")&&(g[C]=a[C]);return g});function st(g){const C={};for(const[d,y]of Object.entries(g))ge.includes(d)||(C[d]=y);return C}return e.onMounted(()=>{x(),F.value&&N()}),r({refresh:le,fetchData:N,getSelection:()=>M.value,tableRef:ee}),(g,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ee-form-table",[`ee-size--${t.size}`,{"ee-stripe":t.stripe,"ee-border":t.border}]])},[e.createVNode(Ee,{"show-search":!!e.unref(m),"search-params":e.unref(b),"visible-search-fields":e.unref(c),"search-cols":e.unref(n),"action-col-span":e.unref(h),"show-fold-btn":!!e.unref(s),"search-expanded":!!e.unref(w),size:t.size,"resolve-dict":e.unref(p).resolvedDict,onSearch:ve,onReset:et,onToggleFold:e.unref(u)},{"search-action":e.withCtx(({params:d})=>[e.renderSlot(g.$slots,"search-action",{params:d})]),_:3},8,["show-search","search-params","visible-search-fields","search-cols","action-col-span","show-fold-btn","search-expanded","size","resolve-dict","onToggleFold"]),e.createVNode(De,{show:!!ne.value.show,"toolbar-cfg":ne.value,size:t.size,deps:{authPass:e.unref(f).authPass,selectionCount:e.unref(M).length,showColumnSetting:!!e.unref(He)},onAdd:ot,onImport:C[0]||(C[0]=d=>g.$emit("import")),onExport:it,onBatchDelete:rt,onRefresh:C[1]||(C[1]=d=>e.unref(le)()),onColumnSetting:C[2]||(C[2]=d=>H.value=!0)},{"toolbar-right":e.withCtx(()=>[e.renderSlot(g.$slots,"toolbar-right")]),_:3},8,["show","toolbar-cfg","size","deps"]),e.createElementVNode("div",{class:"ee-table-wrapper",style:e.normalizeStyle(e.unref(qe))},[e.createVNode(e.unref(l.ElTable),e.mergeProps({ref_key:"tableRef",ref:ee,data:Pe.value,loading:_e.value,size:t.size,stripe:t.stripe,border:t.border,height:e.unref(je),"max-height":e.unref(Ke),"highlight-current-row":t.highlightCurrentRow,"row-key":t.rowKey,onSelectionChange:C[3]||(C[3]=d=>{e.unref(We)(d),g.$emit("selection-change",d)}),onRowClick:C[4]||(C[4]=d=>g.$emit("row-click",d)),onRowDblclick:C[5]||(C[5]=d=>g.$emit("row-dblclick",d)),onSortChange:C[6]||(C[6]=d=>g.$emit("sort-change",d))},dt.value),{empty:e.withCtx(()=>[e.renderSlot(g.$slots,"empty",{},()=>[e.createVNode(e.unref(l.ElEmpty),{description:t.emptyText||"暂无数据"},null,8,["description"])])]),default:e.withCtx(()=>[e.unref($).show&&e.unref($).type==="multiple"?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:0,type:"selection",width:"50",fixed:"left",selectable:e.unref($).disabledRow?d=>!e.unref($).disabledRow(d):void 0,"reserve-selection":e.unref($).reserveSelection},null,8,["selectable","reserve-selection"])):e.createCommentVNode("",!0),e.unref($).show&&e.unref($).type==="single"?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:1,width:"50",fixed:"left"},{default:e.withCtx(({row:d})=>[e.createVNode(e.unref(l.ElRadio),{"model-value":e.unref(Me)===d[t.rowKey||"id"],value:d[t.rowKey||"id"],onChange:()=>{e.unref(Xe)(d),g.$emit("selection-change",e.unref(M))}},null,8,["model-value","value","onChange"])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae),d=>(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),e.mergeProps({key:d.prop,prop:d.prop,label:d.label,width:d.width,"min-width":d.minWidth,fixed:d.fixed,sortable:d.sortable,align:d.align||"center","class-name":d.className},{ref_for:!0},st(d)),{default:e.withCtx(y=>[e.renderSlot(g.$slots,d.slotName||d.prop,{row:y.row,index:y.$index,column:d},()=>[d.formatter?(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(d.formatter(y.row,d,y.row[d.prop],y.$index)),1)):d.dictKey?(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(e.unref(p).dictLabel(d.dictKey,y.row[d.prop])),1)):(e.openBlock(),e.createElementBlock("span",Fe,e.toDisplayString(y.row[d.prop]??"-"),1))])]),_:2},1040,["prop","label","width","min-width","fixed","sortable","align","class-name"]))),128)),V.value.show?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:2,label:V.value.label||"操作",width:V.value.width,fixed:V.value.fixed??"right",align:V.value.align||"center"},{default:e.withCtx(({row:d})=>[e.renderSlot(g.$slots,"action-before",{row:d}),V.value.showView&&e.unref(f).authPass(V.value.viewAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:"primary",link:"",size:t.size,onClick:y=>g.$emit("view",d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value.viewText||"查看"),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),V.value.showEdit&&e.unref(f).authPass(V.value.editAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:1,type:"primary",link:"",size:t.size,onClick:y=>lt(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value.editText||"编辑"),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),V.value.showDelete&&e.unref(f).authPass(V.value.deleteAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:2,type:"danger",link:"",size:t.size,onClick:y=>nt(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value.deleteText||"删除"),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value.customButtons||[],y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.code},[(!y.show||y.show(d))&&e.unref(f).authPass(y.auth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:y.type||"default",link:"",size:t.size,onClick:mt=>y.handler(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.text),1)]),_:2},1032,["type","size","onClick"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(g.$slots,"action",{row:d})]),_:3},8,["label","width","fixed","align"])):e.createCommentVNode("",!0)]),_:3},16,["data","loading","size","stripe","border","height","max-height","highlight-current-row","row-key"])],4),e.unref(S)?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(e.unref(l.ElPagination),{"current-page":e.unref(k).current,"onUpdate:currentPage":C[7]||(C[7]=d=>e.unref(k).current=d),"page-size":e.unref(k).pageSize,"onUpdate:pageSize":C[8]||(C[8]=d=>e.unref(k).pageSize=d),"page-sizes":e.unref(O),total:e.unref(k).total,layout:e.unref(j),background:e.unref(Ie),size:t.size,onCurrentChange:tt,onSizeChange:at},null,8,["current-page","page-size","page-sizes","total","layout","background","size"])])):e.createCommentVNode("",!0),e.createVNode(Ne,{visible:T.value.visible,"drawer-mode":T.value.drawerMode,"is-editing":T.value.isEditing,"editing-row":T.value.editingRow,"form-data":T.value.formData,"drawer-cfg":T.value.drawerCfg,size:t.size,saving:T.value.saving,"onUpdate:visible":T.value.onVisibleChange,onSave:ct},e.createSlots({_:2},[e.renderList(["add-form","edit-form"],d=>({name:d,fn:e.withCtx(y=>[e.renderSlot(g.$slots,d,e.normalizeProps(e.guardReactiveProps(y)))])}))]),1032,["visible","drawer-mode","is-editing","editing-row","form-data","drawer-cfg","size","saving","onUpdate:visible"]),e.createVNode(e.unref(l.ElDialog),{modelValue:H.value,"onUpdate:modelValue":C[11]||(C[11]=d=>H.value=d),title:"列设置",width:"400px","close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:C[10]||(C[10]=d=>H.value=!1)},{default:e.withCtx(()=>[...C[12]||(C[12]=[e.createTextVNode("关闭",-1)])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createVNode(e.unref(l.ElCheckboxGroup),{modelValue:e.unref(q),"onUpdate:modelValue":C[9]||(C[9]=d=>e.isRef(q)?q.value=d:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ge),d=>(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:d.prop,value:d.prop,label:d.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])],2))}});L.install=t=>{t.component(L.name??"EeFormTable",L)};const Re=[U,R,A,I,L];function v(t){Re.forEach(r=>{t.use(r)})}const Ae={install:v};E.EeDictSelect=U,E.EeFormDialog=I,E.EeFormTable=L,E.EeSearchBar=A,E.EeStatusTag=R,E.default=Ae,E.install=v,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ee-search-bar[data-v-
|
|
1
|
+
.ee-search-bar[data-v-b65c74a4]{margin-bottom:16px}.ee-search-bar .el-form-item[data-v-b65c74a4]{margin-bottom:0}.ee-form-dialog-footer[data-v-560e642c]{display:flex;justify-content:flex-end;gap:12px}.ee-form-table{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:4px}.ee-search-area{padding:16px 16px 0;border-bottom:1px solid #ebeef5}.ee-search-area .el-form-item{margin-bottom:16px}.ee-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;flex-shrink:0}.ee-toolbar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ee-toolbar-right{display:flex;align-items:center;gap:8px}.ee-table-wrapper{flex:1;overflow:auto;padding:0 16px}.ee-table-wrapper .el-table{width:100%}.ee-pagination{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid #ebeef5;flex-shrink:0}.ee-size--small{font-size:13px}.ee-size--large{font-size:16px}
|
|
@@ -5,6 +5,7 @@ type __VLS_Props = {
|
|
|
5
5
|
request?: () => Promise<DictOption[]>;
|
|
6
6
|
valueField?: string;
|
|
7
7
|
labelField?: string;
|
|
8
|
+
size?: 'large' | 'default' | 'small';
|
|
8
9
|
};
|
|
9
10
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
11
|
"update:modelValue": (val: string | number | unknown[]) => any;
|
|
@@ -21,5 +22,6 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
21
22
|
}>, {
|
|
22
23
|
valueField: string;
|
|
23
24
|
labelField: string;
|
|
25
|
+
size: "large" | "default" | "small";
|
|
24
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
27
|
export default _default;
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
width?: string | number;
|
|
9
9
|
labelWidth?: string | number;
|
|
10
10
|
loading?: boolean;
|
|
11
|
+
size?: 'large' | 'default' | 'small';
|
|
11
12
|
};
|
|
12
13
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
13
14
|
"update:modelValue": (val: boolean) => any;
|
|
@@ -19,6 +20,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
19
20
|
onCancel?: (() => any) | undefined;
|
|
20
21
|
}>, {
|
|
21
22
|
width: string | number;
|
|
23
|
+
size: "large" | "default" | "small";
|
|
22
24
|
loading: boolean;
|
|
23
25
|
labelWidth: string | number;
|
|
24
26
|
title: string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DrawerConfig } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
drawerMode: string;
|
|
5
|
+
isEditing: boolean;
|
|
6
|
+
editingRow: Record<string, unknown> | null;
|
|
7
|
+
formData: Record<string, unknown>;
|
|
8
|
+
drawerCfg: DrawerConfig;
|
|
9
|
+
size?: 'large' | 'default' | 'small';
|
|
10
|
+
saving: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare function __VLS_template(): {
|
|
13
|
+
attrs: Partial<{}>;
|
|
14
|
+
slots: Partial<Record<NonNullable<"edit-form" | "add-form">, (_: {
|
|
15
|
+
row: Record<string, unknown> | null;
|
|
16
|
+
formData: Record<string, unknown>;
|
|
17
|
+
}) => any>> & Partial<Record<NonNullable<"edit-form" | "add-form">, (_: {
|
|
18
|
+
row: Record<string, unknown> | null;
|
|
19
|
+
formData: Record<string, unknown>;
|
|
20
|
+
}) => any>>;
|
|
21
|
+
refs: {};
|
|
22
|
+
rootEl: any;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
25
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
26
|
+
"update:visible": (value: boolean) => any;
|
|
27
|
+
save: () => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
onSave?: (() => any) | undefined;
|
|
31
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DictOption } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
showSearch: boolean;
|
|
4
|
+
searchParams: Record<string, unknown>;
|
|
5
|
+
visibleSearchFields: any[];
|
|
6
|
+
searchCols: number;
|
|
7
|
+
actionColSpan: number;
|
|
8
|
+
showFoldBtn: boolean;
|
|
9
|
+
searchExpanded: boolean;
|
|
10
|
+
size?: 'large' | 'default' | 'small';
|
|
11
|
+
resolveDict: (options?: DictOption[], dictKey?: string) => DictOption[];
|
|
12
|
+
};
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: {
|
|
16
|
+
'search-action'?(_: {
|
|
17
|
+
params: Record<string, unknown>;
|
|
18
|
+
}): any;
|
|
19
|
+
};
|
|
20
|
+
refs: {};
|
|
21
|
+
rootEl: any;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
25
|
+
search: () => any;
|
|
26
|
+
reset: () => any;
|
|
27
|
+
"toggle-fold": () => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
onSearch?: (() => any) | undefined;
|
|
30
|
+
onReset?: (() => any) | undefined;
|
|
31
|
+
"onToggle-fold"?: (() => any) | undefined;
|
|
32
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ToolbarConfig } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
show: boolean;
|
|
4
|
+
toolbarCfg: ToolbarConfig;
|
|
5
|
+
size?: 'large' | 'default' | 'small';
|
|
6
|
+
deps: {
|
|
7
|
+
authPass: (auth?: string) => boolean;
|
|
8
|
+
selectionCount: number;
|
|
9
|
+
showColumnSetting: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare function __VLS_template(): {
|
|
13
|
+
attrs: Partial<{}>;
|
|
14
|
+
slots: {
|
|
15
|
+
'toolbar-right'?(_: {}): any;
|
|
16
|
+
};
|
|
17
|
+
refs: {};
|
|
18
|
+
rootEl: any;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
+
add: () => any;
|
|
23
|
+
"batch-delete": () => any;
|
|
24
|
+
import: () => any;
|
|
25
|
+
export: () => any;
|
|
26
|
+
refresh: () => any;
|
|
27
|
+
"column-setting": () => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
onAdd?: (() => any) | undefined;
|
|
30
|
+
"onBatch-delete"?: (() => any) | undefined;
|
|
31
|
+
onImport?: (() => any) | undefined;
|
|
32
|
+
onExport?: (() => any) | undefined;
|
|
33
|
+
onRefresh?: (() => any) | undefined;
|
|
34
|
+
"onColumn-setting"?: (() => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SearchConfig, PaginationConfig, ActionConfig, ToolbarConfig, DrawerConfig, TableColumn } from '../types';
|
|
2
|
+
/** 默认行唯一标识字段名 */
|
|
3
|
+
export declare const DEFAULT_ROW_KEY = "id";
|
|
4
|
+
/** 空数据提示文字 */
|
|
5
|
+
export declare const DEFAULT_EMPTY_TEXT = "\u6682\u65E0\u6570\u636E";
|
|
6
|
+
/** 每页条数选项 */
|
|
7
|
+
export declare const DEFAULT_PAGE_SIZES: number[];
|
|
8
|
+
/** 分页布局字符串 */
|
|
9
|
+
export declare const DEFAULT_PAGINATION_LAYOUT = "total, sizes, prev, pager, next, jumper";
|
|
10
|
+
/** 搜索区域默认配置 */
|
|
11
|
+
export declare const DEFAULT_SEARCH_CONFIG: SearchConfig;
|
|
12
|
+
/** 搜索区域隐藏时的空配置 */
|
|
13
|
+
export declare const SEARCH_CONFIG_HIDDEN: SearchConfig;
|
|
14
|
+
/** 分页默认配置 */
|
|
15
|
+
export declare const DEFAULT_PAGINATION_CONFIG: PaginationConfig;
|
|
16
|
+
/** 分页隐藏时的空配置 */
|
|
17
|
+
export declare const PAGINATION_CONFIG_HIDDEN: PaginationConfig;
|
|
18
|
+
/** 操作列默认配置 */
|
|
19
|
+
export declare const DEFAULT_ACTION_CONFIG: ActionConfig;
|
|
20
|
+
/** 操作列隐藏时的空配置 */
|
|
21
|
+
export declare const ACTION_CONFIG_HIDDEN: ActionConfig;
|
|
22
|
+
/** 工具栏默认配置 */
|
|
23
|
+
export declare const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig;
|
|
24
|
+
/** 工具栏隐藏时的空配置 */
|
|
25
|
+
export declare const TOOLBAR_CONFIG_HIDDEN: ToolbarConfig;
|
|
26
|
+
/** 表单抽屉/弹窗默认配置 */
|
|
27
|
+
export declare const DEFAULT_DRAWER_CONFIG: DrawerConfig;
|
|
28
|
+
/** el-table 透传时需要跳过的属性名列表 */
|
|
29
|
+
export declare const OMIT_TABLE_ATTRS: string[];
|
|
30
|
+
/** el-table-column 透传时需要跳过的属性名列表 */
|
|
31
|
+
export declare const OMIT_COLUMN_ATTRS: (keyof TableColumn)[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* @param props.authChecker - 外部传入的权限判断函数,接收 auth 标识返回 boolean
|
|
4
|
+
* @param props.authMode - 权限不足时的处理模式:hide 隐藏 / disabled 禁用
|
|
5
|
+
* @returns authPass - 判断指定 auth 是否有权限的函数
|
|
6
|
+
* @returns authEnabled - 是否启用了权限检查
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAuth(props: {
|
|
9
|
+
authChecker?: (auth: string) => boolean;
|
|
10
|
+
authMode?: 'hide' | 'disabled';
|
|
11
|
+
}): {
|
|
12
|
+
authPass: (auth?: string) => boolean;
|
|
13
|
+
authEnabled: ComputedRef<boolean>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { CrudConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.crudConfig - CRUD 接口配置(list/add/edit/delete/batchDelete)
|
|
5
|
+
* @param props.rowKey - 数据行唯一标识字段名,默认为 id
|
|
6
|
+
* @param deps.searchParams - 搜索参数字典(响应式对象)
|
|
7
|
+
* @param deps.getActiveSearchParams - 获取当前有效的搜索参数
|
|
8
|
+
* @param deps.pageState - 分页状态(current / pageSize / total)
|
|
9
|
+
* @param deps.resetPage - 重置到第一页的函数
|
|
10
|
+
* @param deps.setTotal - 设置总记录数的函数
|
|
11
|
+
* @param deps.selection - 选中的行数据列表(Ref)
|
|
12
|
+
* @param deps.emit - 对外触发事件的函数
|
|
13
|
+
*/
|
|
14
|
+
export declare function useCrud(props: {
|
|
15
|
+
crudConfig?: CrudConfig;
|
|
16
|
+
rowKey?: string;
|
|
17
|
+
}, deps: {
|
|
18
|
+
searchParams: Record<string, unknown>;
|
|
19
|
+
getActiveSearchParams: () => Record<string, unknown>;
|
|
20
|
+
pageState: {
|
|
21
|
+
current: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
total: number;
|
|
24
|
+
};
|
|
25
|
+
resetPage: () => void;
|
|
26
|
+
setTotal: (total: number) => void;
|
|
27
|
+
selection: Ref<Record<string, unknown>[]>;
|
|
28
|
+
emit: (event: string, ...args: unknown[]) => void;
|
|
29
|
+
}): {
|
|
30
|
+
internalData: Ref<Record<string, unknown>[], Record<string, unknown>[]>;
|
|
31
|
+
loadingState: Ref<boolean, boolean>;
|
|
32
|
+
hasCrud: ComputedRef<boolean>;
|
|
33
|
+
fetchData: () => Promise<void>;
|
|
34
|
+
refreshTable: () => Promise<void>;
|
|
35
|
+
doDelete: (row: Record<string, unknown>) => Promise<void>;
|
|
36
|
+
handleDelete: (row: Record<string, unknown>, confirmDelete: boolean, confirmTitle?: string, confirmMessage?: string) => Promise<void>;
|
|
37
|
+
doBatchDelete: (ids: (string | number)[]) => Promise<void>;
|
|
38
|
+
handleBatchDelete: () => Promise<void>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DictOption } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* @param props.dictMap - 字典映射表,如 { statusDict: [{ value: 1, label: '启用' }, ...] }
|
|
4
|
+
* @returns resolvedDict - 合并内联 options 和字典映射的解析函数
|
|
5
|
+
* @returns dictLabel - 根据字段值和字典 key 获取显示文本
|
|
6
|
+
*/
|
|
7
|
+
export declare function useDict(props: {
|
|
8
|
+
dictMap?: Record<string, DictOption[]>;
|
|
9
|
+
}): {
|
|
10
|
+
resolvedDict: (options?: DictOption[], dictKey?: string) => DictOption[];
|
|
11
|
+
dictLabel: (dictKey: string | undefined, value: unknown) => string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { ExportConfig, TableColumn } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.exportConfig - 导出配置(模式、文件名、忽略列等)
|
|
5
|
+
* @param props.columns - 原始列配置(用于字典映射)
|
|
6
|
+
* @param deps.visibleColumns - 当前可见列列表
|
|
7
|
+
* @param deps.getActiveSearchParams - 获取当前搜索参数
|
|
8
|
+
* @param deps.dictLabel - 字典值转文本函数
|
|
9
|
+
* @param deps.setLoading - 设置加载状态
|
|
10
|
+
* @param deps.getCurrentData - 获取当前数据列表的函数
|
|
11
|
+
*/
|
|
12
|
+
export declare function useExport(props: {
|
|
13
|
+
exportConfig?: ExportConfig;
|
|
14
|
+
columns: TableColumn[];
|
|
15
|
+
crudConfig?: {
|
|
16
|
+
api?: {
|
|
17
|
+
list?: Function;
|
|
18
|
+
};
|
|
19
|
+
baseParams?: Record<string, unknown>;
|
|
20
|
+
} | null;
|
|
21
|
+
}, deps: {
|
|
22
|
+
visibleColumns: ComputedRef<TableColumn[]>;
|
|
23
|
+
getActiveSearchParams: () => Record<string, unknown>;
|
|
24
|
+
dictLabel: (dictKey: string | undefined, value: unknown) => string;
|
|
25
|
+
internalData: ComputedRef<Record<string, unknown>[]> | Ref<Record<string, unknown>[]> | Record<string, unknown>[];
|
|
26
|
+
fetchData: () => Promise<void>;
|
|
27
|
+
setLoading: (v: boolean) => void;
|
|
28
|
+
getCurrentData: () => Record<string, unknown>[];
|
|
29
|
+
}): {
|
|
30
|
+
handleExport: () => Promise<void>;
|
|
31
|
+
exporting: Ref<boolean, boolean>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import { DrawerConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.drawerConfig - 抽屉/弹窗的外观配置
|
|
5
|
+
* @param props.rowKey - 数据行的唯一键(用于编辑时取 ID)
|
|
6
|
+
* @returns formVisible - 表单是否显示
|
|
7
|
+
* @returns isEditing - 是否为编辑模式(false 为新增)
|
|
8
|
+
* @returns editingRow - 当前编辑的行数据(新增时为 null)
|
|
9
|
+
* @returns formData - 表单绑定的数据对象
|
|
10
|
+
* @returns saving - 是否正在保存(加载状态)
|
|
11
|
+
* @returns drawerMode - 展示模式:drawer / dialog
|
|
12
|
+
* @returns drawerCfg - 合并默认值后的配置
|
|
13
|
+
* @returns openAdd - 打开新增表单
|
|
14
|
+
* @returns openEdit - 打开编辑表单
|
|
15
|
+
* @returns closeForm - 关闭表单
|
|
16
|
+
*/
|
|
17
|
+
export declare function useForm(props: {
|
|
18
|
+
drawerConfig?: DrawerConfig;
|
|
19
|
+
rowKey?: string;
|
|
20
|
+
}): {
|
|
21
|
+
formVisible: ReturnType<typeof ref<boolean>>;
|
|
22
|
+
isEditing: ReturnType<typeof ref<boolean>>;
|
|
23
|
+
editingRow: ReturnType<typeof ref<Record<string, unknown> | null>>;
|
|
24
|
+
formData: ReturnType<typeof ref<Record<string, unknown>>>;
|
|
25
|
+
saving: ReturnType<typeof ref<boolean>>;
|
|
26
|
+
drawerMode: string;
|
|
27
|
+
drawerCfg: DrawerConfig;
|
|
28
|
+
openAdd: () => void;
|
|
29
|
+
openEdit: (row: Record<string, unknown>) => void;
|
|
30
|
+
closeForm: () => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { PaginationConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.pagination - 分页配置(boolean 或 PaginationConfig 对象)
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePagination(props: {
|
|
7
|
+
pagination?: PaginationConfig | boolean;
|
|
8
|
+
}): {
|
|
9
|
+
pageState: {
|
|
10
|
+
current: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
total: number;
|
|
13
|
+
};
|
|
14
|
+
paginationCfg: ComputedRef<PaginationConfig>;
|
|
15
|
+
showPagination: ComputedRef<boolean>;
|
|
16
|
+
pageSizesComputed: ComputedRef<number[]>;
|
|
17
|
+
paginationLayoutComputed: ComputedRef<string>;
|
|
18
|
+
paginationBgComputed: ComputedRef<boolean>;
|
|
19
|
+
setPage: (page: number) => void;
|
|
20
|
+
setPageSize: (size: number) => void;
|
|
21
|
+
resetPage: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { TableColumn, SearchConfig, ColumnSearchItem } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.columns - 表格列配置(从中提取 search.enable = true 的字段)
|
|
5
|
+
* @param props.searchConfig - 搜索区域配置(列数、折叠行数等)
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSearch(props: {
|
|
8
|
+
columns: TableColumn[];
|
|
9
|
+
searchConfig?: SearchConfig | boolean;
|
|
10
|
+
}): {
|
|
11
|
+
searchExpanded: import('vue').Ref<boolean, boolean>;
|
|
12
|
+
searchParams: Record<string, unknown>;
|
|
13
|
+
searchCfg: ComputedRef<SearchConfig>;
|
|
14
|
+
showSearch: ComputedRef<boolean | undefined>;
|
|
15
|
+
searchCols: ComputedRef<number>;
|
|
16
|
+
allSearchFields: ComputedRef<(ColumnSearchItem & {
|
|
17
|
+
prop: string;
|
|
18
|
+
label: string;
|
|
19
|
+
field: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
dictKey?: string;
|
|
22
|
+
props: Record<string, unknown>;
|
|
23
|
+
})[]>;
|
|
24
|
+
visibleSearchFields: ComputedRef<(ColumnSearchItem & {
|
|
25
|
+
prop: string;
|
|
26
|
+
label: string;
|
|
27
|
+
field: string;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
dictKey?: string;
|
|
30
|
+
props: Record<string, unknown>;
|
|
31
|
+
})[]>;
|
|
32
|
+
showFoldBtn: ComputedRef<boolean>;
|
|
33
|
+
actionColSpan: ComputedRef<number>;
|
|
34
|
+
initSearchParams: () => void;
|
|
35
|
+
getDefaultSearchParams: () => Record<string, unknown>;
|
|
36
|
+
getActiveSearchParams: () => Record<string, unknown>;
|
|
37
|
+
resetSearchParams: () => void;
|
|
38
|
+
toggleFold: () => void;
|
|
39
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { TableColumn, SelectionConfig, ColumnSettingConfig, AutoHeightConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.columns - 表格列配置
|
|
5
|
+
* @param props.selectionConfig - 选择列配置
|
|
6
|
+
* @param props.columnSetting - 列设置配置
|
|
7
|
+
* @param props.rowKey - 数据行唯一标识字段名
|
|
8
|
+
* @param props.tableHeight - 固定表格高度
|
|
9
|
+
* @param props.tableMaxHeight - 表格最大高度
|
|
10
|
+
* @param props.autoHeight - 自适应高度配置
|
|
11
|
+
* @param deps.authPass - 权限判断函数(用于按权限过滤列)
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTable(props: {
|
|
14
|
+
columns: TableColumn[];
|
|
15
|
+
data?: Record<string, unknown>[];
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
selectionConfig?: SelectionConfig;
|
|
18
|
+
columnSetting?: ColumnSettingConfig;
|
|
19
|
+
rowKey?: string;
|
|
20
|
+
tableHeight?: string | number;
|
|
21
|
+
tableMaxHeight?: string | number;
|
|
22
|
+
autoHeight?: AutoHeightConfig | boolean;
|
|
23
|
+
stripe?: boolean;
|
|
24
|
+
border?: boolean;
|
|
25
|
+
highlightCurrentRow?: boolean;
|
|
26
|
+
size?: string;
|
|
27
|
+
}, deps: {
|
|
28
|
+
authPass: (auth?: string) => boolean;
|
|
29
|
+
}): {
|
|
30
|
+
tableRef: import('vue').Ref<any, any>;
|
|
31
|
+
selection: import('vue').Ref<Record<string, unknown>[], Record<string, unknown>[]>;
|
|
32
|
+
singleSelection: import('vue').Ref<string | number | null, string | number | null>;
|
|
33
|
+
columnSettingVisible: import('vue').Ref<boolean, boolean>;
|
|
34
|
+
checkedColumns: import('vue').Ref<string[], string[]>;
|
|
35
|
+
selectionCfg: ComputedRef<SelectionConfig>;
|
|
36
|
+
columnSettingCfg: ComputedRef<ColumnSettingConfig>;
|
|
37
|
+
showColumnSetting: ComputedRef<boolean | undefined>;
|
|
38
|
+
allColumns: ComputedRef<TableColumn[]>;
|
|
39
|
+
visibleColumns: ComputedRef<TableColumn[]>;
|
|
40
|
+
tableComputedHeight: ComputedRef<string | number | undefined>;
|
|
41
|
+
tableMaxHeightProp: ComputedRef<string | number | undefined>;
|
|
42
|
+
tableWrapperStyle: ComputedRef<{
|
|
43
|
+
minHeight: string;
|
|
44
|
+
} | {
|
|
45
|
+
minHeight?: undefined;
|
|
46
|
+
}>;
|
|
47
|
+
handleSelectionChange: (val: Record<string, unknown>[]) => void;
|
|
48
|
+
handleSingleSelect: (row: Record<string, unknown>) => void;
|
|
49
|
+
};
|