cc1-form 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(F,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("element-plus"),require("vue-router"),require("vue"),require("cc1-vue3")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue","cc1-vue3"],p):(F=typeof globalThis<"u"?globalThis:F||self,p(F.cc1Form={},F.ElementPlus,F.VueRouter,F.Vue,F.cc1Vue3))})(this,(function(F,p,Xt,e,J){"use strict";class w{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(o,...r)=>Array.isArray(o)?o.some(n=>typeof n=="function"?n(...r):n):typeof o=="function"?o(...r):o;static getRouterParams=()=>{const o=this.router.currentRoute.value.query||{},r=this.router.currentRoute.value.params||{};return Object.keys(o).length?o:Object.keys(r).length?r:{}};static moduleObj={};static loadModule=async o=>{if(!w.moduleObj[o])throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);const r=await w.moduleObj[o]();return r.default??r};static tipMessages={};static tipMessagesGap=500;static showMessage(o,r,n={}){const i=Date.now();if(!this.tipMessages[o]||i-this.tipMessages[o]>this.tipMessagesGap){this.tipMessages[o]=i;const a=Object.assign({message:o,type:r},n);p.ElMessage(a),setTimeout(()=>{delete this.tipMessages[o]},this.tipMessagesGap)}}static fail=(o,r={})=>{this.showMessage(o,"error",r)};static success=(o,r={})=>{this.showMessage(o,"success",r)};static loadingObj=null;static loadingTimer=null;static loading=(o=!0,r="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{o?this.loadingObj=p.ElLoading.service({lock:!0,text:r,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(o,r=!0)=>{if(r){let n=screen.width/2-500,i=screen.height/2-800/2-30;window.open(o,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+i+", left="+n)}else window.open(o,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=o=>new Promise(async(r,n)=>{let i=document.getElementById(o.id);const a=await w.loadModule("html2canvas");try{a(i,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:o.windowWidth,height:o.windowHeight,windowWidth:o.windowWidth,windowHeight:o.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(l){let c=l.toDataURL("image/png");r(c)})}catch(l){n(l)}})}class x{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=o=>{x.config=ObjectUtil.deepMerge(x.config,o)}}class M{static customComponent={};static error={};static findOptions=(o,r)=>{const n=o.column.find(a=>a.key===r),i=a=>a.replace(/-([a-z])/g,(l,c)=>c.toUpperCase());if(n)return n.options[i(n.type)]};static setOptionsData=(o,r,n)=>{const i=M.findOptions(o,r);i&&(i.data=n)};static form={openBefore:{parentId:(o,r,n,i)=>{const a=x.config.table.rowKey;o?r.type===w.EDialog.Add?(r.form.parentId=o[a],r.form.sort=o.children.length+1):r.form.parentId=o.parentId.substring(o.parentId.lastIndexOf(",")+1):(r.form.parentId="0",r.form.sort=n.length+1),M.setOptionsData(i,"parentId",[{[a]:"0",title:"根",children:n}])}}}}class R{static getIdFun=()=>StrUtil.uuid();static setId=(o,r,n)=>{r[o]||(r[o]=[]);const i=x.config.table.rowKey;r[o].forEach(a=>{n.forEach(l=>{let c=l.default??"";l.type==="number"&&(c=l.default??0),l.type==="boolean"&&(c=l.default??!1),l.type==="time"&&(c=l.default??new Date),a[l.value]===void 0&&(a[l.value]=c)}),a[i]||(a[i]=R.getIdFun())})};static add=(o,r,n,i)=>{const a=JSONUtil.cp(n);R.setId(o,r,n);const l=x.config.table.rowKey;r[o].push(a.reduce((c,f)=>{let s=f.default??"";return f.type==="number"&&(s=f.default??0),f.type==="boolean"&&(s=f.default??!1),f.type==="time"&&(s=f.default??new Date),c[f.value]=s,c},{[l]:R.getIdFun()})),i?.(r)};static remove=(o,r,n,i)=>{const a=x.config.table.rowKey;r[o]=r[o].filter(l=>l[a]!==n[a]),i?.(r)};static getNoIdData=(o,r)=>{const n=JSONUtil.cp(o),i=x.config.table.rowKey;return n.forEach(a=>{a[i]&&delete a[i],r&&a[r]&&R.getNoIdData(a[r],r)}),n}}const be={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},ke={key:0},we={class:"row items-center",style:{gap:"10px",width:"100%"}},Ce={key:1},Q=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:o}){const r=t,n=e.reactive({show:!1,add:(a,l,c)=>{R.add(a,l,c,()=>{i("change")})},remove:(a,l,c)=>{R.remove(a,l,c,()=>{i("change")})}});e.onMounted(()=>{R.setId(r.field,r.row,r.itemFields),n.show=!0});const i=o;return(a,l)=>{const c=e.resolveComponent("el-button"),f=e.resolveComponent("el-input");return n.show?(e.openBlock(),e.createElementBlock("div",be,[e.renderSlot(a.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(c,{link:"",type:"primary",onClick:l[0]||(l[0]=s=>n.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],s=>(e.openBlock(),e.createElementBlock("div",we,[e.renderSlot(a.$slots,"item-start",{item:s,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,d=>(e.openBlock(),e.createBlock(f,{modelValue:s[d.value],"onUpdate:modelValue":u=>s[d.value]=u,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:d[t.label]||d[t.value],onChange:l[1]||(l[1]=u=>i("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(a.$slots,"item-end",{item:s,row:t.row}),e.createVNode(c,{link:"",type:"danger",onClick:d=>n.remove(t.field,t.row,s)},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",Ce,[e.createVNode(c,{link:"",type:"primary",onClick:l[2]||(l[2]=s=>n.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),Be={class:"row form-item-content",style:{width:"100%"}},Ve={class:"col column form-item-content-item"},Ee={class:"col"},xe=["innerHTML"],Se=e.defineComponent({__name:"field",props:{item:{},form:{},type:{},labelWidth:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const o=t,r=e.ref(),n=()=>{const c=r.value?.validateState;return c&&typeof c=="object"&&"value"in c?c.value:c},i=async c=>{c&&(await e.nextTick(),await r.value?.validate?.("").catch(()=>{}))},a=(c,f)=>Array.isArray(c)?Promise.all(c.map(s=>typeof s=="function"?s(...f):s)):typeof c=="function"?c(...f):void 0,l=c=>{const f=o.getOn(c);return{...f,change:(...s)=>{const d=n()==="error",u=a(f.change,s);return Promise.resolve(u).then(()=>i(d),()=>i(d)).catch(()=>{}),u}}};return(c,f)=>(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{ref_key:"formItemRef",ref:r,label:t.item.text?.form?.label??t.item.label,prop:t.item.key,"label-width":t.item.text?.form?.label==""?0:t.item.form?.labelWidth||t.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",Be,[e.renderSlot(c.$slots,"form-"+t.item.key+"-start",{row:t.form,item:t.item}),e.createElementVNode("div",Ve,[e.createElementVNode("div",Ee,[e.renderSlot(c.$slots,"form-"+t.item.key,{row:t.form,item:t.item},()=>[t.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[0]||(f[0]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),e.createSlots({_:2},[t.getBind(t.item).prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.getBind(t.item).prepend=="function"?t.getBind(t.item).prepend(t.form):t.getBind(t.item).prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):t.item.type==="number"?(e.openBlock(),e.createBlock(e.unref(p.ElInputNumber),e.mergeProps({key:1,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[1]||(f[1]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:2,type:"textarea",modelValue:t.form[t.item.key],"onUpdate:modelValue":f[2]||(f[2]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:3,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[3]||(f[3]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:4,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[4]||(f[4]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(l(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(p.ElRadioGroup),e.mergeProps({key:5,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[5]||(f[5]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[t.getBind(t.item).type==="group"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.getBind(t.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(p.ElRadioButton),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.getBind(t.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(p.ElRadio),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(p.ElCheckboxGroup),e.mergeProps({key:6,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[6]||(f[6]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(l(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[t.getBind(t.item).type==="group"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.getBind(t.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(p.ElCheckboxButton),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.getBind(t.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(p.ElCheckbox),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="color"?(e.openBlock(),e.createBlock(e.unref(p.ElColorPicker),e.mergeProps({key:7,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[7]||(f[7]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="slider"?(e.openBlock(),e.createBlock(e.unref(p.ElSlider),e.mergeProps({key:8,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[8]||(f[8]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="list"?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:9,row:t.form,field:t.item.key},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:10,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[9]||(f[9]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:11,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[10]||(f[10]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(l(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&typeof t.item.type=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.item.type),e.mergeProps({key:12,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[11]||(f[11]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&(e.unref(M).customComponent[t.item.type]||e.unref(M).customComponent[t.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[t.item.type]?.form||e.unref(M).customComponent[t.item.type]),e.mergeProps({key:13,modelValue:t.form[t.item.key],"onUpdate:modelValue":f[12]||(f[12]=s=>t.form[t.item.key]=s)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(c.$slots,"form-"+t.item.key+"-right",{row:t.form,item:t.item})]),e.renderSlot(c.$slots,"form-"+t.item.key+"-tip",{row:t.form,item:t.item},()=>[t.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.form?.tipText=="function"?t.item.form?.tipText(t.form,t.type):t.item.form?.tipText},null,8,xe)):e.createCommentVNode("",!0)])]),e.renderSlot(c.$slots,"form-"+t.item.key+"-end",{row:t.form,item:t.item})])]),_:3},8,["label","prop","label-width"]))}});function Yt(t){return t}const Ne={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"部分内容未输入或输入错误,请检查",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class k{static t(o,...r){if(typeof o=="function")return o(...r);o=String(o);let n=0;return o.replace(/{([^}]+)}/g,(i,a)=>n<r.length?String(r[n++]):`{${a}}`)}static setI18n=o=>{k.curd=ObjectUtil.deepMerge(k.curd,o)};static tCurd(o,...r){return this.t(this.curd[o],...r)}static curd=Ne}class T{static delAllKey=o=>{Object.keys(o).forEach(r=>{delete o[r]})};static setValue=(o,r,n=!1)=>{n&&T.delAllKey(o),Object.keys(r).forEach(i=>{o[i]!==r[i]&&(o[i]=r[i])})}}const G=t=>{const o=e.reactive({}),r=()=>typeof t=="function"?t():t,n=()=>{const i=r();return i??o};return{internal:o,isExternal:()=>r()!=null,get(){return n()},set(i){T.setValue(n(),i,!0)},merge(i){T.setValue(n(),i,!1)},clear(){T.delAllKey(n())}}},I=t=>{t.forEach(o=>{console.error({field:o.field||"",error:o.error||""})})},Fe=t=>t?typeof t=="string"?t:t instanceof Error?t.message:t.message||String(t):"",P=t=>!t||typeof t!="object"?[]:Object.keys(t).flatMap(o=>(Array.isArray(t[o])?t[o]:[t[o]]).map(n=>({field:n?.field||o,error:Fe(n)}))),W=w.EDialog,A=t=>typeof t.type=="object"?"component":t.type||"input",De=(t,o,r)=>{const n=G(()=>o.form),i=l=>X(l.update.formGrid||[],l.update.form,l.update.type,l.update.formMaxSpan).map(f=>f.item.key).filter(Boolean),a=async l=>{const c=r.ruleFormRef.value;if(!c)return!0;const f=i(l),s=Object.keys(l.update.rules||{}).filter(u=>!f.includes(u));if(s.length&&c.clearValidate(s),!f.length)return!0;if(!await c.validateField(f,async(u,m)=>{u||I(P(m))}))throw!1;return!0};return{update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:W.Update,get form(){return n.get()},set form(l){n.set(l)},formDefault:{},formColumn:[],formGrid:[],formMaxSpan:12,getDisabled:(l,c=!1)=>{const f=t();return o.option.table?.editMode&&c?l.disabled?.table===void 0?!1:w.isFun(l.disabled?.table,f.update.form):te(l,f.update.type,f.update.form)},getBind:l=>{const c=t();return oe(l,c.update.type)},getOn:(l,c)=>{const f=t();return ne(l,f.update.type,[c||f.update.form,l])},getOptions:l=>{const c=t();try{const s=ie(c.update.formGrid?.length?c.update.formGrid:c.update.formColumn).find(d=>d.item.key===l)?.item;return s?{options:s.options,bind:c.update.getBind(s)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:l=>{const c=t();if(o.option.form?.editAll)return l;const f={[o.option.table?.rowKey]:c.update.edit.data[o.option.table?.rowKey]};return Object.keys(c.update.edit.data).forEach(s=>{l[s]!==c.update.edit.data[s]&&(f[s]=l[s])}),f}},view:{},openLoading:!1,open:async(l,c)=>{const f=t();if(!(f.update.showContent||f.update.openLoading)){w.loading(!0),f.update.openLoading=!0;try{f.update.type=l;const s=l===W.Add;f.update.edit.data=s?void 0:JSONUtil.cp(c),f.update.title=k.tCurd(s?"add":l===W.View?"view":"edit");const d=s?ObjectUtil.deepMerge(JSONUtil.cp(f.update.formDefault),c?JSONUtil.cp(c):{}):JSONUtil.cp(c);T.setValue(f.update.form,d,!0),await f.initApiData("update"),await o.option.form?.openBefore?.(f.update.form,f.update),(!o.option.table?.inlineEdit||s)&&(f.update.show=!0,f.update.showContent=!0),o.option.form?.openAfter?.(f.update.form,f.update)}catch(s){console.error(s)}finally{w.loading(!1),f.update.openLoading=!1}}},validate:async(l=!0)=>{const c=t();try{const f=o.option.table?.editMode?c.tableEditValidate.validate():a(c);return await Promise.all([f,c.formRef.validate()]),!0}catch{return l&&w.fail(k.tCurd("checkFormData")),!1}},submit:async()=>{const l=t();if(!await l.update.validate()||l.update.loading)return;l.update.loading=!0;const f=l.update.type===W.Add?o.option.api.create:o.option.api.update;try{await o.option.form?.submitBefore?.(l.update.form,l.update)}catch{l.update.loading=!1;return}let s=ObjectUtil.deepMerge(l.update.form,{});delete s.children;const d=new Set(o.option.column.filter(u=>u.type==="datetime").map(u=>u.key));Object.keys(s).forEach(u=>{if(d.has(u)&&s[u]!=null){const m=new Date(s[u]).getTime();isNaN(m)||(s[u]=m)}});try{if(!f)return;await f({...s}),l.update.close(),await l.table.getList(),o.option.form?.submitAfter?.(s,l.update)}catch(u){console.error(u)}finally{l.update.loading=!1}},close:()=>{const l=t();l.update.show=!1,l.update.edit.data=void 0,setTimeout(()=>{l.update.showContent=!1,r.ruleFormRef.value?.resetFields?.(),n.clear()},350)}}}},O=12,q=(t,o)=>{t.isForm=o,Array.isArray(t.children)&&t.children.forEach(r=>q(r,o))},ze=t=>t.isForm===!1?!1:typeof t.show?.form=="boolean"?t.show.form:!0,$e=(t,o,r)=>(t.form=t.form||{span:o},r==="column"?t.form.span=t.form.span??12:t.form.span=t.form.span??o,t.form.span),ee=t=>{const o=t.form;return o?.row!=null&&o.row>0?o.row:O},L=t=>Math.floor((t.gridRow-1)/O),te=(t,o,r)=>{if(o===w.EDialog.View)return t.disabled?.view===void 0?!0:w.isFun(t.disabled?.view,r);const n=t.disabled?.[o===w.EDialog.Add?"create":"update"];return w.isFun(n,r)},oe=(t,o)=>{const r=A(t);return t.options?.[o===w.EDialog.Add?"formAdd":"formUpdate"]?.[r]||t.options?.[r]||{}},ne=(t,o,r=[])=>{const n=A(t),a=t.options?.[o===w.EDialog.Add?"formAdd":"formUpdate"]?.[n]?.on||t.options?.[n]?.on||{},l={};return Object.keys(a).forEach(c=>{const f=a[c];typeof f=="function"?l[c]=function(...s){return f.apply(this,[...s,...r])}:l[c]=f}),l},ae=(t,o,r,n,i)=>{const a=t,l=a.colSpan??t.span;if(!t.item.form?.spanCol)return l;const c=i?.maxSpan||12,f=i?.defaultSpan||c/2,s=a.gridBand,u=o.filter(m=>s!=null?m.gridBand===s&&!w.isFun(m.item.show?.form,r,n):m.gridRow===a.gridRow&&!w.isFun(m.item.show?.form,r,n)).reduce((m,g)=>m+(g.colSpan??g.span??f),0);return l+u},Me=(t,o)=>{const r=(n,i)=>{const a=n.gridRow,l=n.gridRow+n.rowSpan-1,c=i.gridRow,f=i.gridRow+i.rowSpan-1;return a<=f&&c<=l};return t.map(n=>t.filter(a=>r(n,a)).length!==1||n.colSpan>=o?n:{...n,span:o,colSpan:o,gridColumn:1})},re=(t,o,r={})=>{const n=new Set,i=[];let a=0,l=0;const c=g=>Math.floor(g/O)*O,f=(g,y)=>`${g},${y}`,s=(g,y,B,S)=>{if(y+B>o)return!1;for(let V=0;V<S;V++)for(let E=0;E<B;E++)if(n.has(f(g+V,y+E)))return!1;return!0},d=(g,y,B,S)=>{for(let V=0;V<S;V++)for(let E=0;E<B;E++)n.add(f(g+V,y+E))},u=(g,y,B,S)=>{for(let E=c(g);E<500*O;E+=O){const K=E+O,Z=E===c(g)?Math.max(E,g):E;for(let U=Z;U<K;U++){const v=U===g?y:0;for(let j=v;j<=o-B;j++)if(s(U,j,B,S))return{tr:U,tc:j}}}return{tr:g,tc:y}},m=(g,y,B,S)=>{const V=c(g);if(S<O&&g+S<V+O){a=g+S,l=y;return}const E=y+B;if(E<o){l=E,a=V;return}l=0,a=V+O};return t.forEach(g=>{const y=g.colSpan??(g.span===0?o:g.span),B=g.rowSpan??ee(g.item);g.item.form?.rowBreak&&i.length&&(l=0,a=c(a)+O);let{tr:S,tc:V}=s(a,l,y,B)?{tr:a,tc:l}:u(a,l,y,B);s(S,V,y,B)||({tr:S,tc:V}=u(0,0,y,B)),d(S,V,y,B);const E=S+1;i.push({...g,span:y,colSpan:y,rowSpan:B,gridRow:E,gridColumn:V+1,gridBand:L({gridRow:E})}),m(S,V,y,B)}),r.fillSingleRows?Me(i,o):i},X=(t,o,r,n=O)=>{const i=t.filter(c=>w.isFun(c.item.show?.form,o,r)),a=new Map;t.forEach(c=>{const s=`${c.gridBand??L(c)}:${c.gridColumn}:${c.colSpan}`;a.has(s)||a.set(s,[]),a.get(s).push(c)});const l=new Map;return a.forEach(c=>{const f=c.reduce((m,g)=>m+g.rowSpan,0);if(!(c.length>1&&f===O&&c.every(m=>m.rowSpan<O)))return;const d=c.filter(m=>w.isFun(m.item.show?.form,o,r));if(d.length!==1)return;const u=d[0];l.set(u.item.key,{...u,rowSpan:O})}),re(i.map(c=>l.get(c.item.key)||c),n,{fillSingleRows:!0})},le=t=>{const o=new Map;return t.forEach(r=>{const n=r.gridBand??L(r);o.has(n)||o.set(n,[]),o.get(n).push(r)}),Array.from(o.keys()).sort((r,n)=>r-n).map(r=>o.get(r))},ie=t=>t?.length?Array.isArray(t[0])?t.flat():t:[],Oe=(t,o)=>{if(!ze(t)||!t.key)return null;const r=o.defaultSpan??(o.maxSpan||12)/2,n=$e(t,r,o.layout);return{item:t,span:n}},Re=(t,o={})=>{const r=[],n=i=>{if(i.children?.length){i.children.forEach(l=>n(l));return}const a=Oe(i,o);a&&r.push(a)};return t.forEach(i=>n(i)),r},de=(t,o={})=>{const r=o.maxSpan??12,n=o.defaultSpan??r/2,i=o.layout??"row",l=Re(t,{maxSpan:r,defaultSpan:n,layout:i});if(i==="column"){const c=[];let f=1;return l.forEach(s=>{const d=ee(s.item),u=r;c.push({...s,span:u,colSpan:u,rowSpan:d,gridRow:f,gridColumn:1,gridBand:L({gridRow:f})}),f+=d}),{cells:c,maxSpan:r}}return{cells:re(l,r),maxSpan:r}},Te=t=>t.map(o=>o.item?.show?.form),Ue=(t,o,r)=>{if(!t.rules)return;const n={required:!0,message:o(t),trigger:"blur"},i=A(t),a=t.options?.datetime?.type,l=i==="datetime"&&typeof a=="string"&&a.includes("range"),c=i==="select"&&!!t.options?.select?.multiple;(l||i==="checkbox"||c)&&(n.type="array",n.min=l?2:1);const f=typeof t.rules=="boolean"?[n]:t.rules;return r?f.map(s=>r(s)):f},ce=t=>(o,r)=>Ue(o,t,n=>{const i=l=>{if(!r||!Object.prototype.hasOwnProperty.call(r,o.key))return l;const c=r[o.key];return c===void 0?l:c},a=l=>{const c=i(l);return typeof n.transform=="function"?n.transform(c):c};if(n.validator){const l=n.validator;return{...n,transform:a,validator:(c,f,s)=>l(c,f,s,r)}}return{...n,transform:a}}),se=(t,o)=>{const r={input:k.tCurd("placeholderInput"),select:k.tCurd("placeholderSelect")},n=(r[A(t)||"input"]||r.input)+t.label;return(o||M.error.callback)?.(t.key,t)||n},fe=t=>ce(o=>se(o,t?.error)),Ae=(t,o,r)=>{const n={},i={},a=o?.maxSpan||12,l=o?.defaultSpan||a/2,c=fe(o);t.forEach(d=>q(d,!0)),Y(t,n,i,d=>c(d,r));const{cells:f,maxSpan:s}=de(t,{maxSpan:a,defaultSpan:l,layout:o?.layout});return{formDefault:n,rules:i,formGrid:f,formMaxSpan:s,formColumn:le(f)}},Y=(t,o,r,n)=>{const i=a=>{if(a.children?.length){a.children.forEach(l=>i(l));return}if(a.key){o[a.key]=a.value;const l=n(a);l&&(r[a.key]=l)}};t.forEach(i)},Le={class:"curd-form-cell-inner"},me=e.defineComponent({__name:"layout",props:{formGrid:{},maxSpan:{},form:{},type:{},stripe:{type:Boolean},labelWidth:{},formOption:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const o=w.isFun,r=t,n=e.computed(()=>X(r.formGrid,r.form,r.type,r.maxSpan)),i=e.computed(()=>{const m=Array.from(new Set(n.value.map(g=>g.gridBand??L(g)))).sort((g,y)=>g-y);return new Map(m.map((g,y)=>[g,y]))}),a=e.computed(()=>({gridTemplateColumns:`repeat(${r.maxSpan}, minmax(0, 1fr))`})),l=e.computed(()=>{let m=0;return n.value.forEach(g=>{const y=g.gridRow+g.rowSpan-1;y>m&&(m=y)}),m}),c=m=>m.gridRow+m.rowSpan-1>=l.value,f=m=>m.rowSpan>=O,s=m=>{const g=m.gridBand??L(m);return i.value.get(g)??g},d=m=>ae(m,n.value,r.form,r.type,{maxSpan:r.maxSpan,defaultSpan:r.formOption?.defaultSpan}),u=m=>{const g=d(m)||m.colSpan;return{gridRow:`${m.gridRow} / span ${m.rowSpan}`,gridColumn:`${m.gridColumn} / span ${g}`}};return(m,g)=>e.unref(o)(e.unref(Te)(t.formGrid),t.form,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(m.$slots,"form-start",{row:t.form}),e.createElementVNode("div",{class:e.normalizeClass(["curd-form-grid",{stripe:t.stripe!==!1}]),style:e.normalizeStyle(a.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y.item.key,class:e.normalizeClass(["curd-form-grid-cell",[t.stripe!==!1&&s(y)%2===0?"stripe-band-odd":"",y.gridColumn>1?"has-col-border":"",t.stripe!==!1&&c(y)?"is-last-row":"",f(y)?"is-row-span":"",`form-item-col-${y.item.key}`]]),style:e.normalizeStyle(u(y))},[e.createElementVNode("div",Le,[e.unref(o)(y.item.show?.form,t.form,t.type)?(e.openBlock(),e.createBlock(Se,{key:0,class:e.normalizeClass({"is-row-span-field":f(y)}),item:y.item,form:t.form,type:t.type,"label-width":t.labelWidth,"get-bind":t.getBind,"get-on":t.getOn,"get-disabled":t.getDisabled},e.createSlots({_:2},[e.renderList(m.$slots,(B,S)=>({name:S,fn:e.withCtx(V=>[e.renderSlot(m.$slots,S,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["class","item","form","type","label-width","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)])],6))),128))],6),e.renderSlot(m.$slots,"form-end",{row:t.form})],64)):e.createCommentVNode("",!0)}}),ge=e.defineComponent({__name:"column",props:{option:{default:()=>({form:{},column:[]})},type:{default:""},form:{default:void 0}},setup(t,{expose:o}){const r=w.EDialog,n=e.ref(),i=t;let a=G(i.form);const l=J.Scope.getConf("curdConf"),c="formRef-"+StrUtil.getId();e.onUnmounted(()=>{l?.formRef?.remove(c)});const f=e.reactive({rules:{},show:!0,formDefault:{},type:i.type||l?.update?.type||r.Add,formColumn:[],formGrid:[],formMaxSpan:12,get form(){return a.get()},set form(s){a.set(s)},getDisabled:s=>te(s,f.type,f.form),getBind:s=>oe(s,f.type),getOn:s=>ne(s,f.type,[f.form,s]),initColumnForm:()=>{const s=a,d=Ae(i.option.column,i.option.form,s.get());f.formDefault=d.formDefault,f.rules=d.rules,f.formGrid=d.formGrid,f.formMaxSpan=d.formMaxSpan,f.formColumn=d.formColumn,f.type===r.Add?s.isExternal()?s.merge(JSONUtil.cp(f.formDefault)):s.set(JSONUtil.cp(f.formDefault)):!s.isExternal()&&i.form&&s.set(JSONUtil.cp(i.form))}});return l?.formRef?.set(c,{validate:async s=>{const d=n.value;if(!d)return s?.(!0),!0;const u=X(f.formGrid||[],f.form,f.type,f.formMaxSpan).map(y=>y.item.key).filter(Boolean),m=Object.keys(f.rules||{}).filter(y=>!u.includes(y));if(m.length&&d.clearValidate(m),!u.length)return s?.(!0),!0;const g=await d.validateField(u,async(y,B)=>{y||I(P(B))});if(s?.(!!g),!g)throw!1;return!0}}),i.option.form?.initStart?.(f),f.initColumnForm(),i.option.form?.initEnd?.(f),e.watch(()=>i.form,s=>{a=G(s),f.initColumnForm()}),o({ref:n,conf:f}),(s,d)=>(e.openBlock(),e.createBlock(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:n,model:f.form,rules:f.rules},{default:e.withCtx(()=>[f.show?(e.openBlock(),e.createBlock(me,{key:0,"form-grid":f.formGrid,"max-span":f.formMaxSpan,form:f.form,type:f.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth||"100px","form-option":t.option.form,"get-bind":f.getBind,"get-on":f.getOn,"get-disabled":f.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(u,m)=>({name:m,fn:e.withCtx(g=>[e.renderSlot(s.$slots,m,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}}),He=t=>t?.value||t,je=t=>{const o=He(t);return o?.validate?new Promise((r,n)=>{let i=!1;const a=(l,c)=>{i||(i=!0,l===!1?(I(P(c)),n(!1)):r(!0))};try{const l=o.validate(a);l&&typeof l.then=="function"?l.then(c=>a(c)).catch(c=>{I(P(c?.fields||c)),n(c)}):(l!==void 0||o.validate.length===0)&&a(l)}catch(l){n(l)}}):Promise.resolve(!0)},Ie=()=>{const t=e.reactive({formRef:{map:{},set(o,r){t.formRef.map[o]=r},remove(o){delete t.formRef.map[o]},validate(){const o=Object.keys(t.formRef.map).map(r=>t.formRef.map[r]);return Promise.all(o.map(r=>je(r))).then(()=>!0)}},regFormRef(o,r,n){o?n?t.formRef.set(r,{validate:async i=>{try{i(await n())}catch{i(!1)}}}):t.formRef.set(r,o):t.formRef.remove(r)}});return t},Ke=(t,o)=>{const r=G(()=>o.searchForm);return{search:{column:{list:[]},get form(){return r.get()},set form(n){r.set(n)},formDefault:{},getPlaceholder:(n,i=k.tCurd("placeholderInput"))=>n.text?.search?.placeholder===void 0?`${i}${n.label}`:n.text?.search?.placeholder,getFormData:()=>{const n=t();let i={};o.option.column.forEach(l=>{(typeof l.show?.search=="function"?l.show?.search(n.search.form):l.show?.search)&&(i[l.key]=n.search.form[l.key])});const a=o.option.search?.before?.(i);return a&&(i=a),i},reset:()=>{const n=t(),i=n.search.formDefault;Object.keys(i).forEach(l=>{o.option.search?.resetMode==="none"?i[l]=void 0:i[l]=n.search.formDefault[l]});const a=ObjectUtil.deepMerge(i,{});T.setValue(n.search.form,a,!0),n.page.num=1,o.option.init!==!1&&n.table.getList()},submit:()=>{const n=t();n.page.num=1,n.table.getList()}}}},Ge=(t,o)=>({page:{num:1,total:0,layout:o.option.page?.layout||x.config.pagination.layout,showTools:o.option.page?.showTools||x.config.pagination.showTools,size:o.option.page?.size||x.config.pagination.size,sizeList:o.option.page?.sizeList||x.config.pagination.pageSizes,pagerCount:o.option.page?.pagerCount||x.config.pagination.pagerCount,getQuery:(r={})=>{const n=t();return{[x.config.field.page.size]:r.size||n.page.size,[x.config.field.page.num]:r.num||n.page.num,...n.search.getFormData()}}}}),Pe=(t,o,r)=>({table:{op:{width:(...n)=>n.filter(a=>a).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(n,i)=>{},all:()=>{const n=t();if(n.table.expand.isExpand)n.table.expand.rowKeys=[];else{const i=a=>{let l=[];return a.forEach(c=>{l.push(c[o.option.table.rowKey]),c.children?.length&&(l=l.concat(i(c.children)))}),l};n.table.expand.rowKeys=i(n.table.data)}n.table.expand.isExpand=!n.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const n=t(),i=!n.table.header.group.expand;n.table.header.group.expand=i;const a=l=>{l.forEach(c=>{c.table?.header?.group!==void 0&&(c.table.header.group=!i),c.table?.header?.groupKey!==void 0&&(c.table.header.show=i),Array.isArray(c.children)&&c.children.length&&a(c.children)})};a(n.table.column.list)}}},getList:async()=>{const n=t();n.table.loading=!0;const i=o.option.api.list,a=JSONUtil.cp(n.table.selection.list);try{await n.initApiData("init");let l={};if(n.table.sort.prop){const{props:y,order:B}=x.config.table.sort;l={[y.field]:n.table.sort.prop,[B.field]:n.table.sort.order}}const c=await i({...n.page.getQuery(),...l}),f=x.config.field.result,s=c.data||{[f.list]:c},d=(Array.isArray(s[f.list]),s[f.list]),u=ie(n.update.formGrid?.length?n.update.formGrid:n.update.formColumn),g=ObjectUtil.deepMerge({data:d},{}).data.map(y=>(Object.keys(y).forEach(S=>{const V=u.find(E=>E.item.key===S);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=E=>V.item.options[V.item.type].data?.find(K=>K.value==E[S])?.label||E[S]))}),y));n.table.data=o.option.data?await o.option.data(g,d):g,n.tableEditValidate?.clear?.(),n.page.total=s[f.total]||0,setTimeout(()=>{n.table.selection.setList(a)},20)}catch(l){console.error(l)}finally{n.table.loading=!1}},selection:{list:[],change:n=>{t().table.selection.list=n},setList:(n,i)=>{const a=t();a.table.selection.list=[];const l=r.tableRef.value;if(l?.clearSelection(),!l||!n?.length)return;const c=o.option.table?.rowKey,f=s=>{const d=u=>{for(const m of u){if(c!=null&&c!==""){if(m[c]===s[c])return m}else if(m===s)return m;if(Array.isArray(m.children)&&m.children.length){const g=d(m.children);if(g!==void 0)return g}}};return d(a.table.data)};n.forEach(s=>{const d=f(s);if(d)if(i){const u=()=>l.toggleRowSelection(d,!0,!1);i(s)!==!1&&u()}else l.toggleRowSelection(d,!0,!1)})}},sort:{prop:"",order:"",change:n=>{const i=t();x.config.table.sort.resetPage&&(i.page.num=1);const a=x.config.table.sort;if(a.change){a.change(n,i);return}i.table.sort.prop=n.prop,n.order===null?(i.table.sort.order="",i.table.sort.prop=""):i.table.sort.order=n.order==="ascending"?a.order.asc:a.order.desc,i.table.getList()}}}}),We=(t,o)=>{const r=e.reactive({}),n=new WeakMap;let i=0;const a=h=>{let b=n.get(h);return b||(i+=1,b=`fallback-${i}`,n.set(h,b)),b},l=h=>{const b=o.option.table?.rowKey,C=b?h[b]:void 0;return C!=null&&C!==""?String(C):a(h)},c=(h,b)=>`${l(h)}-${b.key}`,f=h=>se(h,o.option.form?.error),s=ce(f),d=()=>{Object.keys(r).forEach(h=>{delete r[h]})},u=(h,b)=>{delete r[c(h,b)]},m=(h,b)=>r[c(h,b)]||"",g=(h,b)=>h.message||f(b),y=h=>h==null||h===""||Array.isArray(h)&&h.length===0,B=h=>{if(typeof h=="number")return h;if(typeof h=="string"||Array.isArray(h))return h.length},S=(h,b)=>{if(h==="array")return Array.isArray(b);if(h==="integer")return typeof b=="number"&&Number.isInteger(b);if(h==="float")return typeof b=="number"&&!Number.isInteger(b);if(h==="number")return typeof b=="number"&&!Number.isNaN(b);if(h==="boolean")return typeof b=="boolean";if(h==="object")return b!==null&&typeof b=="object"&&!Array.isArray(b);if(h==="date")return b instanceof Date||!Number.isNaN(new Date(b).getTime());if(h==="email")return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(b));if(h==="url")try{return new URL(String(b)),!0}catch{return!1}return h==="string"?typeof b=="string":!0},V=(h,b,C)=>typeof h.validator!="function"?Promise.resolve(!0):new Promise(D=>{let z=!1;const N=$=>{if(!z){if(z=!0,$==null){D(!0);return}if($ instanceof Error){D($.message||g(h,C));return}if(Array.isArray($)){const _=$[0];D(_ instanceof Error?_.message:String(_||g(h,C)));return}D(String($))}};try{const $=h.validator(h,b,N);$&&typeof $.then=="function"?$.then(()=>N()).catch(N):$===!1?N(g(h,C)):typeof $=="string"||$ instanceof Error?N($):h.validator.length<3&&N()}catch($){N($)}}),E=async(h,b,C)=>{const D=typeof h.transform=="function"?h.transform(b):b,z=y(D);if(h.required&&z)return g(h,C);if(z&&!h.required)return!0;if(h.whitespace&&typeof D=="string"&&D.trim()===""||h.type&&!S(h.type,D)||Array.isArray(h.enum)&&!h.enum.includes(D)||h.pattern&&!new RegExp(h.pattern).test(String(D)))return g(h,C);const N=B(D);return h.len!==void 0&&N!==void 0&&N!==h.len||h.min!==void 0&&N!==void 0&&N<h.min||h.max!==void 0&&N!==void 0&&N>h.max?g(h,C):V(h,D,C)},K=h=>{const b=t();return!h.key||!b.table.column.show.list.includes(h.key)||h.table?.header?.groupKey!==void 0&&!h.table.header.show?!1:h.show?.table!==void 0?w.isFun(h.show?.table,b.table.data):!0},Z=(h,b)=>h.show?.form!==void 0?w.isFun(h.show.form,b,w.EDialog.Update):!0,U=()=>{const h=t(),b=[],C=D=>{D.forEach(z=>{if(K(z)){if(z.children?.length){C(z.children);return}b.push(z)}})};return C(h.table.column.list),b},v=async(h,b)=>{if(!Z(b,h))return u(h,b),!0;const C=s(b,h);if(!C)return!0;u(h,b);const D=Array.isArray(C)?C:[C];for(const z of D){const N=await E(z,h[b.key],b);if(N!==!0)return r[c(h,b)]=N,{field:b.key,error:N}}return!0},j=h=>{const b=[],C=D=>{D.forEach(z=>{b.push(z),Array.isArray(z.children)&&z.children.length&&C(z.children)})};return C(h),b};return{tableEditValidate:{errors:r,clear:d,clearField:u,getFieldError:m,validate:async()=>{if(d(),!o.option.table?.editMode)return!0;const h=t(),b=U(),C=j(h.table.data||[]),z=(await Promise.all(C.flatMap(N=>b.map($=>v(N,$))))).filter(N=>N!==!0);if(z.length)throw I(z),!1;return!0}}}};class ue{static exportToExcel=async(o,r,n)=>{if(!o||o.length===0)return;const i=await w.loadModule("xlsx"),a=o.map(f=>{const s={};return r.forEach(d=>{s[d.label]=f[d.key]}),s}),l=i.utils.json_to_sheet(a),c=i.utils.book_new();i.utils.book_append_sheet(c,l,"Sheet1"),n?typeof n=="function"&&(n=n()):n=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,i.writeFile(c,`${n}.xlsx`)}}const qe=(t,o)=>({export:{run:{start:async r=>{let i=await t().export.run[r]();const a=o.option.column,l=ObjectUtil.deepMerge({data:i,columns:a},{}),c=o.option.tools?.export||{};c.before?.(l),ue.exportToExcel(l.data,l.columns,c.fileName)},select:async()=>{const r=t();r.export.loading=!0;try{if(o.option.tools?.export?.select){await o.option.tools.export.select({...r.page.getQuery(),items:r.table.selection.list});return}if(r.table.selection.list.length===0)throw w.fail(k.tCurd("selectDataToExport")),new Error(k.tCurd("selectDataToExport"));return r.table.selection.list}catch(n){console.error(n)}finally{r.export.loading=!1}},page:async()=>{const r=t();r.export.loading=!0;try{if(o.option.tools?.export?.page){await o.option.tools.export.page({...r.page.getQuery()});return}if(r.table.data.length===0)throw w.fail(k.tCurd("noData")),new Error(k.tCurd("noData"));return r.table.data}catch(n){console.error(n)}finally{r.export.loading=!1}},all:async()=>{const r=t();r.export.loading=!0;try{if(o.option.tools?.export?.all){await o.option.tools.export.all({...r.page.getQuery()});return}const n=o.option.api.list,i=await n({...r.page.getQuery({size:999999,num:1})});return(i.data||{[x.config.field.result.list]:i})[x.config.field.result.list]}catch(n){console.error(n)}finally{r.export.loading=!1}}},loading:!1,click:r=>{const n=t();n.export.loading||n.export.run.start(r)}}}),Je=(t,o)=>({remove:{title:k.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{t().remove.show=!1},open:r=>{if(r.length===0){w.fail(k.tCurd("selectDataToDelete"));return}const n=t();n.remove.items=r,n.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{const r=t();r.remove.loading=!0;const n=o.option.api.delete;try{if(!n)return;await n({[o.option.table?.rowKey]:r.remove.items.map(i=>i[o.option.table?.rowKey]),items:r.remove.items}),w.success(k.tCurd("operationSuccess")),r.table.data.length<=1&&r.page.num>1&&(r.page.num-=1),r.remove.close(),await r.table.getList()}catch(i){console.error(i)}finally{r.remove.loading=!1}})}}}),Qe=(t,o,r)=>({apiDataMap:{},getColumnSpan:(n,i)=>{const a=t(),l=a.update.formGrid?.length?a.update.formGrid:i||[];return ae(n,l,a.update.form,a.update.type,{maxSpan:a.update.formMaxSpan||o.option.form?.maxSpan,defaultSpan:o.option.form?.defaultSpan||x.config.form.defaultSpan})},init:()=>{const n=t();n.initCurdConfig(),n.initColumnOptions(),n.initColumnForm()},initApiData:async n=>{const i=t(),a=[],l=c=>{if(c.children?.length){c.children.forEach(s=>l(s));return}const f=A(c);if(c.options?.[f]?.dataApi&&c.options?.[f]?.dataApiConfig?.[n]){if(i.apiDataMap[c.key]&&c.options?.[f]?.dataApiConfig?.once)return;const s=(async()=>{try{let d=await c.options?.[f]?.dataApi?.(i.update.form,i.update.type);if(d){const u=c.options?.[f]?.dataPath;!Array.isArray(d)&&u&&(d=ObjectUtil.getPathValue(d,u)),c.options[f].data=d,c.options.search[f].data=d,c.options.search[c.options.search.type??f]||(c.options.search[c.options.search.type??f]={}),c.options.search[c.options.search.type??f].data=d,c.options.formAdd[f].data=d,c.options.formUpdate[f].data=d,i.apiDataMap[c.key]=d}}catch{}})();a.push(s)}};return o.option.column.forEach(c=>l(c)),await Promise.all(a),!0},initCurdConfig:()=>{const n=ObjectUtil.deepMerge(x.config,{});n.table.emptyText=k.tCurd("noData"),o.option.size=o.option.size||{},n.table.size=o.option.size.table||n.size.table,n.form.size=o.option.size.form||n.size.form,n.size.search=o.option.size.search||n.size.search;const i=ObjectUtil.deepMerge(n,o.option||{});Object.keys(i).forEach(a=>{o.option[a]=i[a]})},initColumnOptions:()=>{const n=t();let i=JSONUtil.cp(x.config.columnConfig);i.options=ObjectUtil.deepMerge({switch:{activeText:k.tCurd("switchOn"),inactiveText:k.tCurd("switchOff")}},i.options);const a=l=>{const c=A(l);for(const s in i){if(s==="table"){if(l.table=ObjectUtil.deepMerge(i.table,l.table||{}),l.children){l.children.forEach(d=>a(d));return}}else s==="type"?l.type=l.type||i.type:l[s]=ObjectUtil.deepMerge(i[s],l[s]||{});l.options=l.options||{},l.options[c]=l.options[c]||{},l.options[c].size=o.option.size.form}["search","formAdd","formUpdate"].forEach(s=>{l.options[s]=ObjectUtil.deepMerge(l.options,l.options[s]||{}),s==="search"?o.option.size.search&&(l.options[s][c].size=o.option.size.search):o.option.size.form&&(l.options[s][c].size=o.option.size.form)}),l.table=ObjectUtil.deepMerge(l.table,l.options[c].table||{}),c==="switch"&&(l.options.switch.tableBeforeChange=async(s,d)=>{const u=l.options?.switch;try{u.tableConfig?.confirm&&await r.switchConfirmRef.value?.open({title:k.tCurd("confirmModify"),content:k.tCurd("confirmSwitchMessage")});try{if(!o.option.api.update&&!u.tableConfig?.api)return;const m=d[o.option.table?.rowKey];u.loadingMap||(u.loadingMap={}),u.loadingMap[m]||(u.loadingMap[m]={loading:!1}),u.loadingMap[m].loading=!0;const g=d[s]===u.activeValue?u.inactiveValue:u.activeValue,y=u.tableConfig?.api?u.tableConfig.api:o.option.api.update;if(!y)return;try{await y({...d,[s]:g},"switch")}catch{return!1}finally{u.loadingMap[m].loading=!1}return w.success(k.tCurd("operationSuccess")),u.tableConfig?.loadList&&(n.table.loading=!0,n.table.getList(),n.table.loading=!1),!0}catch(m){return console.error(m),!1}finally{n.table.loading=!1}}catch{return!1}}),c==="treeSelect"&&(l.options.treeSelect.rowKey=o.option.table?.rowKey,l.options.treeSelect.nodeKey=o.option.table?.rowKey)};o.option.column.forEach(a),o.option.table?.column?.forEach(a)},initColumnForm:()=>{const n=t(),i=o.option;n.update.formColumn=[],n.update.formGrid=[],n.update.formMaxSpan=12,n.table.column.show={list:[],listSource:[]};const a=o.option.form?.maxSpan||12,l=o.option.form?.defaultSpan||a/2,c=fe(o.option.form),f=m=>{if(m.children){n.table.column.show.list.push(m.key),m.children.forEach(g=>f(g));return}n.update.formDefault[m.key]=m.value,m.table?.table&&(m.show?.table&&n.table.column.show.list.push(m.key),n.table.column.show.listSource.push(m.key))};i.column.forEach(m=>{q(m,!0),f(m)}),o.option.table?.column?.forEach(m=>{q(m,!1),f(m)}),n.search.column.list=i.column.concat(i.table?.column||[]),n.table.column.list=n.search.column.list.filter(m=>m.table?.table),n.search.column.list.sort((m,g)=>m.sort?.search-g.sort?.search),n.table.column.list.sort((m,g)=>m.sort?.table-g.sort?.table),n.update.rules={},Y(i.column,n.update.formDefault,n.update.rules,m=>c(m,n.update.form)),i.table?.editMode&&Y(i.table?.column||[],n.update.formDefault,n.update.rules,m=>c(m,n.update.form));const s=de(i.column,{maxSpan:a,defaultSpan:l,layout:o.option.form?.layout});n.update.formGrid=s.cells,n.update.formMaxSpan=s.maxSpan,n.update.formColumn=le(s.cells);const d=o.option.search?.formDefault;d&&Object.keys(d).forEach(m=>{n.search.formDefault[m]=d[m]}),i.column.forEach(m=>{m.show?.search||(n.search.formDefault[m.key]=void 0)});const u=ObjectUtil.deepMerge(n.search.formDefault,{});T.setValue(n.search.form,u,!0)}}),Xe=t=>{const o=e.ref(),r=e.ref(),n=e.ref(),i={switchConfirmRef:o,ruleFormRef:r,tableRef:n},a=e.getCurrentInstance(),l=J.Scope.getConf("curdConf");let c;const f=u=>{u=u||c;let m=u,g=u;for(;m?.parentCurdConf;)g=m.parentCurdConf,m=m.parentCurdConf;return g},s=()=>c;c=e.reactive({parentCurdConf:l,getCurdConf:f,getRootCurdConf:f,...Ie(),option:t.option,...Ke(s,t),...Ge(s,t),...Pe(s,t,i),...We(s,t),...qe(s,t),...De(s,t,i),...Je(s,t),...Qe(s,t,i)}),c.init();const d=a?`curdRef-${a.uid}`:"";return l?.formRef&&d&&(l.formRef.set(d,{validate:async u=>{const m=await c.update.validate(!1);if(u?.(!!m),!m)throw!1;return!0}}),e.onUnmounted(()=>{l.formRef.remove(d)})),e.onMounted(()=>{t.option.init!==!1&&c.table.getList()}),J.Scope.setConf("curdConf",c),{conf:c,switchConfirmRef:o,ruleFormRef:r,tableRef:n}},Ye={class:"dialog-footer"},Ze=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:o}){const r=e.ref(!1),n=e.ref("确认修改"),i=e.ref("确认要修改状态吗?");let a=null,l=null;const c=d=>(d?.title&&(n.value=d.title),d?.content&&(i.value=d.content),r.value=!0,new Promise((u,m)=>{a=u,l=m})),f=()=>{r.value=!1,a?.(!0),a=null,l=null},s=()=>{r.value=!1,l?.(new Error("用户取消操作")),a=null,l=null};return o({open:c}),(d,u)=>{const m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(p.ElDialog),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=g=>r.value=g),title:n.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(m,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",Ye,[e.createVNode(e.unref(p.ElButton),{onClick:s},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:f},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(i.value),1)]),_:1},8,["modelValue","title"])}}}),ve=["innerHTML"],_e=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(t){const o=t,r=e.computed(()=>typeof o.content=="function"?o.content(o.value):o.content);return(n,i)=>typeof r.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:r.value},null,8,ve))}}),he=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(t){const o=t,r=e.computed({get:()=>o.conf.search.form?.[o.item?.key],set:n=>{o.item?.key!==void 0&&(o.conf.search.form[o.item.key]=n)}});return(n,i)=>e.unref(M).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[t.type??""]?.search),e.mergeProps({key:0,modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a)},t.item.options?.search?.[t.type??""],e.toHandlers(t.item.options?.search?.[t.type??""]?.on||{})),null,16,["modelValue"])):t.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=a=>r.value=a),placeholder:t.conf.search.getPlaceholder(t.item),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.input||t.item.options?.input,e.toHandlers(t.item.options?.search?.input?.on||t.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:r.value,"onUpdate:modelValue":i[2]||(i[2]=a=>r.value=a),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.switch||t.item.options?.switch,e.toHandlers(t.item.options?.search?.switch?.on||t.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:t.item.options?.switch?.activeValue,label:t.item.options?.switch?.activeText,value:t.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:t.item.options?.switch?.inactiveValue,label:t.item.options?.switch?.inactiveText,value:t.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:3,modelValue:r.value,"onUpdate:modelValue":i[3]||(i[3]=a=>r.value=a),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.select||t.item.options?.select,e.toHandlers(t.item.options?.search?.select?.on||t.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.search?.select?.data||t.item.options?.select?.data||[],a=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="radio"?(e.openBlock(),e.createBlock(e.unref(p.ElRadioGroup),e.mergeProps({key:4,modelValue:r.value,"onUpdate:modelValue":i[4]||(i[4]=a=>r.value=a),disabled:t.item.disabled?.search},t.item.options?.search?.radio||t.item.options?.radio,e.toHandlers(t.item.options?.search?.radio?.on||t.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.radio?.data,a=>(e.openBlock(),e.createBlock(e.unref(p.ElRadio),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:5,modelValue:r.value,"onUpdate:modelValue":i[5]||(i[5]=a=>r.value=a),disabled:t.item.disabled?.search},t.item.options?.search?.datetime||t.item.options?.datetime,e.toHandlers(t.item.options?.search?.datetime?.on||t.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):t.type&&e.unref(M).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[t.type]),e.mergeProps({key:6,modelValue:r.value,"onUpdate:modelValue":i[6]||(i[6]=a=>r.value=a)},t.item.options?.search?.[t.type]||t.item.options?.[t.type],e.toHandlers(t.item.options?.search?.[t.type]?.on||t.item.options?.[t.type]?.on||{}),{disabled:t.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),H=(t,o)=>{const r=t.__vccOpts||t;for(const[n,i]of o)r[n]=i;return r},et={},tt={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function ot(t,o){return e.openBlock(),e.createElementBlock("svg",tt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)])])}const nt=H(et,[["render",ot]]),at={},rt={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function lt(t,o){return e.openBlock(),e.createElementBlock("svg",rt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)])])}const it=H(at,[["render",lt]]),dt={},ct={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function st(t,o){return e.openBlock(),e.createElementBlock("svg",ct,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const ft=H(dt,[["render",st]]),mt={},gt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ut(t,o){return e.openBlock(),e.createElementBlock("svg",gt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const ht=H(mt,[["render",ut]]),pt={},yt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function bt(t,o){return e.openBlock(),e.createElementBlock("svg",yt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)])])}const kt=H(pt,[["render",bt]]),wt={},Ct={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Bt(t,o){return e.openBlock(),e.createElementBlock("svg",Ct,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)])])}const Vt=H(wt,[["render",Bt]]),Et={class:"row flex-center table-header-label inline"},xt={class:"table-header-tooltip"},St=["innerHTML"],Nt={key:1,class:"table-header-required"},Ft=["onClick"],Dt={key:0,class:"table-edit-form"},zt={key:1},$t=["onClick","innerHTML"],Mt=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const o=w.isFun,r=t,i=e.getCurrentInstance().type,a=c=>c===!0?!0:(Array.isArray(c)?c:c?[c]:[]).some(s=>s?.required===!0),l=c=>r.option.table?.editMode?a(c.rules)||a(r.conf.update.rules?.[c.key]):!1;return(c,f)=>{const s=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.key},[t.conf.table.column.show.list.includes(d.key)&&(d.show?.table===void 0||e.unref(o)(d.show?.table,t.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d.table?.header?.groupKey===void 0||d.table.header.show?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,prop:d.key,label:d.label},{ref_for:!0},d.table),{header:e.withCtx(()=>[e.renderSlot(c.$slots,"table-header-"+d.key,{item:d},()=>[e.createElementVNode("div",Et,[d.table?.header?.tooltip?(e.openBlock(),e.createBlock(s,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:d.table?.header?.tooltip},null,8,St)]),default:e.withCtx(()=>[e.createElementVNode("span",xt,[e.createVNode(ht)])]),_:2},1024)):e.createCommentVNode("",!0),l(d)?(e.openBlock(),e.createElementBlock("span",Nt,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(d.label)+" ",1),d.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:2,class:"table-header-plus",onClick:e.withModifiers(()=>{d.table.header.group=!d.table.header.group,t.columnList.forEach(u=>{u.table?.header?.groupKey===d.key&&(u.table.header.show=!d.table.header.group)})},["stop"])},[d.table.header.group?(e.openBlock(),e.createBlock(kt,{key:0})):(e.openBlock(),e.createBlock(Vt,{key:1}))],8,Ft)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:u})=>[d.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f[0]||(f[0]=e.createTextVNode("   ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)),{conf:t.conf,columnList:d.children,option:t.option},e.createSlots({_:2},[e.renderList(c.$slots,(m,g)=>({name:g,fn:e.withCtx(y=>[e.renderSlot(c.$slots,g,e.mergeProps({ref_for:!0},y||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",Dt,[e.createVNode(e.unref(p.ElFormItem),{size:t.option.size?.table,error:t.conf.tableEditValidate.getFieldError(u,d),class:"table-edit-form-item"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["row",["table-edit-"+d.key]]),style:{width:"100%"}},[e.renderSlot(c.$slots,"table-edit-left-"+d.key,{row:u,item:d}),d.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:u[d.key],"onUpdate:modelValue":m=>u[d.key]=m,disabled:t.conf.update.getDisabled(d,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(d),e.toHandlers(t.conf.update.getOn(d,u)),{"onUpdate:modelValue":m=>t.conf.tableEditValidate.clearField(u,d)}),e.createSlots({_:2},[d.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof d.options?.input?.prepend=="function"?d.options?.input?.prepend(u):d.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):d.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:u[d.key],"onUpdate:modelValue":m=>u[d.key]=m,disabled:t.conf.update.getDisabled(d,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(d),e.toHandlers(t.conf.update.getOn(d,u)),{"onUpdate:modelValue":m=>t.conf.tableEditValidate.clearField(u,d)}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options?.search?.select?.data||d.options?.select?.data,m=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):d.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:2,modelValue:u[d.key],"onUpdate:modelValue":m=>u[d.key]=m,disabled:t.conf.update.getDisabled(d,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(d),e.toHandlers(t.conf.update.getOn(d,u)),{"onUpdate:modelValue":m=>t.conf.tableEditValidate.clearField(u,d)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"table-edit-right-"+d.key,{row:u,item:d})],2)]),_:2},1032,["size","error"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(w).EDialog.Update&&e.unref(o)(d.show?.form,t.conf.update.form,e.unref(w).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===u[t.option.table?.rowKey]&&(d.type==="input"||d.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[d.key],"onUpdate:modelValue":m=>t.conf.update.form[d.key]=m,disabled:t.conf.update.getDisabled(d,!0)},{ref_for:!0},t.conf.update.getBind(d),e.toHandlers(t.conf.update.getOn(d,u)),{style:{width:"100%"}}),e.createSlots({_:2},[d.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof d.options?.input?.prepend=="function"?d.options?.input?.prepend(u):d.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):d.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[d.key],"onUpdate:modelValue":m=>t.conf.update.form[d.key]=m,disabled:t.conf.update.getDisabled(d,!0)},{ref_for:!0},t.conf.update.getBind(d),e.toHandlers(t.conf.update.getOn(d,u)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options?.search?.select?.data||d.options?.select?.data,m=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):d.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[d.key],"onUpdate:modelValue":m=>t.conf.update.form[d.key]=m},{ref_for:!0},t.conf.update.getBind(d),e.toHandlers(t.conf.update.getOn(d,u)),{disabled:t.conf.update.getDisabled(d,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(c.$slots,"table-"+d.key,{key:1,row:u,item:d},()=>[e.unref(M).customComponent[d.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[d.type??""]?.table),e.mergeProps({key:0,modelValue:u[d.key],"onUpdate:modelValue":m=>u[d.key]=m},{ref_for:!0},d.options?.[d.type??""],e.toHandlers(d.options?.[d.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):d.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:0,modelValue:u[d.key],"onUpdate:modelValue":m=>u[d.key]=m,loading:d.options?.switch?.loadingMap?.[u[t.option.table?.rowKey]]?.loading,"before-change":()=>d.options?.switch?.tableBeforeChange?.(d.key,u)},{ref_for:!0},d.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",zt,e.toDisplayString(u[d.key]===d.options?.switch?.activeValue?d.options?.switch?.activeText:d.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":d.table?.click?.color}),class:e.normalizeClass({"table-text-click":d.table?.click?.callback}),onClick:m=>d.table?.click?.callback?.(u),innerHTML:d.table?.format?d.table?.format(u):u[d.key]},null,14,$t))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),Ot={key:0,class:"relative curd-search fit-width"},Rt={class:"mb-10 flex justify-between items-center fit-width"},Tt={class:"flex items-center",style:{gap:"10px"}},Ut={key:0},At={key:1},Lt={key:2},Ht={class:"export-btn"},jt={key:1,class:"export-btn"},It={class:"flex items-center table-tools-right",style:{gap:"10px"}},Kt={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Gt={class:"dialog-footer"},Pt={key:0},Wt={key:1},qt={class:"dialog-footer"},pe=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:void 0},searchForm:{default:void 0}},setup(t,{expose:o}){const r=w.EDialog,n=t,i=w.isFun,{conf:a,switchConfirmRef:l,ruleFormRef:c,tableRef:f}=Xe(n);return o({conf:a}),(s,d)=>{const u=e.resolveComponent("el-tooltip"),m=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(s.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Ot,[e.createVNode(e.unref(p.ElForm),{model:e.unref(a).search.form,inline:"",size:t.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"search-start",{row:e.unref(a).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).search.column.list,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.key},[e.renderSlot(s.$slots,"search-"+g.key+"-start",{row:e.unref(a).search.form}),(typeof g.show?.search=="function"?g.show?.search(e.unref(a).search.form):g.show?.search)?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0,label:g.text?.search?.label??g.label},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"search-"+g.key+"-left",{row:e.unref(a).search.form}),e.renderSlot(s.$slots,"search-"+g.key,{row:e.unref(a).search.form},()=>[g.options?.search?.type?(e.openBlock(),e.createBlock(he,{key:0,item:g,conf:e.unref(a),type:g.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(he,{key:1,item:g,conf:e.unref(a),type:g.type},null,8,["item","conf","type"]))]),e.renderSlot(s.$slots,"search-"+g.key+"-right",{row:e.unref(a).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"search-"+g.key+"-end",{row:e.unref(a).search.form})],64))),128)),e.renderSlot(s.$slots,"search-center",{row:e.unref(a).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0},{default:e.withCtx(()=>[t.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(a).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,onClick:e.unref(a).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"search-end",{row:e.unref(a).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Rt,[e.createElementVNode("div",Tt,[e.unref(i)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Ut,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:d[0]||(d[0]=g=>e.unref(a).update.open(e.unref(r).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(i)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:d[1]||(d[1]=g=>e.unref(a).remove.open(e.unref(a).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(p.ElButton),{type:"warning",onClick:d[2]||(d[2]=g=>e.unref(a).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(p.ElDropdown),{key:0,onCommand:e.unref(a).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(p.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(i)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Ht,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",jt,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:t.option.size?.search,onClick:d[3]||(d[3]=g=>e.unref(a).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"tools-left")]),e.createElementVNode("div",It,[e.renderSlot(s.$slots,"tools-right"),e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":d[4]||(d[4]=g=>e.unref(a).page.num=g),"page-size":e.unref(a).page.size,"onUpdate:pageSize":d[5]||(d[5]=g=>e.unref(a).page.size=g),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:t.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.expandColumn===void 0||t.option.tools?.expandColumn?(e.openBlock(),e.createBlock(u,{key:1,effect:"dark",content:e.unref(a).table.header.group.expand?e.unref(k).tCurd("mergeColumn"):e.unref(k).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:d[6]||(d[6]=(...g)=>e.unref(a).table.header.group.toggleExpandAll&&e.unref(a).table.header.group.toggleExpandAll(...g))},[e.unref(a).table.header.group.expand?(e.openBlock(),e.createBlock(nt,{key:0})):(e.openBlock(),e.createBlock(it,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:d[7]||(d[7]=(...g)=>e.unref(a).table.getList&&e.unref(a).table.getList(...g))},[e.createVNode(ft)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":"",t.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(p.ElTable),e.mergeProps({ref_key:"tableRef",ref:f,data:e.unref(a).table.data,border:t.option.table?.border===void 0?!0:t.option.table?.border,onSelectionChange:e.unref(a).table.selection.change,onSortChange:e.unref(a).table.sort.change,"expand-row-keys":e.unref(a).table.expand.rowKeys,onExpandChange:e.unref(a).table.expand.change},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(i)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof t.option.table?.index=="object"?t.option.table?.index?.show:t.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof t.option.table?.index=="object"?t.option.table?.index:{},e.toHandlers(typeof t.option.table?.index=="object"?t.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(Mt,{conf:e.unref(a),columnList:e.unref(a).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(s.$slots,(g,y)=>({name:y,fn:e.withCtx(B=>[e.renderSlot(s.$slots,y,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1032,["conf","columnList","option"]),e.unref(i)(t.option.table?.add)||e.unref(i)(t.option.table?.update)||e.unref(i)(t.option.table?.delete)||e.unref(i)(t.option.table?.view)||s.$slots["table-op-left"]||s.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:2,align:"center",fixed:"right"},t.option.table?.operate,{width:t.option.table?.operate?.width||120,"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(s.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("operation")),1)])]),default:e.withCtx(({row:g})=>[e.createVNode(e.unref(p.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"table-op-left",{row:g}),e.unref(a).update.type===e.unref(r).Update&&t.option.table?.inlineEdit&&e.unref(a).update.form[n.option.table?.rowKey]===g[n.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(p.ElButton),{link:"",type:"info",onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{link:"",type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(s.$slots,"table-op-edit-right",{row:g})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(t.option.table?.add,g)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,link:"",type:"primary",onClick:y=>e.unref(a).update.open(e.unref(r).Add,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.view,g)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,link:"",type:"primary",onClick:y=>e.unref(a).update.open(e.unref(r).View,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.update,g)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:2,link:"",type:"warning",onClick:y=>e.unref(a).update.open(e.unref(r).Update,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.delete,g)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:3,link:"",type:"danger",onClick:y=>e.unref(a).remove.open([g])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"table-op-right",{row:g})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[m,e.unref(a).table.loading]])],2)],2),e.createElementVNode("div",Kt,[(t.option.page?.show===void 0||t.option.page?.show)&&!e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":d[8]||(d[8]=g=>e.unref(a).page.num=g),"page-size":e.unref(a).page.size,"onUpdate:pageSize":d[9]||(d[9]=g=>e.unref(a).page.size=g),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:t.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(s.$slots,"box-right")],2),e.createVNode(e.unref(p.ElDialog),e.mergeProps({modelValue:e.unref(a).update.show,"onUpdate:modelValue":d[10]||(d[10]=g=>e.unref(a).update.show=g),title:e.unref(a).update.title,"before-close":e.unref(a).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Gt,[e.createVNode(e.unref(p.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"dialog-footer",{row:e.unref(a).update},()=>[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(a).update.type!==e.unref(r).View?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),_:3},8,["size"])])]),default:e.withCtx(()=>[e.renderSlot(s.$slots,"dialog-start",{row:e.unref(a).update}),e.createVNode(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:c,model:e.unref(a).update.form,rules:e.unref(a).update.rules,size:t.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(a).update.showContent?(e.openBlock(),e.createBlock(me,{key:0,"form-grid":e.unref(a).update.formGrid,"max-span":e.unref(a).update.formMaxSpan,form:e.unref(a).update.form,type:e.unref(a).update.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth,"form-option":t.option.form,"get-bind":e.unref(a).update.getBind,"get-on":e.unref(a).update.getOn,"get-disabled":e.unref(a).update.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(g,y)=>({name:y,fn:e.withCtx(B=>[e.renderSlot(s.$slots,y,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"]),e.renderSlot(s.$slots,"dialog-end",{row:e.unref(a).update})]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(p.ElDialog),{modelValue:e.unref(a).remove.show,"onUpdate:modelValue":d[11]||(d[11]=g=>e.unref(a).remove.show=g),title:e.unref(a).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",qt,[e.createVNode(e.unref(p.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(a).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:e.unref(a).remove.submit,loading:e.unref(a).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[t.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Pt,[e.createVNode(_e,{content:t.option.dialog?.delete?.content,value:e.unref(a).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Wt,e.toDisplayString(e.unref(k).tCurd("confirmDeleteMessage",e.unref(a).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Ze,{ref_key:"switchConfirmRef",ref:l,size:t.option.size?.form},null,8,["size"])],2)}}});class Jt{static async download(o,r="download.png"){const n=document.createElement("a");n.style.display="none",n.href=o,n.setAttribute("download",r),typeof n.download>"u"&&n.setAttribute("target","_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(o)}static exportJSONFile=(o,r)=>{const n=new Blob([JSON.stringify(o)],{type:"application/json"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=`${r||"config"}.json`,a.click()};static importFile=async o=>new Promise((r,n)=>{const i=document.createElement("input");i.type="file";const a=o?.accept||".json";i.accept=a,i.style.display="none",i.onchange=l=>{const c=l.target.files[0];if(!c){w.fail("未选择文件"),n("未选择文件");return}const f=new FileReader;f.onload=async s=>{const d=a==".json"?JSON.parse(s.target.result):s.target.result;r(d)},f.onerror=()=>{w.fail("文件读取失败"),n("文件读取失败")},f.readAsText(c),document.body.removeChild(i)},document.body.appendChild(i),i.click()})}const ye=(t,o)=>{if(t.component("TCurd",pe),t.component("TFormList",Q),t.component("TColumn",ge),o?.customComponent){M.customComponent=o.customComponent;for(const r in o.customComponent)t.component(r,o.customComponent[r])}},Qt={install:ye};F.ArrUtil=R,F.ExcelUtil=ue,F.TColumn=ge,F.TCurd=pe,F.TFile=Jt,F.TForm=M,F.TFormConfig=x,F.TFormI18n=k,F.TFormList=Q,F.TSys=w,F.default=Qt,F.install=ye,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(F,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("element-plus"),require("vue-router"),require("vue"),require("cc1-vue3")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue","cc1-vue3"],y):(F=typeof globalThis<"u"?globalThis:F||self,y(F.cc1Form={},F.ElementPlus,F.VueRouter,F.Vue,F.cc1Vue3))})(this,(function(F,y,Yt,e,J){"use strict";class w{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(o,...r)=>Array.isArray(o)?o.some(a=>typeof a=="function"?a(...r):a):typeof o=="function"?o(...r):o;static getRouterParams=()=>{const o=this.router.currentRoute.value.query||{},r=this.router.currentRoute.value.params||{};return Object.keys(o).length?o:Object.keys(r).length?r:{}};static moduleObj={};static loadModule=async o=>{if(!w.moduleObj[o])throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);const r=await w.moduleObj[o]();return r.default??r};static tipMessages={};static tipMessagesGap=500;static showMessage(o,r,a={}){const d=Date.now();if(!this.tipMessages[o]||d-this.tipMessages[o]>this.tipMessagesGap){this.tipMessages[o]=d;const n=Object.assign({message:o,type:r},a);y.ElMessage(n),setTimeout(()=>{delete this.tipMessages[o]},this.tipMessagesGap)}}static fail=(o,r={})=>{this.showMessage(o,"error",r)};static success=(o,r={})=>{this.showMessage(o,"success",r)};static loadingObj=null;static loadingTimer=null;static loading=(o=!0,r="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{o?this.loadingObj=y.ElLoading.service({lock:!0,text:r,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(o,r=!0)=>{if(r){let a=screen.width/2-500,d=screen.height/2-800/2-30;window.open(o,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+d+", left="+a)}else window.open(o,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=o=>new Promise(async(r,a)=>{let d=document.getElementById(o.id);const n=await w.loadModule("html2canvas");try{n(d,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:o.windowWidth,height:o.windowHeight,windowWidth:o.windowWidth,windowHeight:o.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(l){let i=l.toDataURL("image/png");r(i)})}catch(l){a(l)}})}class E{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=o=>{E.config=ObjectUtil.deepMerge(E.config,o)}}class M{static customComponent={};static error={};static findOptions=(o,r)=>{const a=o.column.find(n=>n.key===r),d=n=>n.replace(/-([a-z])/g,(l,i)=>i.toUpperCase());if(a)return a.options[d(a.type)]};static setOptionsData=(o,r,a)=>{const d=M.findOptions(o,r);d&&(d.data=a)};static form={openBefore:{parentId:(o,r,a,d)=>{const n=E.config.table.rowKey;o?r.type===w.EDialog.Add?(r.form.parentId=o[n],r.form.sort=o.children.length+1):r.form.parentId=o.parentId.substring(o.parentId.lastIndexOf(",")+1):(r.form.parentId="0",r.form.sort=a.length+1),M.setOptionsData(d,"parentId",[{[n]:"0",title:"根",children:a}])}}}}class R{static getIdFun=()=>StrUtil.uuid();static setId=(o,r,a)=>{r[o]||(r[o]=[]);const d=E.config.table.rowKey;r[o].forEach(n=>{a.forEach(l=>{let i=l.default??"";l.type==="number"&&(i=l.default??0),l.type==="boolean"&&(i=l.default??!1),l.type==="time"&&(i=l.default??new Date),n[l.value]===void 0&&(n[l.value]=i)}),n[d]||(n[d]=R.getIdFun())})};static add=(o,r,a,d)=>{const n=JSONUtil.cp(a);R.setId(o,r,a);const l=E.config.table.rowKey;r[o].push(n.reduce((i,f)=>{let s=f.default??"";return f.type==="number"&&(s=f.default??0),f.type==="boolean"&&(s=f.default??!1),f.type==="time"&&(s=f.default??new Date),i[f.value]=s,i},{[l]:R.getIdFun()})),d?.(r)};static remove=(o,r,a,d)=>{const n=E.config.table.rowKey;r[o]=r[o].filter(l=>l[n]!==a[n]),d?.(r)};static getNoIdData=(o,r)=>{const a=JSONUtil.cp(o),d=E.config.table.rowKey;return a.forEach(n=>{n[d]&&delete n[d],r&&n[r]&&R.getNoIdData(n[r],r)}),a}}const ke={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},we={key:0},Ce={class:"row items-center",style:{gap:"10px",width:"100%"}},Be={key:1},Q=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:o}){const r=t,a=e.reactive({show:!1,add:(n,l,i)=>{R.add(n,l,i,()=>{d("change")})},remove:(n,l,i)=>{R.remove(n,l,i,()=>{d("change")})}});e.onMounted(()=>{R.setId(r.field,r.row,r.itemFields),a.show=!0});const d=o;return(n,l)=>{const i=e.resolveComponent("el-button"),f=e.resolveComponent("el-input");return a.show?(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(n.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(i,{link:"",type:"primary",onClick:l[0]||(l[0]=s=>a.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],s=>(e.openBlock(),e.createElementBlock("div",Ce,[e.renderSlot(n.$slots,"item-start",{item:s,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,c=>(e.openBlock(),e.createBlock(f,{modelValue:s[c.value],"onUpdate:modelValue":u=>s[c.value]=u,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:c[t.label]||c[t.value],onChange:l[1]||(l[1]=u=>d("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(n.$slots,"item-end",{item:s,row:t.row}),e.createVNode(i,{link:"",type:"danger",onClick:c=>a.remove(t.field,t.row,s)},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",Be,[e.createVNode(i,{link:"",type:"primary",onClick:l[2]||(l[2]=s=>a.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),Ve={class:"row form-item-content",style:{width:"100%"}},xe={class:"col column form-item-content-item"},Ee={class:"col"},Se=["innerHTML"],Ne=e.defineComponent({__name:"field",props:{item:{},form:{},type:{},labelWidth:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const o=t,r=e.ref(),a=()=>{const n=r.value?.validateState;return n&&typeof n=="object"&&"value"in n?n.value:n},d=()=>{a()==="error"&&r.value?.clearValidate?.()};return e.watch(()=>o.form?.[o.item.key],()=>{d(),e.nextTick(()=>d())},{deep:!0,flush:"post"}),(n,l)=>(e.openBlock(),e.createBlock(e.unref(y.ElFormItem),{ref_key:"formItemRef",ref:r,label:t.item.text?.form?.label??t.item.label,prop:t.item.key,"label-width":t.item.text?.form?.label==""?0:t.item.form?.labelWidth||t.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.renderSlot(n.$slots,"form-"+t.item.key+"-start",{row:t.form,item:t.item}),e.createElementVNode("div",xe,[e.createElementVNode("div",Ee,[e.renderSlot(n.$slots,"form-"+t.item.key,{row:t.form,item:t.item},()=>[t.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(y.ElInput),e.mergeProps({key:0,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[0]||(l[0]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),e.createSlots({_:2},[t.getBind(t.item).prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.getBind(t.item).prepend=="function"?t.getBind(t.item).prepend(t.form):t.getBind(t.item).prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):t.item.type==="number"?(e.openBlock(),e.createBlock(e.unref(y.ElInputNumber),e.mergeProps({key:1,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[1]||(l[1]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(y.ElInput),e.mergeProps({key:2,type:"textarea",modelValue:t.form[t.item.key],"onUpdate:modelValue":l[2]||(l[2]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(y.ElSwitch),e.mergeProps({key:3,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[3]||(l[3]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(y.ElSelect),e.mergeProps({key:4,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[4]||(l[4]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],i=>(e.openBlock(),e.createBlock(e.unref(y.ElOption),e.mergeProps({key:i.value},{ref_for:!0},i,e.toHandlers(i.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(y.ElRadioGroup),e.mergeProps({key:5,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[5]||(l[5]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[t.getBind(t.item).type==="group"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.getBind(t.item).data||[],i=>(e.openBlock(),e.createBlock(e.unref(y.ElRadioButton),e.mergeProps({key:i.value},{ref_for:!0},i,e.toHandlers(i.on||{})),null,16))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.getBind(t.item).data||[],i=>(e.openBlock(),e.createBlock(e.unref(y.ElRadio),e.mergeProps({key:i.value},{ref_for:!0},i,e.toHandlers(i.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(y.ElCheckboxGroup),e.mergeProps({key:6,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[6]||(l[6]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[t.getBind(t.item).type==="group"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.getBind(t.item).data||[],i=>(e.openBlock(),e.createBlock(e.unref(y.ElCheckboxButton),e.mergeProps({key:i.value},{ref_for:!0},i,e.toHandlers(i.on||{})),null,16))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.getBind(t.item).data||[],i=>(e.openBlock(),e.createBlock(e.unref(y.ElCheckbox),e.mergeProps({key:i.value},{ref_for:!0},i,e.toHandlers(i.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="color"?(e.openBlock(),e.createBlock(e.unref(y.ElColorPicker),e.mergeProps({key:7,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[7]||(l[7]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="slider"?(e.openBlock(),e.createBlock(e.unref(y.ElSlider),e.mergeProps({key:8,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[8]||(l[8]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="list"?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:9,row:t.form,field:t.item.key},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(y.ElTreeSelect),e.mergeProps({key:10,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[9]||(l[9]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(y.ElDatePicker),e.mergeProps({key:11,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[10]||(l[10]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&typeof t.item.type=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.item.type),e.mergeProps({key:12,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[11]||(l[11]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&(e.unref(M).customComponent[t.item.type]||e.unref(M).customComponent[t.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[t.item.type]?.form||e.unref(M).customComponent[t.item.type]),e.mergeProps({key:13,modelValue:t.form[t.item.key],"onUpdate:modelValue":l[12]||(l[12]=i=>t.form[t.item.key]=i)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+t.item.key+"-right",{row:t.form,item:t.item})]),e.renderSlot(n.$slots,"form-"+t.item.key+"-tip",{row:t.form,item:t.item},()=>[t.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.form?.tipText=="function"?t.item.form?.tipText(t.form,t.type):t.item.form?.tipText},null,8,Se)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+t.item.key+"-end",{row:t.form,item:t.item})])]),_:3},8,["label","prop","label-width"]))}});function Zt(t){return t}const Fe={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"部分内容未输入或输入错误,请检查",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class k{static t(o,...r){if(typeof o=="function")return o(...r);o=String(o);let a=0;return o.replace(/{([^}]+)}/g,(d,n)=>a<r.length?String(r[a++]):`{${n}}`)}static setI18n=o=>{k.curd=ObjectUtil.deepMerge(k.curd,o)};static tCurd(o,...r){return this.t(this.curd[o],...r)}static curd=Fe}class T{static delAllKey=o=>{Object.keys(o).forEach(r=>{delete o[r]})};static setValue=(o,r,a=!1)=>{a&&T.delAllKey(o),Object.keys(r).forEach(d=>{o[d]!==r[d]&&(o[d]=r[d])})}}const G=t=>{const o=e.reactive({}),r=()=>typeof t=="function"?t():t,a=()=>{const d=r();return d??o};return{internal:o,isExternal:()=>r()!=null,get(){return a()},set(d){T.setValue(a(),d,!0)},merge(d){T.setValue(a(),d,!1)},clear(){T.delAllKey(a())}}},I=t=>{t.forEach(o=>{console.error({field:o.field||"",error:o.error||""})})},De=t=>t?typeof t=="string"?t:t instanceof Error?t.message:t.message||String(t):"",P=t=>!t||typeof t!="object"?[]:Object.keys(t).flatMap(o=>(Array.isArray(t[o])?t[o]:[t[o]]).map(a=>({field:a?.field||o,error:De(a)}))),W=w.EDialog,A=t=>typeof t.type=="object"?"component":t.type||"input",ze=(t,o,r)=>{const a=G(()=>o.form),d=l=>X(l.update.formGrid||[],l.update.form,l.update.type,l.update.formMaxSpan).map(f=>f.item.key).filter(Boolean),n=async l=>{const i=r.ruleFormRef.value;if(!i)return!0;await e.nextTick();const f=d(l),s=Object.keys(l.update.rules||{}).filter(u=>!f.includes(u));if(s.length&&i.clearValidate(s),!f.length)return!0;if(!await i.validateField(f,async(u,m)=>{u||I(P(m))}))throw!1;return!0};return{update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:W.Update,get form(){return a.get()},set form(l){a.set(l)},formDefault:{},formColumn:[],formGrid:[],formMaxSpan:12,getDisabled:(l,i=!1)=>{const f=t();return o.option.table?.editMode&&i?l.disabled?.table===void 0?!1:w.isFun(l.disabled?.table,f.update.form):te(l,f.update.type,f.update.form)},getBind:l=>{const i=t();return oe(l,i.update.type)},getOn:(l,i)=>{const f=t();return ne(l,f.update.type,[i||f.update.form,l])},getOptions:l=>{const i=t();try{const s=ie(i.update.formGrid?.length?i.update.formGrid:i.update.formColumn).find(c=>c.item.key===l)?.item;return s?{options:s.options,bind:i.update.getBind(s)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:l=>{const i=t();if(o.option.form?.editAll)return l;const f={[o.option.table?.rowKey]:i.update.edit.data[o.option.table?.rowKey]};return Object.keys(i.update.edit.data).forEach(s=>{l[s]!==i.update.edit.data[s]&&(f[s]=l[s])}),f}},view:{},openLoading:!1,open:async(l,i)=>{const f=t();if(!(f.update.showContent||f.update.openLoading)){w.loading(!0),f.update.openLoading=!0;try{f.update.type=l;const s=l===W.Add;f.update.edit.data=s?void 0:JSONUtil.cp(i),f.update.title=k.tCurd(s?"add":l===W.View?"view":"edit");const c=s?ObjectUtil.deepMerge(JSONUtil.cp(f.update.formDefault),i?JSONUtil.cp(i):{}):JSONUtil.cp(i);T.setValue(f.update.form,c,!0),await f.initApiData("update"),await o.option.form?.openBefore?.(f.update.form,f.update),(!o.option.table?.inlineEdit||s)&&(f.update.show=!0,f.update.showContent=!0),o.option.form?.openAfter?.(f.update.form,f.update)}catch(s){console.error(s)}finally{w.loading(!1),f.update.openLoading=!1}}},validate:async(l=!0)=>{const i=t();try{const f=o.option.table?.editMode?i.tableEditValidate.validate():n(i);return await Promise.all([f,i.formRef.validate()]),!0}catch{return l&&w.fail(k.tCurd("checkFormData")),!1}},submit:async()=>{const l=t();if(!await l.update.validate()||l.update.loading)return;l.update.loading=!0;const f=l.update.type===W.Add?o.option.api.create:o.option.api.update;try{await o.option.form?.submitBefore?.(l.update.form,l.update)}catch{l.update.loading=!1;return}let s=ObjectUtil.deepMerge(l.update.form,{});delete s.children;const c=new Set(o.option.column.filter(u=>u.type==="datetime").map(u=>u.key));Object.keys(s).forEach(u=>{if(c.has(u)&&s[u]!=null){const m=new Date(s[u]).getTime();isNaN(m)||(s[u]=m)}});try{if(!f)return;await f({...s}),l.update.close(),await l.table.getList(),o.option.form?.submitAfter?.(s,l.update)}catch(u){console.error(u)}finally{l.update.loading=!1}},close:()=>{const l=t();l.update.show=!1,l.update.edit.data=void 0,setTimeout(()=>{l.update.showContent=!1,r.ruleFormRef.value?.resetFields?.(),a.clear()},350)}}}},O=12,q=(t,o)=>{t.isForm=o,Array.isArray(t.children)&&t.children.forEach(r=>q(r,o))},$e=t=>t.isForm===!1?!1:typeof t.show?.form=="boolean"?t.show.form:!0,Me=(t,o,r)=>(t.form=t.form||{span:o},r==="column"?t.form.span=t.form.span??12:t.form.span=t.form.span??o,t.form.span),ee=t=>{const o=t.form;return o?.row!=null&&o.row>0?o.row:O},L=t=>Math.floor((t.gridRow-1)/O),te=(t,o,r)=>{if(o===w.EDialog.View)return t.disabled?.view===void 0?!0:w.isFun(t.disabled?.view,r);const a=t.disabled?.[o===w.EDialog.Add?"create":"update"];return w.isFun(a,r)},oe=(t,o)=>{const r=A(t);return t.options?.[o===w.EDialog.Add?"formAdd":"formUpdate"]?.[r]||t.options?.[r]||{}},ne=(t,o,r=[])=>{const a=A(t),n=t.options?.[o===w.EDialog.Add?"formAdd":"formUpdate"]?.[a]?.on||t.options?.[a]?.on||{},l={};return Object.keys(n).forEach(i=>{const f=n[i];typeof f=="function"?l[i]=function(...s){return f.apply(this,[...s,...r])}:l[i]=f}),l},ae=(t,o,r,a,d)=>{const n=t,l=n.colSpan??t.span;if(!t.item.form?.spanCol)return l;const i=d?.maxSpan||12,f=d?.defaultSpan||i/2,s=n.gridBand,u=o.filter(m=>s!=null?m.gridBand===s&&!w.isFun(m.item.show?.form,r,a):m.gridRow===n.gridRow&&!w.isFun(m.item.show?.form,r,a)).reduce((m,g)=>m+(g.colSpan??g.span??f),0);return l+u},Oe=(t,o)=>{const r=(a,d)=>{const n=a.gridRow,l=a.gridRow+a.rowSpan-1,i=d.gridRow,f=d.gridRow+d.rowSpan-1;return n<=f&&i<=l};return t.map(a=>t.filter(n=>r(a,n)).length!==1||a.colSpan>=o?a:{...a,span:o,colSpan:o,gridColumn:1})},re=(t,o,r={})=>{const a=new Set,d=[];let n=0,l=0;const i=g=>Math.floor(g/O)*O,f=(g,p)=>`${g},${p}`,s=(g,p,B,S)=>{if(p+B>o)return!1;for(let V=0;V<S;V++)for(let x=0;x<B;x++)if(a.has(f(g+V,p+x)))return!1;return!0},c=(g,p,B,S)=>{for(let V=0;V<S;V++)for(let x=0;x<B;x++)a.add(f(g+V,p+x))},u=(g,p,B,S)=>{for(let x=i(g);x<500*O;x+=O){const K=x+O,Z=x===i(g)?Math.max(x,g):x;for(let U=Z;U<K;U++){const v=U===g?p:0;for(let j=v;j<=o-B;j++)if(s(U,j,B,S))return{tr:U,tc:j}}}return{tr:g,tc:p}},m=(g,p,B,S)=>{const V=i(g);if(S<O&&g+S<V+O){n=g+S,l=p;return}const x=p+B;if(x<o){l=x,n=V;return}l=0,n=V+O};return t.forEach(g=>{const p=g.colSpan??(g.span===0?o:g.span),B=g.rowSpan??ee(g.item);g.item.form?.rowBreak&&d.length&&(l=0,n=i(n)+O);let{tr:S,tc:V}=s(n,l,p,B)?{tr:n,tc:l}:u(n,l,p,B);s(S,V,p,B)||({tr:S,tc:V}=u(0,0,p,B)),c(S,V,p,B);const x=S+1;d.push({...g,span:p,colSpan:p,rowSpan:B,gridRow:x,gridColumn:V+1,gridBand:L({gridRow:x})}),m(S,V,p,B)}),r.fillSingleRows?Oe(d,o):d},X=(t,o,r,a=O)=>{const d=t.filter(i=>w.isFun(i.item.show?.form,o,r)),n=new Map;t.forEach(i=>{const s=`${i.gridBand??L(i)}:${i.gridColumn}:${i.colSpan}`;n.has(s)||n.set(s,[]),n.get(s).push(i)});const l=new Map;return n.forEach(i=>{const f=i.reduce((m,g)=>m+g.rowSpan,0);if(!(i.length>1&&f===O&&i.every(m=>m.rowSpan<O)))return;const c=i.filter(m=>w.isFun(m.item.show?.form,o,r));if(c.length!==1)return;const u=c[0];l.set(u.item.key,{...u,rowSpan:O})}),re(d.map(i=>l.get(i.item.key)||i),a,{fillSingleRows:!0})},le=t=>{const o=new Map;return t.forEach(r=>{const a=r.gridBand??L(r);o.has(a)||o.set(a,[]),o.get(a).push(r)}),Array.from(o.keys()).sort((r,a)=>r-a).map(r=>o.get(r))},ie=t=>t?.length?Array.isArray(t[0])?t.flat():t:[],Re=(t,o)=>{if(!$e(t)||!t.key)return null;const r=o.defaultSpan??(o.maxSpan||12)/2,a=Me(t,r,o.layout);return{item:t,span:a}},Te=(t,o={})=>{const r=[],a=d=>{if(d.children?.length){d.children.forEach(l=>a(l));return}const n=Re(d,o);n&&r.push(n)};return t.forEach(d=>a(d)),r},de=(t,o={})=>{const r=o.maxSpan??12,a=o.defaultSpan??r/2,d=o.layout??"row",l=Te(t,{maxSpan:r,defaultSpan:a,layout:d});if(d==="column"){const i=[];let f=1;return l.forEach(s=>{const c=ee(s.item),u=r;i.push({...s,span:u,colSpan:u,rowSpan:c,gridRow:f,gridColumn:1,gridBand:L({gridRow:f})}),f+=c}),{cells:i,maxSpan:r}}return{cells:re(l,r),maxSpan:r}},Ue=t=>t.map(o=>o.item?.show?.form),Ae=(t,o,r)=>{if(!t.rules)return;const a={required:!0,message:o(t),trigger:"blur"},d=A(t),n=t.options?.datetime?.type,l=d==="datetime"&&typeof n=="string"&&n.includes("range"),i=d==="select"&&!!t.options?.select?.multiple;(l||d==="checkbox"||i)&&(a.type="array",a.min=l?2:1);const f=typeof t.rules=="boolean"?[a]:t.rules;return r?f.map(s=>r(s)):f},ce=t=>typeof t=="function"?t():t,se=t=>(o,r)=>Ae(o,t,a=>{const d=(n,l)=>{if(l&&Object.prototype.hasOwnProperty.call(l,o.key)&&l[o.key]!==void 0)return l[o.key];const i=ce(r);return i&&Object.prototype.hasOwnProperty.call(i,o.key)?i[o.key]:n};if(a.validator){const n=a.validator;return{...a,validator:(l,i,f,s)=>{const c=ce(r);return n(l,d(i,s),f,c||s)}}}return a}),fe=(t,o)=>{const r={input:k.tCurd("placeholderInput"),select:k.tCurd("placeholderSelect")},a=(r[A(t)||"input"]||r.input)+t.label;return(o||M.error.callback)?.(t.key,t)||a},me=t=>se(o=>fe(o,t?.error)),Le=(t,o,r)=>{const a={},d={},n=o?.maxSpan||12,l=o?.defaultSpan||n/2,i=me(o);t.forEach(c=>q(c,!0)),Y(t,a,d,c=>i(c,r));const{cells:f,maxSpan:s}=de(t,{maxSpan:n,defaultSpan:l,layout:o?.layout});return{formDefault:a,rules:d,formGrid:f,formMaxSpan:s,formColumn:le(f)}},Y=(t,o,r,a)=>{const d=n=>{if(n.children?.length){n.children.forEach(l=>d(l));return}if(n.key){o[n.key]=n.value;const l=a(n);l&&(r[n.key]=l)}};t.forEach(d)},He={class:"curd-form-cell-inner"},ge=e.defineComponent({__name:"layout",props:{formGrid:{},maxSpan:{},form:{},type:{},stripe:{type:Boolean},labelWidth:{},formOption:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const o=w.isFun,r=t,a=e.computed(()=>X(r.formGrid,r.form,r.type,r.maxSpan)),d=e.computed(()=>{const m=Array.from(new Set(a.value.map(g=>g.gridBand??L(g)))).sort((g,p)=>g-p);return new Map(m.map((g,p)=>[g,p]))}),n=e.computed(()=>({gridTemplateColumns:`repeat(${r.maxSpan}, minmax(0, 1fr))`})),l=e.computed(()=>{let m=0;return a.value.forEach(g=>{const p=g.gridRow+g.rowSpan-1;p>m&&(m=p)}),m}),i=m=>m.gridRow+m.rowSpan-1>=l.value,f=m=>m.rowSpan>=O,s=m=>{const g=m.gridBand??L(m);return d.value.get(g)??g},c=m=>ae(m,a.value,r.form,r.type,{maxSpan:r.maxSpan,defaultSpan:r.formOption?.defaultSpan}),u=m=>{const g=c(m)||m.colSpan;return{gridRow:`${m.gridRow} / span ${m.rowSpan}`,gridColumn:`${m.gridColumn} / span ${g}`}};return(m,g)=>e.unref(o)(e.unref(Ue)(t.formGrid),t.form,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(m.$slots,"form-start",{row:t.form}),e.createElementVNode("div",{class:e.normalizeClass(["curd-form-grid",{stripe:t.stripe!==!1}]),style:e.normalizeStyle(n.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,p=>(e.openBlock(),e.createElementBlock("div",{key:p.item.key,class:e.normalizeClass(["curd-form-grid-cell",[t.stripe!==!1&&s(p)%2===0?"stripe-band-odd":"",p.gridColumn>1?"has-col-border":"",t.stripe!==!1&&i(p)?"is-last-row":"",f(p)?"is-row-span":"",`form-item-col-${p.item.key}`]]),style:e.normalizeStyle(u(p))},[e.createElementVNode("div",He,[e.unref(o)(p.item.show?.form,t.form,t.type)?(e.openBlock(),e.createBlock(Ne,{key:0,class:e.normalizeClass({"is-row-span-field":f(p)}),item:p.item,form:t.form,type:t.type,"label-width":t.labelWidth,"get-bind":t.getBind,"get-on":t.getOn,"get-disabled":t.getDisabled},e.createSlots({_:2},[e.renderList(m.$slots,(B,S)=>({name:S,fn:e.withCtx(V=>[e.renderSlot(m.$slots,S,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["class","item","form","type","label-width","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)])],6))),128))],6),e.renderSlot(m.$slots,"form-end",{row:t.form})],64)):e.createCommentVNode("",!0)}}),ue=e.defineComponent({__name:"column",props:{option:{default:()=>({form:{},column:[]})},type:{default:""},form:{default:void 0}},setup(t,{expose:o}){const r=w.EDialog,a=e.ref(),d=t;let n=G(d.form);const l=J.Scope.getConf("curdConf"),i="formRef-"+StrUtil.getId();e.onUnmounted(()=>{l?.formRef?.remove(i)});const f=e.reactive({rules:{},show:!0,formDefault:{},type:d.type||l?.update?.type||r.Add,formColumn:[],formGrid:[],formMaxSpan:12,get form(){return n.get()},set form(s){n.set(s)},getDisabled:s=>te(s,f.type,f.form),getBind:s=>oe(s,f.type),getOn:s=>ne(s,f.type,[f.form,s]),initColumnForm:()=>{const s=n,c=Le(d.option.column,d.option.form,()=>s.get());f.formDefault=c.formDefault,f.rules=c.rules,f.formGrid=c.formGrid,f.formMaxSpan=c.formMaxSpan,f.formColumn=c.formColumn,f.type===r.Add?s.isExternal()?s.merge(JSONUtil.cp(f.formDefault)):s.set(JSONUtil.cp(f.formDefault)):!s.isExternal()&&d.form&&s.set(JSONUtil.cp(d.form))}});return l?.formRef?.set(i,{validate:async s=>{const c=a.value;if(!c)return s?.(!0),!0;await e.nextTick();const u=X(f.formGrid||[],f.form,f.type,f.formMaxSpan).map(p=>p.item.key).filter(Boolean),m=Object.keys(f.rules||{}).filter(p=>!u.includes(p));if(m.length&&c.clearValidate(m),!u.length)return s?.(!0),!0;const g=await c.validateField(u,async(p,B)=>{p||I(P(B))});if(s?.(!!g),!g)throw!1;return!0}}),d.option.form?.initStart?.(f),f.initColumnForm(),d.option.form?.initEnd?.(f),e.watch(()=>d.form,s=>{n=G(s),f.initColumnForm()}),o({ref:a,conf:f}),(s,c)=>(e.openBlock(),e.createBlock(e.unref(y.ElForm),{ref_key:"ruleFormRef",ref:a,model:f.form,rules:f.rules},{default:e.withCtx(()=>[f.show?(e.openBlock(),e.createBlock(ge,{key:0,"form-grid":f.formGrid,"max-span":f.formMaxSpan,form:f.form,type:f.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth||"100px","form-option":t.option.form,"get-bind":f.getBind,"get-on":f.getOn,"get-disabled":f.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(u,m)=>({name:m,fn:e.withCtx(g=>[e.renderSlot(s.$slots,m,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}}),je=t=>t?.value||t,Ie=t=>{const o=je(t);return o?.validate?new Promise((r,a)=>{let d=!1;const n=(l,i)=>{d||(d=!0,l===!1?(I(P(i)),a(!1)):r(!0))};try{const l=o.validate(n);l&&typeof l.then=="function"?l.then(i=>n(i)).catch(i=>{I(P(i?.fields||i)),a(i)}):(l!==void 0||o.validate.length===0)&&n(l)}catch(l){a(l)}}):Promise.resolve(!0)},Ke=()=>{const t=e.reactive({formRef:{map:{},set(o,r){t.formRef.map[o]=r},remove(o){delete t.formRef.map[o]},validate(){const o=Object.keys(t.formRef.map).map(r=>t.formRef.map[r]);return Promise.all(o.map(r=>Ie(r))).then(()=>!0)}},regFormRef(o,r,a){o?a?t.formRef.set(r,{validate:async d=>{try{d(await a())}catch{d(!1)}}}):t.formRef.set(r,o):t.formRef.remove(r)}});return t},Ge=(t,o)=>{const r=G(()=>o.searchForm);return{search:{column:{list:[]},get form(){return r.get()},set form(a){r.set(a)},formDefault:{},getPlaceholder:(a,d=k.tCurd("placeholderInput"))=>a.text?.search?.placeholder===void 0?`${d}${a.label}`:a.text?.search?.placeholder,getFormData:()=>{const a=t();let d={};o.option.column.forEach(l=>{(typeof l.show?.search=="function"?l.show?.search(a.search.form):l.show?.search)&&(d[l.key]=a.search.form[l.key])});const n=o.option.search?.before?.(d);return n&&(d=n),d},reset:()=>{const a=t(),d=a.search.formDefault;Object.keys(d).forEach(l=>{o.option.search?.resetMode==="none"?d[l]=void 0:d[l]=a.search.formDefault[l]});const n=ObjectUtil.deepMerge(d,{});T.setValue(a.search.form,n,!0),a.page.num=1,o.option.init!==!1&&a.table.getList()},submit:()=>{const a=t();a.page.num=1,a.table.getList()}}}},Pe=(t,o)=>({page:{num:1,total:0,layout:o.option.page?.layout||E.config.pagination.layout,showTools:o.option.page?.showTools||E.config.pagination.showTools,size:o.option.page?.size||E.config.pagination.size,sizeList:o.option.page?.sizeList||E.config.pagination.pageSizes,pagerCount:o.option.page?.pagerCount||E.config.pagination.pagerCount,getQuery:(r={})=>{const a=t();return{[E.config.field.page.size]:r.size||a.page.size,[E.config.field.page.num]:r.num||a.page.num,...a.search.getFormData()}}}}),We=(t,o,r)=>({table:{op:{width:(...a)=>a.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(a,d)=>{},all:()=>{const a=t();if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const d=n=>{let l=[];return n.forEach(i=>{l.push(i[o.option.table.rowKey]),i.children?.length&&(l=l.concat(d(i.children)))}),l};a.table.expand.rowKeys=d(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const a=t(),d=!a.table.header.group.expand;a.table.header.group.expand=d;const n=l=>{l.forEach(i=>{i.table?.header?.group!==void 0&&(i.table.header.group=!d),i.table?.header?.groupKey!==void 0&&(i.table.header.show=d),Array.isArray(i.children)&&i.children.length&&n(i.children)})};n(a.table.column.list)}}},getList:async()=>{const a=t();a.table.loading=!0;const d=o.option.api.list,n=JSONUtil.cp(a.table.selection.list);try{await a.initApiData("init");let l={};if(a.table.sort.prop){const{props:p,order:B}=E.config.table.sort;l={[p.field]:a.table.sort.prop,[B.field]:a.table.sort.order}}const i=await d({...a.page.getQuery(),...l}),f=E.config.field.result,s=i.data||{[f.list]:i},c=(Array.isArray(s[f.list]),s[f.list]),u=ie(a.update.formGrid?.length?a.update.formGrid:a.update.formColumn),g=ObjectUtil.deepMerge({data:c},{}).data.map(p=>(Object.keys(p).forEach(S=>{const V=u.find(x=>x.item.key===S);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=x=>V.item.options[V.item.type].data?.find(K=>K.value==x[S])?.label||x[S]))}),p));a.table.data=o.option.data?await o.option.data(g,c):g,a.tableEditValidate?.clear?.(),a.page.total=s[f.total]||0,setTimeout(()=>{a.table.selection.setList(n)},20)}catch(l){console.error(l)}finally{a.table.loading=!1}},selection:{list:[],change:a=>{t().table.selection.list=a},setList:(a,d)=>{const n=t();n.table.selection.list=[];const l=r.tableRef.value;if(l?.clearSelection(),!l||!a?.length)return;const i=o.option.table?.rowKey,f=s=>{const c=u=>{for(const m of u){if(i!=null&&i!==""){if(m[i]===s[i])return m}else if(m===s)return m;if(Array.isArray(m.children)&&m.children.length){const g=c(m.children);if(g!==void 0)return g}}};return c(n.table.data)};a.forEach(s=>{const c=f(s);if(c)if(d){const u=()=>l.toggleRowSelection(c,!0,!1);d(s)!==!1&&u()}else l.toggleRowSelection(c,!0,!1)})}},sort:{prop:"",order:"",change:a=>{const d=t();E.config.table.sort.resetPage&&(d.page.num=1);const n=E.config.table.sort;if(n.change){n.change(a,d);return}d.table.sort.prop=a.prop,a.order===null?(d.table.sort.order="",d.table.sort.prop=""):d.table.sort.order=a.order==="ascending"?n.order.asc:n.order.desc,d.table.getList()}}}}),qe=(t,o)=>{const r=e.reactive({}),a=new WeakMap;let d=0;const n=h=>{let b=a.get(h);return b||(d+=1,b=`fallback-${d}`,a.set(h,b)),b},l=h=>{const b=o.option.table?.rowKey,C=b?h[b]:void 0;return C!=null&&C!==""?String(C):n(h)},i=(h,b)=>`${l(h)}-${b.key}`,f=h=>fe(h,o.option.form?.error),s=se(f),c=()=>{Object.keys(r).forEach(h=>{delete r[h]})},u=(h,b)=>{delete r[i(h,b)]},m=(h,b)=>r[i(h,b)]||"",g=(h,b)=>h.message||f(b),p=h=>h==null||h===""||Array.isArray(h)&&h.length===0,B=h=>{if(typeof h=="number")return h;if(typeof h=="string"||Array.isArray(h))return h.length},S=(h,b)=>{if(h==="array")return Array.isArray(b);if(h==="integer")return typeof b=="number"&&Number.isInteger(b);if(h==="float")return typeof b=="number"&&!Number.isInteger(b);if(h==="number")return typeof b=="number"&&!Number.isNaN(b);if(h==="boolean")return typeof b=="boolean";if(h==="object")return b!==null&&typeof b=="object"&&!Array.isArray(b);if(h==="date")return b instanceof Date||!Number.isNaN(new Date(b).getTime());if(h==="email")return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(b));if(h==="url")try{return new URL(String(b)),!0}catch{return!1}return h==="string"?typeof b=="string":!0},V=(h,b,C)=>typeof h.validator!="function"?Promise.resolve(!0):new Promise(D=>{let z=!1;const N=$=>{if(!z){if(z=!0,$==null){D(!0);return}if($ instanceof Error){D($.message||g(h,C));return}if(Array.isArray($)){const _=$[0];D(_ instanceof Error?_.message:String(_||g(h,C)));return}D(String($))}};try{const $=h.validator(h,b,N);$&&typeof $.then=="function"?$.then(()=>N()).catch(N):$===!1?N(g(h,C)):typeof $=="string"||$ instanceof Error?N($):h.validator.length<3&&N()}catch($){N($)}}),x=async(h,b,C)=>{const D=typeof h.transform=="function"?h.transform(b):b,z=p(D);if(h.required&&z)return g(h,C);if(z&&!h.required)return!0;if(h.whitespace&&typeof D=="string"&&D.trim()===""||h.type&&!S(h.type,D)||Array.isArray(h.enum)&&!h.enum.includes(D)||h.pattern&&!new RegExp(h.pattern).test(String(D)))return g(h,C);const N=B(D);return h.len!==void 0&&N!==void 0&&N!==h.len||h.min!==void 0&&N!==void 0&&N<h.min||h.max!==void 0&&N!==void 0&&N>h.max?g(h,C):V(h,D,C)},K=h=>{const b=t();return!h.key||!b.table.column.show.list.includes(h.key)||h.table?.header?.groupKey!==void 0&&!h.table.header.show?!1:h.show?.table!==void 0?w.isFun(h.show?.table,b.table.data):!0},Z=(h,b)=>h.show?.form!==void 0?w.isFun(h.show.form,b,w.EDialog.Update):!0,U=()=>{const h=t(),b=[],C=D=>{D.forEach(z=>{if(K(z)){if(z.children?.length){C(z.children);return}b.push(z)}})};return C(h.table.column.list),b},v=async(h,b)=>{if(!Z(b,h))return u(h,b),!0;const C=s(b,h);if(!C)return!0;u(h,b);const D=Array.isArray(C)?C:[C];for(const z of D){const N=await x(z,h[b.key],b);if(N!==!0)return r[i(h,b)]=N,{field:b.key,error:N}}return!0},j=h=>{const b=[],C=D=>{D.forEach(z=>{b.push(z),Array.isArray(z.children)&&z.children.length&&C(z.children)})};return C(h),b};return{tableEditValidate:{errors:r,clear:c,clearField:u,getFieldError:m,validate:async()=>{if(c(),!o.option.table?.editMode)return!0;const h=t(),b=U(),C=j(h.table.data||[]),z=(await Promise.all(C.flatMap(N=>b.map($=>v(N,$))))).filter(N=>N!==!0);if(z.length)throw I(z),!1;return!0}}}};class he{static exportToExcel=async(o,r,a)=>{if(!o||o.length===0)return;const d=await w.loadModule("xlsx"),n=o.map(f=>{const s={};return r.forEach(c=>{s[c.label]=f[c.key]}),s}),l=d.utils.json_to_sheet(n),i=d.utils.book_new();d.utils.book_append_sheet(i,l,"Sheet1"),a?typeof a=="function"&&(a=a()):a=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,d.writeFile(i,`${a}.xlsx`)}}const Je=(t,o)=>({export:{run:{start:async r=>{let d=await t().export.run[r]();const n=o.option.column,l=ObjectUtil.deepMerge({data:d,columns:n},{}),i=o.option.tools?.export||{};i.before?.(l),he.exportToExcel(l.data,l.columns,i.fileName)},select:async()=>{const r=t();r.export.loading=!0;try{if(o.option.tools?.export?.select){await o.option.tools.export.select({...r.page.getQuery(),items:r.table.selection.list});return}if(r.table.selection.list.length===0)throw w.fail(k.tCurd("selectDataToExport")),new Error(k.tCurd("selectDataToExport"));return r.table.selection.list}catch(a){console.error(a)}finally{r.export.loading=!1}},page:async()=>{const r=t();r.export.loading=!0;try{if(o.option.tools?.export?.page){await o.option.tools.export.page({...r.page.getQuery()});return}if(r.table.data.length===0)throw w.fail(k.tCurd("noData")),new Error(k.tCurd("noData"));return r.table.data}catch(a){console.error(a)}finally{r.export.loading=!1}},all:async()=>{const r=t();r.export.loading=!0;try{if(o.option.tools?.export?.all){await o.option.tools.export.all({...r.page.getQuery()});return}const a=o.option.api.list,d=await a({...r.page.getQuery({size:999999,num:1})});return(d.data||{[E.config.field.result.list]:d})[E.config.field.result.list]}catch(a){console.error(a)}finally{r.export.loading=!1}}},loading:!1,click:r=>{const a=t();a.export.loading||a.export.run.start(r)}}}),Qe=(t,o)=>({remove:{title:k.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{t().remove.show=!1},open:r=>{if(r.length===0){w.fail(k.tCurd("selectDataToDelete"));return}const a=t();a.remove.items=r,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{const r=t();r.remove.loading=!0;const a=o.option.api.delete;try{if(!a)return;await a({[o.option.table?.rowKey]:r.remove.items.map(d=>d[o.option.table?.rowKey]),items:r.remove.items}),w.success(k.tCurd("operationSuccess")),r.table.data.length<=1&&r.page.num>1&&(r.page.num-=1),r.remove.close(),await r.table.getList()}catch(d){console.error(d)}finally{r.remove.loading=!1}})}}}),Xe=(t,o,r)=>({apiDataMap:{},getColumnSpan:(a,d)=>{const n=t(),l=n.update.formGrid?.length?n.update.formGrid:d||[];return ae(a,l,n.update.form,n.update.type,{maxSpan:n.update.formMaxSpan||o.option.form?.maxSpan,defaultSpan:o.option.form?.defaultSpan||E.config.form.defaultSpan})},init:()=>{const a=t();a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},initApiData:async a=>{const d=t(),n=[],l=i=>{if(i.children?.length){i.children.forEach(s=>l(s));return}const f=A(i);if(i.options?.[f]?.dataApi&&i.options?.[f]?.dataApiConfig?.[a]){if(d.apiDataMap[i.key]&&i.options?.[f]?.dataApiConfig?.once)return;const s=(async()=>{try{let c=await i.options?.[f]?.dataApi?.(d.update.form,d.update.type);if(c){const u=i.options?.[f]?.dataPath;!Array.isArray(c)&&u&&(c=ObjectUtil.getPathValue(c,u)),i.options[f].data=c,i.options.search[f].data=c,i.options.search[i.options.search.type??f]||(i.options.search[i.options.search.type??f]={}),i.options.search[i.options.search.type??f].data=c,i.options.formAdd[f].data=c,i.options.formUpdate[f].data=c,d.apiDataMap[i.key]=c}}catch{}})();n.push(s)}};return o.option.column.forEach(i=>l(i)),await Promise.all(n),!0},initCurdConfig:()=>{const a=ObjectUtil.deepMerge(E.config,{});a.table.emptyText=k.tCurd("noData"),o.option.size=o.option.size||{},a.table.size=o.option.size.table||a.size.table,a.form.size=o.option.size.form||a.size.form,a.size.search=o.option.size.search||a.size.search;const d=ObjectUtil.deepMerge(a,o.option||{});Object.keys(d).forEach(n=>{o.option[n]=d[n]})},initColumnOptions:()=>{const a=t();let d=JSONUtil.cp(E.config.columnConfig);d.options=ObjectUtil.deepMerge({switch:{activeText:k.tCurd("switchOn"),inactiveText:k.tCurd("switchOff")}},d.options);const n=l=>{const i=A(l);for(const s in d){if(s==="table"){if(l.table=ObjectUtil.deepMerge(d.table,l.table||{}),l.children){l.children.forEach(c=>n(c));return}}else s==="type"?l.type=l.type||d.type:l[s]=ObjectUtil.deepMerge(d[s],l[s]||{});l.options=l.options||{},l.options[i]=l.options[i]||{},l.options[i].size=o.option.size.form}["search","formAdd","formUpdate"].forEach(s=>{l.options[s]=ObjectUtil.deepMerge(l.options,l.options[s]||{}),s==="search"?o.option.size.search&&(l.options[s][i].size=o.option.size.search):o.option.size.form&&(l.options[s][i].size=o.option.size.form)}),l.table=ObjectUtil.deepMerge(l.table,l.options[i].table||{}),i==="switch"&&(l.options.switch.tableBeforeChange=async(s,c)=>{const u=l.options?.switch;try{u.tableConfig?.confirm&&await r.switchConfirmRef.value?.open({title:k.tCurd("confirmModify"),content:k.tCurd("confirmSwitchMessage")});try{if(!o.option.api.update&&!u.tableConfig?.api)return;const m=c[o.option.table?.rowKey];u.loadingMap||(u.loadingMap={}),u.loadingMap[m]||(u.loadingMap[m]={loading:!1}),u.loadingMap[m].loading=!0;const g=c[s]===u.activeValue?u.inactiveValue:u.activeValue,p=u.tableConfig?.api?u.tableConfig.api:o.option.api.update;if(!p)return;try{await p({...c,[s]:g},"switch")}catch{return!1}finally{u.loadingMap[m].loading=!1}return w.success(k.tCurd("operationSuccess")),u.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(m){return console.error(m),!1}finally{a.table.loading=!1}}catch{return!1}}),i==="treeSelect"&&(l.options.treeSelect.rowKey=o.option.table?.rowKey,l.options.treeSelect.nodeKey=o.option.table?.rowKey)};o.option.column.forEach(n),o.option.table?.column?.forEach(n)},initColumnForm:()=>{const a=t(),d=o.option;a.update.formColumn=[],a.update.formGrid=[],a.update.formMaxSpan=12,a.table.column.show={list:[],listSource:[]};const n=o.option.form?.maxSpan||12,l=o.option.form?.defaultSpan||n/2,i=me(o.option.form),f=m=>{if(m.children){a.table.column.show.list.push(m.key),m.children.forEach(g=>f(g));return}a.update.formDefault[m.key]=m.value,m.table?.table&&(m.show?.table&&a.table.column.show.list.push(m.key),a.table.column.show.listSource.push(m.key))};d.column.forEach(m=>{q(m,!0),f(m)}),o.option.table?.column?.forEach(m=>{q(m,!1),f(m)}),a.search.column.list=d.column.concat(d.table?.column||[]),a.table.column.list=a.search.column.list.filter(m=>m.table?.table),a.search.column.list.sort((m,g)=>m.sort?.search-g.sort?.search),a.table.column.list.sort((m,g)=>m.sort?.table-g.sort?.table),a.update.rules={},Y(d.column,a.update.formDefault,a.update.rules,m=>i(m,()=>a.update.form)),d.table?.editMode&&Y(d.table?.column||[],a.update.formDefault,a.update.rules,m=>i(m,()=>a.update.form));const s=de(d.column,{maxSpan:n,defaultSpan:l,layout:o.option.form?.layout});a.update.formGrid=s.cells,a.update.formMaxSpan=s.maxSpan,a.update.formColumn=le(s.cells);const c=o.option.search?.formDefault;c&&Object.keys(c).forEach(m=>{a.search.formDefault[m]=c[m]}),d.column.forEach(m=>{m.show?.search||(a.search.formDefault[m.key]=void 0)});const u=ObjectUtil.deepMerge(a.search.formDefault,{});T.setValue(a.search.form,u,!0)}}),Ye=t=>{const o=e.ref(),r=e.ref(),a=e.ref(),d={switchConfirmRef:o,ruleFormRef:r,tableRef:a},n=e.getCurrentInstance(),l=J.Scope.getConf("curdConf"),i=u=>{u=u||s;let m=u,g=u;for(;m?.parentCurdConf;)g=m.parentCurdConf,m=m.parentCurdConf;return g},f=()=>s;let s=e.reactive({parentCurdConf:l,getCurdConf:i,getRootCurdConf:i,...Ke(),option:t.option,...Ge(f,t),...Pe(f,t),...We(f,t,d),...qe(f,t),...Je(f,t),...ze(f,t,d),...Qe(f,t),...Xe(f,t,d)});s.init();const c=n?`curdRef-${n.uid}`:"";return l?.formRef&&c&&(l.formRef.set(c,{validate:async u=>{const m=await s.update.validate(!1);if(u?.(!!m),!m)throw!1;return!0}}),e.onUnmounted(()=>{l.formRef.remove(c)})),e.onMounted(()=>{t.option.init!==!1&&s.table.getList()}),J.Scope.setConf("curdConf",s),{conf:s,switchConfirmRef:o,ruleFormRef:r,tableRef:a}},Ze={class:"dialog-footer"},ve=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:o}){const r=e.ref(!1),a=e.ref("确认修改"),d=e.ref("确认要修改状态吗?");let n=null,l=null;const i=c=>(c?.title&&(a.value=c.title),c?.content&&(d.value=c.content),r.value=!0,new Promise((u,m)=>{n=u,l=m})),f=()=>{r.value=!1,n?.(!0),n=null,l=null},s=()=>{r.value=!1,l?.(new Error("用户取消操作")),n=null,l=null};return o({open:i}),(c,u)=>{const m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(y.ElDialog),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=g=>r.value=g),title:a.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(m,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",Ze,[e.createVNode(e.unref(y.ElButton),{onClick:s},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(y.ElButton),{type:"primary",onClick:f},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(d.value),1)]),_:1},8,["modelValue","title"])}}}),_e=["innerHTML"],et=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(t){const o=t,r=e.computed(()=>typeof o.content=="function"?o.content(o.value):o.content);return(a,d)=>typeof r.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:r.value},null,8,_e))}}),ye=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(t){const o=t,r=e.computed({get:()=>o.conf.search.form?.[o.item?.key],set:a=>{o.item?.key!==void 0&&(o.conf.search.form[o.item.key]=a)}});return(a,d)=>e.unref(M).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[t.type??""]?.search),e.mergeProps({key:0,modelValue:r.value,"onUpdate:modelValue":d[0]||(d[0]=n=>r.value=n)},t.item.options?.search?.[t.type??""],e.toHandlers(t.item.options?.search?.[t.type??""]?.on||{})),null,16,["modelValue"])):t.type==="input"?(e.openBlock(),e.createBlock(e.unref(y.ElInput),e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":d[1]||(d[1]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.input||t.item.options?.input,e.toHandlers(t.item.options?.search?.input?.on||t.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(y.ElSelect),e.mergeProps({key:2,modelValue:r.value,"onUpdate:modelValue":d[2]||(d[2]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.switch||t.item.options?.switch,e.toHandlers(t.item.options?.search?.switch?.on||t.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(y.ElOption),{key:t.item.options?.switch?.activeValue,label:t.item.options?.switch?.activeText,value:t.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(y.ElOption),{key:t.item.options?.switch?.inactiveValue,label:t.item.options?.switch?.inactiveText,value:t.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(y.ElSelect),e.mergeProps({key:3,modelValue:r.value,"onUpdate:modelValue":d[3]||(d[3]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.select||t.item.options?.select,e.toHandlers(t.item.options?.search?.select?.on||t.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.search?.select?.data||t.item.options?.select?.data||[],n=>(e.openBlock(),e.createBlock(e.unref(y.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="radio"?(e.openBlock(),e.createBlock(e.unref(y.ElRadioGroup),e.mergeProps({key:4,modelValue:r.value,"onUpdate:modelValue":d[4]||(d[4]=n=>r.value=n),disabled:t.item.disabled?.search},t.item.options?.search?.radio||t.item.options?.radio,e.toHandlers(t.item.options?.search?.radio?.on||t.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.radio?.data,n=>(e.openBlock(),e.createBlock(e.unref(y.ElRadio),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(y.ElDatePicker),e.mergeProps({key:5,modelValue:r.value,"onUpdate:modelValue":d[5]||(d[5]=n=>r.value=n),disabled:t.item.disabled?.search},t.item.options?.search?.datetime||t.item.options?.datetime,e.toHandlers(t.item.options?.search?.datetime?.on||t.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):t.type&&e.unref(M).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[t.type]),e.mergeProps({key:6,modelValue:r.value,"onUpdate:modelValue":d[6]||(d[6]=n=>r.value=n)},t.item.options?.search?.[t.type]||t.item.options?.[t.type],e.toHandlers(t.item.options?.search?.[t.type]?.on||t.item.options?.[t.type]?.on||{}),{disabled:t.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),H=(t,o)=>{const r=t.__vccOpts||t;for(const[a,d]of o)r[a]=d;return r},tt={},ot={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function nt(t,o){return e.openBlock(),e.createElementBlock("svg",ot,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)])])}const at=H(tt,[["render",nt]]),rt={},lt={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function it(t,o){return e.openBlock(),e.createElementBlock("svg",lt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)])])}const dt=H(rt,[["render",it]]),ct={},st={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ft(t,o){return e.openBlock(),e.createElementBlock("svg",st,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const mt=H(ct,[["render",ft]]),gt={},ut={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ht(t,o){return e.openBlock(),e.createElementBlock("svg",ut,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const yt=H(gt,[["render",ht]]),pt={},bt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function kt(t,o){return e.openBlock(),e.createElementBlock("svg",bt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)])])}const wt=H(pt,[["render",kt]]),Ct={},Bt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Vt(t,o){return e.openBlock(),e.createElementBlock("svg",Bt,[...o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)])])}const xt=H(Ct,[["render",Vt]]),Et={class:"row flex-center table-header-label inline"},St={class:"table-header-tooltip"},Nt=["innerHTML"],Ft={key:1,class:"table-header-required"},Dt=["onClick"],zt={key:0,class:"table-edit-form"},$t={key:1},Mt=["onClick","innerHTML"],Ot=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const o=w.isFun,r=t,d=e.getCurrentInstance().type,n=i=>i===!0?!0:(Array.isArray(i)?i:i?[i]:[]).some(s=>s?.required===!0),l=i=>r.option.table?.editMode?n(i.rules)||n(r.conf.update.rules?.[i.key]):!1;return(i,f)=>{const s=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[t.conf.table.column.show.list.includes(c.key)&&(c.show?.table===void 0||e.unref(o)(c.show?.table,t.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.table?.header?.groupKey===void 0||c.table.header.show?(e.openBlock(),e.createBlock(e.unref(y.ElTableColumn),e.mergeProps({key:0,prop:c.key,label:c.label},{ref_for:!0},c.table),{header:e.withCtx(()=>[e.renderSlot(i.$slots,"table-header-"+c.key,{item:c},()=>[e.createElementVNode("div",Et,[c.table?.header?.tooltip?(e.openBlock(),e.createBlock(s,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:c.table?.header?.tooltip},null,8,Nt)]),default:e.withCtx(()=>[e.createElementVNode("span",St,[e.createVNode(yt)])]),_:2},1024)):e.createCommentVNode("",!0),l(c)?(e.openBlock(),e.createElementBlock("span",Ft,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(c.label)+" ",1),c.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:2,class:"table-header-plus",onClick:e.withModifiers(()=>{c.table.header.group=!c.table.header.group,t.columnList.forEach(u=>{u.table?.header?.groupKey===c.key&&(u.table.header.show=!c.table.header.group)})},["stop"])},[c.table.header.group?(e.openBlock(),e.createBlock(wt,{key:0})):(e.openBlock(),e.createBlock(xt,{key:1}))],8,Dt)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:u})=>[c.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f[0]||(f[0]=e.createTextVNode("   ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(d)),{conf:t.conf,columnList:c.children,option:t.option},e.createSlots({_:2},[e.renderList(i.$slots,(m,g)=>({name:g,fn:e.withCtx(p=>[e.renderSlot(i.$slots,g,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",zt,[e.createVNode(e.unref(y.ElFormItem),{size:t.option.size?.table,error:t.conf.tableEditValidate.getFieldError(u,c),class:"table-edit-form-item"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["row",["table-edit-"+c.key]]),style:{width:"100%"}},[e.renderSlot(i.$slots,"table-edit-left-"+c.key,{row:u,item:c}),c.type==="input"?(e.openBlock(),e.createBlock(e.unref(y.ElInput),e.mergeProps({key:0,modelValue:u[c.key],"onUpdate:modelValue":m=>u[c.key]=m,disabled:t.conf.update.getDisabled(c,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(c),e.toHandlers(t.conf.update.getOn(c,u)),{"onUpdate:modelValue":m=>t.conf.tableEditValidate.clearField(u,c)}),e.createSlots({_:2},[c.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof c.options?.input?.prepend=="function"?c.options?.input?.prepend(u):c.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):c.type==="select"?(e.openBlock(),e.createBlock(e.unref(y.ElSelect),e.mergeProps({key:1,modelValue:u[c.key],"onUpdate:modelValue":m=>u[c.key]=m,disabled:t.conf.update.getDisabled(c,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(c),e.toHandlers(t.conf.update.getOn(c,u)),{"onUpdate:modelValue":m=>t.conf.tableEditValidate.clearField(u,c)}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options?.search?.select?.data||c.options?.select?.data,m=>(e.openBlock(),e.createBlock(e.unref(y.ElOption),{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.type==="switch"?(e.openBlock(),e.createBlock(e.unref(y.ElSwitch),e.mergeProps({key:2,modelValue:u[c.key],"onUpdate:modelValue":m=>u[c.key]=m,disabled:t.conf.update.getDisabled(c,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(c),e.toHandlers(t.conf.update.getOn(c,u)),{"onUpdate:modelValue":m=>t.conf.tableEditValidate.clearField(u,c)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"table-edit-right-"+c.key,{row:u,item:c})],2)]),_:2},1032,["size","error"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(w).EDialog.Update&&e.unref(o)(c.show?.form,t.conf.update.form,e.unref(w).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===u[t.option.table?.rowKey]&&(c.type==="input"||c.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.type==="input"?(e.openBlock(),e.createBlock(e.unref(y.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[c.key],"onUpdate:modelValue":m=>t.conf.update.form[c.key]=m,disabled:t.conf.update.getDisabled(c,!0)},{ref_for:!0},t.conf.update.getBind(c),e.toHandlers(t.conf.update.getOn(c,u)),{style:{width:"100%"}}),e.createSlots({_:2},[c.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof c.options?.input?.prepend=="function"?c.options?.input?.prepend(u):c.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):c.type==="select"?(e.openBlock(),e.createBlock(e.unref(y.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[c.key],"onUpdate:modelValue":m=>t.conf.update.form[c.key]=m,disabled:t.conf.update.getDisabled(c,!0)},{ref_for:!0},t.conf.update.getBind(c),e.toHandlers(t.conf.update.getOn(c,u)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options?.search?.select?.data||c.options?.select?.data,m=>(e.openBlock(),e.createBlock(e.unref(y.ElOption),{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.type==="switch"?(e.openBlock(),e.createBlock(e.unref(y.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[c.key],"onUpdate:modelValue":m=>t.conf.update.form[c.key]=m},{ref_for:!0},t.conf.update.getBind(c),e.toHandlers(t.conf.update.getOn(c,u)),{disabled:t.conf.update.getDisabled(c,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(i.$slots,"table-"+c.key,{key:1,row:u,item:c},()=>[e.unref(M).customComponent[c.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(M).customComponent[c.type??""]?.table),e.mergeProps({key:0,modelValue:u[c.key],"onUpdate:modelValue":m=>u[c.key]=m},{ref_for:!0},c.options?.[c.type??""],e.toHandlers(c.options?.[c.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):c.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(y.ElSwitch),e.mergeProps({key:0,modelValue:u[c.key],"onUpdate:modelValue":m=>u[c.key]=m,loading:c.options?.switch?.loadingMap?.[u[t.option.table?.rowKey]]?.loading,"before-change":()=>c.options?.switch?.tableBeforeChange?.(c.key,u)},{ref_for:!0},c.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",$t,e.toDisplayString(u[c.key]===c.options?.switch?.activeValue?c.options?.switch?.activeText:c.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":c.table?.click?.color}),class:e.normalizeClass({"table-text-click":c.table?.click?.callback}),onClick:m=>c.table?.click?.callback?.(u),innerHTML:c.table?.format?c.table?.format(u):u[c.key]},null,14,Mt))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),Rt={key:0,class:"relative curd-search fit-width"},Tt={class:"mb-10 flex justify-between items-center fit-width"},Ut={class:"flex items-center",style:{gap:"10px"}},At={key:0},Lt={key:1},Ht={key:2},jt={class:"export-btn"},It={key:1,class:"export-btn"},Kt={class:"flex items-center table-tools-right",style:{gap:"10px"}},Gt={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Pt={class:"dialog-footer"},Wt={key:0},qt={key:1},Jt={class:"dialog-footer"},pe=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:void 0},searchForm:{default:void 0}},setup(t,{expose:o}){const r=w.EDialog,a=t,d=w.isFun,{conf:n,switchConfirmRef:l,ruleFormRef:i,tableRef:f}=Ye(a);return o({conf:n}),(s,c)=>{const u=e.resolveComponent("el-tooltip"),m=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(s.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Rt,[e.createVNode(e.unref(y.ElForm),{model:e.unref(n).search.form,inline:"",size:t.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"search-start",{row:e.unref(n).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).search.column.list,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.key},[e.renderSlot(s.$slots,"search-"+g.key+"-start",{row:e.unref(n).search.form}),(typeof g.show?.search=="function"?g.show?.search(e.unref(n).search.form):g.show?.search)?(e.openBlock(),e.createBlock(e.unref(y.ElFormItem),{key:0,label:g.text?.search?.label??g.label},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"search-"+g.key+"-left",{row:e.unref(n).search.form}),e.renderSlot(s.$slots,"search-"+g.key,{row:e.unref(n).search.form},()=>[g.options?.search?.type?(e.openBlock(),e.createBlock(ye,{key:0,item:g,conf:e.unref(n),type:g.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(ye,{key:1,item:g,conf:e.unref(n),type:g.type},null,8,["item","conf","type"]))]),e.renderSlot(s.$slots,"search-"+g.key+"-right",{row:e.unref(n).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"search-"+g.key+"-end",{row:e.unref(n).search.form})],64))),128)),e.renderSlot(s.$slots,"search-center",{row:e.unref(n).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(y.ElFormItem),{key:0},{default:e.withCtx(()=>[t.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:0,type:"primary",onClick:e.unref(n).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:1,onClick:e.unref(n).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"search-end",{row:e.unref(n).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Tt,[e.createElementVNode("div",Ut,[e.unref(d)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(y.ElButton),{type:"primary",onClick:c[0]||(c[0]=g=>e.unref(n).update.open(e.unref(r).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(d)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(y.ElButton),{type:"danger",onClick:c[1]||(c[1]=g=>e.unref(n).remove.open(e.unref(n).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Ht,[e.createVNode(e.unref(y.ElButton),{type:"warning",onClick:c[2]||(c[2]=g=>e.unref(n).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(y.ElDropdown),{key:0,onCommand:e.unref(n).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(y.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(d)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(y.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(y.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(y.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",jt,[e.createVNode(e.unref(y.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",It,[e.createVNode(e.unref(y.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:t.option.size?.search,onClick:c[3]||(c[3]=g=>e.unref(n).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"tools-left")]),e.createElementVNode("div",Kt,[e.renderSlot(s.$slots,"tools-right"),e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(y.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":c[4]||(c[4]=g=>e.unref(n).page.num=g),"page-size":e.unref(n).page.size,"onUpdate:pageSize":c[5]||(c[5]=g=>e.unref(n).page.size=g),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:t.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.expandColumn===void 0||t.option.tools?.expandColumn?(e.openBlock(),e.createBlock(u,{key:1,effect:"dark",content:e.unref(n).table.header.group.expand?e.unref(k).tCurd("mergeColumn"):e.unref(k).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:c[6]||(c[6]=(...g)=>e.unref(n).table.header.group.toggleExpandAll&&e.unref(n).table.header.group.toggleExpandAll(...g))},[e.unref(n).table.header.group.expand?(e.openBlock(),e.createBlock(at,{key:0})):(e.openBlock(),e.createBlock(dt,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:c[7]||(c[7]=(...g)=>e.unref(n).table.getList&&e.unref(n).table.getList(...g))},[e.createVNode(mt)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":"",t.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(y.ElTable),e.mergeProps({ref_key:"tableRef",ref:f,data:e.unref(n).table.data,border:t.option.table?.border===void 0?!0:t.option.table?.border,onSelectionChange:e.unref(n).table.selection.change,onSortChange:e.unref(n).table.sort.change,"expand-row-keys":e.unref(n).table.expand.rowKeys,onExpandChange:e.unref(n).table.expand.change},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(d)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(y.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof t.option.table?.index=="object"?t.option.table?.index?.show:t.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(y.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof t.option.table?.index=="object"?t.option.table?.index:{},e.toHandlers(typeof t.option.table?.index=="object"?t.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(Ot,{conf:e.unref(n),columnList:e.unref(n).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(s.$slots,(g,p)=>({name:p,fn:e.withCtx(B=>[e.renderSlot(s.$slots,p,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1032,["conf","columnList","option"]),e.unref(d)(t.option.table?.add)||e.unref(d)(t.option.table?.update)||e.unref(d)(t.option.table?.delete)||e.unref(d)(t.option.table?.view)||s.$slots["table-op-left"]||s.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(y.ElTableColumn),e.mergeProps({key:2,align:"center",fixed:"right"},t.option.table?.operate,{width:t.option.table?.operate?.width||120,"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(s.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("operation")),1)])]),default:e.withCtx(({row:g})=>[e.createVNode(e.unref(y.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"table-op-left",{row:g}),e.unref(n).update.type===e.unref(r).Update&&t.option.table?.inlineEdit&&e.unref(n).update.form[a.option.table?.rowKey]===g[a.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(y.ElButton),{link:"",type:"info",onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(y.ElButton),{link:"",type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(s.$slots,"table-op-edit-right",{row:g})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(d)(t.option.table?.add,g)?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:0,link:"",type:"primary",onClick:p=>e.unref(n).update.open(e.unref(r).Add,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(d)(t.option.table?.view,g)?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:1,link:"",type:"primary",onClick:p=>e.unref(n).update.open(e.unref(r).View,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(d)(t.option.table?.update,g)?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:2,link:"",type:"warning",onClick:p=>e.unref(n).update.open(e.unref(r).Update,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(d)(t.option.table?.delete,g)?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:3,link:"",type:"danger",onClick:p=>e.unref(n).remove.open([g])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"table-op-right",{row:g})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[m,e.unref(n).table.loading]])],2)],2),e.createElementVNode("div",Gt,[(t.option.page?.show===void 0||t.option.page?.show)&&!e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(y.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":c[8]||(c[8]=g=>e.unref(n).page.num=g),"page-size":e.unref(n).page.size,"onUpdate:pageSize":c[9]||(c[9]=g=>e.unref(n).page.size=g),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:t.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(s.$slots,"box-right")],2),e.createVNode(e.unref(y.ElDialog),e.mergeProps({modelValue:e.unref(n).update.show,"onUpdate:modelValue":c[10]||(c[10]=g=>e.unref(n).update.show=g),title:e.unref(n).update.title,"before-close":e.unref(n).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Pt,[e.createVNode(e.unref(y.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"dialog-footer",{row:e.unref(n).update},()=>[e.createVNode(e.unref(y.ElButton),{onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(n).update.type!==e.unref(r).View?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:0,type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),_:3},8,["size"])])]),default:e.withCtx(()=>[e.renderSlot(s.$slots,"dialog-start",{row:e.unref(n).update}),e.createVNode(e.unref(y.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(n).update.form,rules:e.unref(n).update.rules,size:t.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(n).update.showContent?(e.openBlock(),e.createBlock(ge,{key:0,"form-grid":e.unref(n).update.formGrid,"max-span":e.unref(n).update.formMaxSpan,form:e.unref(n).update.form,type:e.unref(n).update.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth,"form-option":t.option.form,"get-bind":e.unref(n).update.getBind,"get-on":e.unref(n).update.getOn,"get-disabled":e.unref(n).update.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(g,p)=>({name:p,fn:e.withCtx(B=>[e.renderSlot(s.$slots,p,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"]),e.renderSlot(s.$slots,"dialog-end",{row:e.unref(n).update})]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(y.ElDialog),{modelValue:e.unref(n).remove.show,"onUpdate:modelValue":c[11]||(c[11]=g=>e.unref(n).remove.show=g),title:e.unref(n).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Jt,[e.createVNode(e.unref(y.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(y.ElButton),{onClick:e.unref(n).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(y.ElButton),{type:"danger",onClick:e.unref(n).remove.submit,loading:e.unref(n).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[t.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(et,{content:t.option.dialog?.delete?.content,value:e.unref(n).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",qt,e.toDisplayString(e.unref(k).tCurd("confirmDeleteMessage",e.unref(n).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(ve,{ref_key:"switchConfirmRef",ref:l,size:t.option.size?.form},null,8,["size"])],2)}}});class Qt{static async download(o,r="download.png"){const a=document.createElement("a");a.style.display="none",a.href=o,a.setAttribute("download",r),typeof a.download>"u"&&a.setAttribute("target","_blank"),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(o)}static exportJSONFile=(o,r)=>{const a=new Blob([JSON.stringify(o)],{type:"application/json"}),d=URL.createObjectURL(a),n=document.createElement("a");n.href=d,n.download=`${r||"config"}.json`,n.click()};static importFile=async o=>new Promise((r,a)=>{const d=document.createElement("input");d.type="file";const n=o?.accept||".json";d.accept=n,d.style.display="none",d.onchange=l=>{const i=l.target.files[0];if(!i){w.fail("未选择文件"),a("未选择文件");return}const f=new FileReader;f.onload=async s=>{const c=n==".json"?JSON.parse(s.target.result):s.target.result;r(c)},f.onerror=()=>{w.fail("文件读取失败"),a("文件读取失败")},f.readAsText(i),document.body.removeChild(d)},document.body.appendChild(d),d.click()})}const be=(t,o)=>{if(t.component("TCurd",pe),t.component("TFormList",Q),t.component("TColumn",ue),o?.customComponent){M.customComponent=o.customComponent;for(const r in o.customComponent)t.component(r,o.customComponent[r])}},Xt={install:be};F.ArrUtil=R,F.ExcelUtil=he,F.TColumn=ue,F.TCurd=pe,F.TFile=Qt,F.TForm=M,F.TFormConfig=E,F.TFormI18n=k,F.TFormList=Q,F.TSys=w,F.default=Xt,F.install=be,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -12,7 +12,6 @@ type __VLS_Props = {
12
12
  getDisabled: (item: CurdConfigColumn) => any;
13
13
  };
14
14
  declare const formItemRef: import("vue").Ref<any, any>;
15
- declare const getValidateAfterErrorOn: (item: CurdConfigColumn) => any;
16
15
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
17
16
  declare var __VLS_8: string, __VLS_9: {
18
17
  row: Record<string, any>;
@@ -61,7 +60,6 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
61
60
  ElColorPicker: typeof ElColorPicker;
62
61
  ElSlider: typeof ElSlider;
63
62
  formItemRef: typeof formItemRef;
64
- getValidateAfterErrorOn: typeof getValidateAfterErrorOn;
65
63
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
66
64
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
67
65
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -57,9 +57,10 @@ export declare const buildFormColumnEntry: (item: CurdConfigColumn & {
57
57
  }, options: FormGridOptions) => CurdFormColumn | null;
58
58
  export declare const appendFormColumnToRows: (rows: CurdFormColumn[][], currentRow: CurdFormColumn[], entry: CurdFormColumn, maxSpan: number) => CurdFormColumn<any>[];
59
59
  export declare const buildFormColumnRows: (columns: CurdConfigColumn[], options?: FormGridOptions) => CurdFormColumn[][];
60
- export declare const createFormRulesHandler: (getRequiredMessage: (item: CurdConfigColumn) => string) => (item: CurdConfigColumn, form: Record<string, any>) => any[] | undefined;
60
+ type FormRulesSource = Record<string, any> | (() => Record<string, any>);
61
+ export declare const createFormRulesHandler: (getRequiredMessage: (item: CurdConfigColumn) => string) => (item: CurdConfigColumn, formSource: FormRulesSource) => any[] | undefined;
61
62
  export declare const getDefaultFormRequiredMessage: (item: CurdConfigColumn, error?: (key: string, item: CurdConfigColumn) => string) => string;
62
- export declare const createDefaultFormRulesHandler: (formOption: StandaloneFormOption | undefined) => (item: CurdConfigColumn, form: Record<string, any>) => any[] | undefined;
63
+ export declare const createDefaultFormRulesHandler: (formOption: StandaloneFormOption | undefined) => (item: CurdConfigColumn, formSource: FormRulesSource) => any[] | undefined;
63
64
  export type StandaloneFormOption = {
64
65
  maxSpan?: number;
65
66
  defaultSpan?: number;
@@ -69,7 +70,7 @@ export type StandaloneFormOption = {
69
70
  error?: (key: string, item: CurdConfigColumn) => string;
70
71
  };
71
72
  /** 独立表单(TColumn)初始化 */
72
- export declare const initStandaloneFormState: (columns: CurdConfigColumn[], formOption: StandaloneFormOption | undefined, form: Record<string, any>) => {
73
+ export declare const initStandaloneFormState: (columns: CurdConfigColumn[], formOption: StandaloneFormOption | undefined, form: FormRulesSource) => {
73
74
  formDefault: Record<string, any>;
74
75
  rules: Record<string, any>;
75
76
  formGrid: CurdFormGridCell<any>[];