cc1-form 1.3.7 → 1.3.8

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,7 @@
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,Zt,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 O{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=O.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),O.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 we={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},Ce={key:0},Be={class:"row items-center",style:{gap:"10px",width:"100%"}},Ve={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",we,[e.renderSlot(n.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ce,[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",Be,[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",Ve,[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)}}}),xe={class:"row form-item-content",style:{width:"100%"}},Ee={class:"col column form-item-content-item"},Se={class:"col"},Ne=["innerHTML"],Fe=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",xe,[e.renderSlot(n.$slots,"form-"+t.item.key+"-start",{row:t.form,item:t.item}),e.createElementVNode("div",Ee,[e.createElementVNode("div",Se,[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(O).customComponent[t.item.type]||e.unref(O).customComponent[t.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(O).customComponent[t.item.type]?.form||e.unref(O).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,Ne)):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 vt(t){return t}const De={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=De}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||""})})},ze=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:ze(a)}))),W=w.EDialog,A=t=>typeof t.type=="object"?"component":t.type||"input",$e=(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):oe(l,f.update.type,f.update.form)},getBind:l=>{const i=t();return ne(l,i.update.type)},getOn:(l,i)=>{const f=t();return ae(l,f.update.type,[i||f.update.form,l])},getOptions:l=>{const i=t();try{const s=de(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)}}}},M=12,q=(t,o)=>{t.isForm=o,Array.isArray(t.children)&&t.children.forEach(r=>q(r,o))},Me=t=>t.isForm===!1?!1:typeof t.show?.form=="boolean"?t.show.form:!0,ee=t=>t>M?Math.floor(t/2):t,Oe=(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.form.span),t.form.span),te=t=>{const o=t.form;return o?.row!=null&&o.row>0?ee(o.row):M},L=t=>Math.floor((t.gridRow-1)/M),oe=(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)},ne=(t,o)=>{const r=A(t);return t.options?.[o===w.EDialog.Add?"formAdd":"formUpdate"]?.[r]||t.options?.[r]||{}},ae=(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},re=(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},Re=(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})},le=(t,o,r={})=>{const a=new Set,d=[];let n=0,l=0;const i=g=>Math.floor(g/M)*M,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*M;x+=M){const K=x+M,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<M&&g+S<V+M){n=g+S,l=p;return}const x=p+B;if(x<o){l=x,n=V;return}l=0,n=V+M};return t.forEach(g=>{const p=g.colSpan??(g.span===0?o:g.span),B=g.rowSpan??te(g.item);g.item.form?.rowBreak&&d.length&&(l=0,n=i(n)+M);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?Re(d,o):d},X=(t,o,r,a=M)=>{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===M&&i.every(m=>m.rowSpan<M)))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:M})}),le(d.map(i=>l.get(i.item.key)||i),a,{fillSingleRows:!0})},ie=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))},de=t=>t?.length?Array.isArray(t[0])?t.flat():t:[],Te=(t,o)=>{if(!Me(t)||!t.key)return null;const r=o.defaultSpan??(o.maxSpan||12)/2,a=Oe(t,r,o.layout);return{item:t,span:a}},Ue=(t,o={})=>{const r=[],a=d=>{if(d.children?.length){d.children.forEach(l=>a(l));return}const n=Te(d,o);n&&r.push(n)};return t.forEach(d=>a(d)),r},ce=(t,o={})=>{const r=o.maxSpan??12,a=o.defaultSpan??r/2,d=o.layout??"row",l=Ue(t,{maxSpan:r,defaultSpan:a,layout:d});if(d==="column"){const i=[];let f=1;return l.forEach(s=>{const c=te(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:le(l,r),maxSpan:r}},Ae=t=>t.map(o=>o.item?.show?.form),Le=(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},se=t=>typeof t=="function"?t():t,fe=t=>(o,r)=>Le(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=se(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=se(r);return n(l,d(i,s),f,c||s)}}}return a}),me=(t,o)=>{const r={input:k.tCurd("placeholderInput"),select:k.tCurd("placeholderSelect")},a=(r[A(t)||"input"]||r.input)+t.label;return(o||O.error.callback)?.(t.key,t)||a},ge=t=>fe(o=>me(o,t?.error)),He=(t,o,r)=>{const a={},d={},n=o?.maxSpan||12,l=o?.defaultSpan||n/2,i=ge(o);t.forEach(c=>q(c,!0)),Y(t,a,d,c=>i(c,r));const{cells:f,maxSpan:s}=ce(t,{maxSpan:n,defaultSpan:l,layout:o?.layout});return{formDefault:a,rules:d,formGrid:f,formMaxSpan:s,formColumn:ie(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)},je={class:"curd-form-cell-inner"},ue=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>=M,s=m=>{const g=m.gridBand??L(m);return d.value.get(g)??g},c=m=>re(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(Ae)(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",je,[e.unref(o)(p.item.show?.form,t.form,t.type)?(e.openBlock(),e.createBlock(Fe,{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)}}),he=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=>oe(s,f.type,f.form),getBind:s=>ne(s,f.type),getOn:s=>ae(s,f.type,[f.form,s]),initColumnForm:()=>{const s=n,c=He(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(ue,{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"]))}}),Ie=t=>t?.value||t,Ke=t=>{const o=Ie(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)},Ge=()=>{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=>Ke(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},Pe=(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()}}}},We=(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()}}}}),qe=(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=de(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()}}}}),Je=(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=>me(h,o.option.form?.error),s=fe(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 ye{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 Qe=(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),ye.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)}}}),Xe=(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}})}}}),Ye=(t,o,r)=>({apiDataMap:{},getColumnSpan:(a,d)=>{const n=t(),l=n.update.formGrid?.length?n.update.formGrid:d||[];return re(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=ge(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=ce(d.column,{maxSpan:n,defaultSpan:l,layout:o.option.form?.layout});a.update.formGrid=s.cells,a.update.formMaxSpan=s.maxSpan,a.update.formColumn=ie(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)}}),Ze=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,...Ge(),option:t.option,...Pe(f,t),...We(f,t),...qe(f,t,d),...Je(f,t),...Qe(f,t),...$e(f,t,d),...Xe(f,t),...Ye(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}},ve={class:"dialog-footer"},_e=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",ve,[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"])}}}),et=["innerHTML"],tt=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,et))}}),pe=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(O).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(O).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(O).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(O).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},ot={},nt={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function at(t,o){return e.openBlock(),e.createElementBlock("svg",nt,[...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 rt=H(ot,[["render",at]]),lt={},it={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function dt(t,o){return e.openBlock(),e.createElementBlock("svg",it,[...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 ct=H(lt,[["render",dt]]),st={},ft={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function mt(t,o){return e.openBlock(),e.createElementBlock("svg",ft,[...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 gt=H(st,[["render",mt]]),ut={},ht={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function yt(t,o){return e.openBlock(),e.createElementBlock("svg",ht,[...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 pt=H(ut,[["render",yt]]),bt={},kt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function wt(t,o){return e.openBlock(),e.createElementBlock("svg",kt,[...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 Ct=H(bt,[["render",wt]]),Bt={},Vt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function xt(t,o){return e.openBlock(),e.createElementBlock("svg",Vt,[...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 Et=H(Bt,[["render",xt]]),St={class:"row flex-center table-header-label inline"},Nt={class:"table-header-tooltip"},Ft=["innerHTML"],Dt={key:1,class:"table-header-required"},zt=["onClick"],$t={key:0,class:"table-edit-form"},Mt={key:1},Ot=["onClick","innerHTML"],Rt=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",St,[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,Ft)]),default:e.withCtx(()=>[e.createElementVNode("span",Nt,[e.createVNode(pt)])]),_:2},1024)):e.createCommentVNode("",!0),l(c)?(e.openBlock(),e.createElementBlock("span",Dt,"*")):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(Ct,{key:0})):(e.openBlock(),e.createBlock(Et,{key:1}))],8,zt)):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",$t,[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(O).customComponent[c.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(O).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",Mt,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,Ot))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),Tt={key:0,class:"relative curd-search fit-width"},Ut={class:"mb-10 flex justify-between items-center fit-width"},At={class:"flex items-center",style:{gap:"10px"}},Lt={key:0},Ht={key:1},jt={key:2},It={class:"export-btn"},Kt={key:1,class:"export-btn"},Gt={class:"flex items-center table-tools-right",style:{gap:"10px"}},Pt={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Wt={class:"dialog-footer"},qt={key:0},Jt={key:1},Qt={class:"dialog-footer"},be=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}=Ze(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",Tt,[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(pe,{key:0,item:g,conf:e.unref(n),type:g.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(pe,{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",Ut,[e.createElementVNode("div",At,[e.unref(d)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Lt,[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",Ht,[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",jt,[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",It,[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",Kt,[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",Gt,[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(rt,{key:0})):(e.openBlock(),e.createBlock(ct,{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(gt)],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(Rt,{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",Pt,[(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",Wt,[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(ue,{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",Qt,[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",qt,[e.createVNode(tt,{content:t.option.dialog?.delete?.content,value:e.unref(n).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Jt,e.toDisplayString(e.unref(k).tCurd("confirmDeleteMessage",e.unref(n).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(_e,{ref_key:"switchConfirmRef",ref:l,size:t.option.size?.form},null,8,["size"])],2)}}});class Xt{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 ke=(t,o)=>{if(t.component("TCurd",be),t.component("TFormList",Q),t.component("TColumn",he),o?.customComponent){O.customComponent=o.customComponent;for(const r in o.customComponent)t.component(r,o.customComponent[r])}},Yt={install:ke};F.ArrUtil=R,F.ExcelUtil=ye,F.TColumn=he,F.TCurd=be,F.TFile=Xt,F.TForm=O,F.TFormConfig=E,F.TFormI18n=k,F.TFormList=Q,F.TSys=w,F.default=Yt,F.install=ke,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(Y,b){typeof exports=="object"&&typeof module<"u"?b(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"],b):(Y=typeof globalThis<"u"?globalThis:Y||self,b(Y.cc1Form={},Y.ElementPlus,Y.VueRouter,Y.Vue,Y.cc1Vue3))})(this,(function(Y,b,ta,e,kt){"use strict";class N{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(t,...r)=>Array.isArray(t)?t.some(n=>typeof n=="function"?n(...r):n):typeof t=="function"?t(...r):t;static getRouterParams=()=>{const t=this.router.currentRoute.value.query||{},r=this.router.currentRoute.value.params||{};return Object.keys(t).length?t:Object.keys(r).length?r:{}};static moduleObj={};static loadModule=async t=>{if(!N.moduleObj[t])throw new Error(`模块${t}未加载,请赋值如:TSys.moduleObj = { ${t}: ()=>import('${t}') }`);const r=await N.moduleObj[t]();return r.default??r};static tipMessages={};static tipMessagesGap=500;static showMessage(t,r,n={}){const i=Date.now();if(!this.tipMessages[t]||i-this.tipMessages[t]>this.tipMessagesGap){this.tipMessages[t]=i;const o=Object.assign({message:t,type:r},n);b.ElMessage(o),setTimeout(()=>{delete this.tipMessages[t]},this.tipMessagesGap)}}static fail=(t,r={})=>{this.showMessage(t,"error",r)};static success=(t,r={})=>{this.showMessage(t,"success",r)};static loadingObj=null;static loadingTimer=null;static loading=(t=!0,r="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{t?this.loadingObj=b.ElLoading.service({lock:!0,text:r,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(t,r=!0)=>{if(r){let n=screen.width/2-500,i=screen.height/2-800/2-30;window.open(t,"_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(t,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=t=>new Promise(async(r,n)=>{let i=document.getElementById(t.id);const o=await N.loadModule("html2canvas");try{o(i,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:t.windowWidth,height:t.windowHeight,windowWidth:t.windowWidth,windowHeight:t.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(l){let s=l.toDataURL("image/png");r(s)})}catch(l){n(l)}})}class H{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,sortable:{show:!1,button:!1,saveButton:!0,width:54,label:"",fixed:"left",page:!1,scroll:!1,field:"sortNo",rule:"index",api:{}}},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=t=>{H.config=ObjectUtil.deepMerge(H.config,t)}}class v{static customComponent={};static error={};static findOptions=(t,r)=>{const n=t.column.find(o=>o.key===r),i=o=>o.replace(/-([a-z])/g,(l,s)=>s.toUpperCase());if(n)return n.options[i(n.type)]};static setOptionsData=(t,r,n)=>{const i=v.findOptions(t,r);i&&(i.data=n)};static form={openBefore:{parentId:(t,r,n,i)=>{const o=H.config.table.rowKey;t?r.type===N.EDialog.Add?(r.form.parentId=t[o],r.form.sort=t.children.length+1):r.form.parentId=t.parentId.substring(t.parentId.lastIndexOf(",")+1):(r.form.parentId="0",r.form.sort=n.length+1),v.setOptionsData(i,"parentId",[{[o]:"0",title:"根",children:n}])}}}}class he{static getIdFun=()=>StrUtil.uuid();static setId=(t,r,n)=>{r[t]||(r[t]=[]);const i=H.config.table.rowKey;r[t].forEach(o=>{n.forEach(l=>{let s=l.default??"";l.type==="number"&&(s=l.default??0),l.type==="boolean"&&(s=l.default??!1),l.type==="time"&&(s=l.default??new Date),o[l.value]===void 0&&(o[l.value]=s)}),o[i]||(o[i]=he.getIdFun())})};static add=(t,r,n,i)=>{const o=JSONUtil.cp(n);he.setId(t,r,n);const l=H.config.table.rowKey;r[t].push(o.reduce((s,c)=>{let f=c.default??"";return c.type==="number"&&(f=c.default??0),c.type==="boolean"&&(f=c.default??!1),c.type==="time"&&(f=c.default??new Date),s[c.value]=f,s},{[l]:he.getIdFun()})),i?.(r)};static remove=(t,r,n,i)=>{const o=H.config.table.rowKey;r[t]=r[t].filter(l=>l[o]!==n[o]),i?.(r)};static getNoIdData=(t,r)=>{const n=JSONUtil.cp(t),i=H.config.table.rowKey;return n.forEach(o=>{o[i]&&delete o[i],r&&o[r]&&he.getNoIdData(o[r],r)}),n}}const Uo={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},Ho={key:0},Po={class:"row items-center",style:{gap:"10px",width:"100%"}},jo={key:1},Ct=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(a,{emit:t}){const r=a,n=e.reactive({show:!1,add:(o,l,s)=>{he.add(o,l,s,()=>{i("change")})},remove:(o,l,s)=>{he.remove(o,l,s,()=>{i("change")})}});e.onMounted(()=>{he.setId(r.field,r.row,r.itemFields),n.show=!0});const i=t;return(o,l)=>{const s=e.resolveComponent("el-button"),c=e.resolveComponent("el-input");return n.show?(e.openBlock(),e.createElementBlock("div",Uo,[e.renderSlot(o.$slots,"list-start",{row:a.row}),a.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ho,[e.createVNode(s,{link:"",type:"primary",onClick:l[0]||(l[0]=f=>n.add(a.field,a.row,a.itemFields))},{default:e.withCtx(()=>l[3]||(l[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.row[a.field],f=>(e.openBlock(),e.createElementBlock("div",Po,[e.renderSlot(o.$slots,"item-start",{item:f,row:a.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.itemFields,d=>(e.openBlock(),e.createBlock(c,{modelValue:f[d.value],"onUpdate:modelValue":u=>f[d.value]=u,style:e.normalizeStyle({width:a.inputWidth}),class:e.normalizeClass(a.inputClass),placeholder:d[a.label]||d[a.value],onChange:l[1]||(l[1]=u=>i("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:f,row:a.row}),e.createVNode(s,{link:"",type:"danger",onClick:d=>n.remove(a.field,a.row,f)},{default:e.withCtx(()=>l[4]||(l[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),a.addBottom?(e.openBlock(),e.createElementBlock("div",jo,[e.createVNode(s,{link:"",type:"primary",onClick:l[2]||(l[2]=f=>n.add(a.field,a.row,a.itemFields))},{default:e.withCtx(()=>l[5]||(l[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:a.row})])):e.createCommentVNode("",!0)}}}),Ko={class:"row form-item-content",style:{width:"100%"}},Go={class:"col column form-item-content-item"},xo={class:"col"},Wo=["innerHTML"],Xo=e.defineComponent({__name:"field",props:{item:{},form:{},type:{},labelWidth:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(a){const t=a,r=e.ref(),n=()=>{const o=r.value?.validateState;return o&&typeof o=="object"&&"value"in o?o.value:o},i=()=>{n()==="error"&&r.value?.clearValidate?.()};return e.watch(()=>t.form?.[t.item.key],()=>{i(),e.nextTick(()=>i())},{deep:!0,flush:"post"}),(o,l)=>(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{ref_key:"formItemRef",ref:r,label:o.item.text?.form?.label??o.item.label,prop:o.item.key,"label-width":o.item.text?.form?.label==""?0:o.item.form?.labelWidth||o.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",Ko,[e.renderSlot(o.$slots,"form-"+o.item.key+"-start",{row:o.form,item:o.item}),e.createElementVNode("div",Go,[e.createElementVNode("div",xo,[e.renderSlot(o.$slots,"form-"+o.item.key,{row:o.form,item:o.item},()=>[o.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(b.ElInput),e.mergeProps({key:0,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[0]||(l[0]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),e.createSlots({_:2},[o.getBind(o.item).prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.getBind(o.item).prepend=="function"?o.getBind(o.item).prepend(o.form):o.getBind(o.item).prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):o.item.type==="number"?(e.openBlock(),e.createBlock(e.unref(b.ElInputNumber),e.mergeProps({key:1,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[1]||(l[1]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(b.ElInput),e.mergeProps({key:2,type:"textarea",modelValue:o.form[o.item.key],"onUpdate:modelValue":l[2]||(l[2]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),e.mergeProps({key:3,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[3]||(l[3]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(b.ElSelect),e.mergeProps({key:4,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[4]||(l[4]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.getBind(o.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(b.ElOption),e.mergeProps({key:s.value,ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):o.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(b.ElRadioGroup),e.mergeProps({key:5,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[5]||(l[5]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item),style:{width:"100%"}}),{default:e.withCtx(()=>[o.getBind(o.item).type==="group"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.getBind(o.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(b.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(o.getBind(o.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(b.ElRadio),e.mergeProps({key:s.value,ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):o.item.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(b.ElCheckboxGroup),e.mergeProps({key:6,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[6]||(l[6]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item),style:{width:"100%"}}),{default:e.withCtx(()=>[o.getBind(o.item).type==="group"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.getBind(o.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(b.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(o.getBind(o.item).data||[],s=>(e.openBlock(),e.createBlock(e.unref(b.ElCheckbox),e.mergeProps({key:s.value,ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):o.item.type==="color"?(e.openBlock(),e.createBlock(e.unref(b.ElColorPicker),e.mergeProps({key:7,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[7]||(l[7]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type==="slider"?(e.openBlock(),e.createBlock(e.unref(b.ElSlider),e.mergeProps({key:8,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[8]||(l[8]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type==="list"?(e.openBlock(),e.createBlock(Ct,e.mergeProps({key:9,row:o.form,field:o.item.key},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):o.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(b.ElTreeSelect),e.mergeProps({key:10,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[9]||(l[9]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):o.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(b.ElDatePicker),e.mergeProps({key:11,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[10]||(l[10]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type&&typeof o.item.type=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.item.type),e.mergeProps({key:12,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[11]||(l[11]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):o.item.type&&(e.unref(v).customComponent[o.item.type]||e.unref(v).customComponent[o.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).customComponent[o.item.type]?.form||e.unref(v).customComponent[o.item.type]),e.mergeProps({key:13,modelValue:o.form[o.item.key],"onUpdate:modelValue":l[12]||(l[12]=s=>o.form[o.item.key]=s)},o.getBind(o.item),e.toHandlers(o.getOn(o.item)),{disabled:o.getDisabled(o.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"form-"+o.item.key+"-right",{row:o.form,item:o.item})]),e.renderSlot(o.$slots,"form-"+o.item.key+"-tip",{row:o.form,item:o.item},()=>[o.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof o.item.form?.tipText=="function"?o.item.form?.tipText(o.form,o.type):o.item.form?.tipText},null,8,Wo)):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"form-"+o.item.key+"-end",{row:o.form,item:o.item})])]),_:3},8,["label","prop","label-width"]))}});function oa(a){return a}const Yo={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:"展开栏位",sortable:"拖拽进行排序,点击保存排序可保存排序结果",sortableStart:"排序",sortableAction:"排序操作",sortableSave:"保存排序",sortableExit:"退出排序",sortableUpdateApiRequired:"未配置排序保存接口"};class S{static t(t,...r){if(typeof t=="function")return t(...r);t=String(t);let n=0;return t.replace(/{([^}]+)}/g,(i,o)=>n<r.length?String(r[n++]):`{${o}}`)}static setI18n=t=>{S.curd=ObjectUtil.deepMerge(S.curd,t)};static tCurd(t,...r){return this.t(this.curd[t],...r)}static curd=Yo}class we{static delAllKey=t=>{Object.keys(t).forEach(r=>{delete t[r]})};static setValue=(t,r,n=!1)=>{n&&we.delAllKey(t),Object.keys(r).forEach(i=>{t[i]!==r[i]&&(t[i]=r[i])})}}const ve=a=>{const t=e.reactive({}),r=()=>typeof a=="function"?a():a,n=()=>{const i=r();return i??t};return{internal:t,isExternal:()=>r()!=null,get(){return n()},set(i){we.setValue(n(),i,!0)},merge(i){we.setValue(n(),i,!1)},clear(){we.delAllKey(n())}}},Le=a=>{a.forEach(t=>{console.error({field:t.field||"",error:t.error||""})})},qo=a=>a?typeof a=="string"?a:a instanceof Error?a.message:a.message||String(a):"",et=a=>!a||typeof a!="object"?[]:Object.keys(a).flatMap(t=>(Array.isArray(a[t])?a[t]:[a[t]]).map(n=>({field:n?.field||t,error:qo(n)}))),tt=N.EDialog,Oe=a=>typeof a.type=="object"?"component":a.type||"input",Jo=(a,t,r)=>{const n=ve(()=>t.form),i=l=>Et(l.update.formGrid||[],l.update.form,l.update.type,l.update.formMaxSpan).map(c=>c.item.key).filter(Boolean),o=async l=>{const s=r.ruleFormRef.value;if(!s)return!0;await e.nextTick();const c=i(l),f=Object.keys(l.update.rules||{}).filter(u=>!c.includes(u));if(f.length&&s.clearValidate(f),!c.length)return!0;if(!await s.validateField(c,async(u,p)=>{u||Le(et(p))}))throw!1;return!0};return{update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:tt.Update,get form(){return n.get()},set form(l){n.set(l)},formDefault:{},formColumn:[],formGrid:[],formMaxSpan:12,getDisabled:(l,s=!1)=>{const c=a();return t.option.table?.editMode&&s?l.disabled?.table===void 0?!1:N.isFun(l.disabled?.table,c.update.form):Yt(l,c.update.type,c.update.form)},getBind:l=>{const s=a();return qt(l,s.update.type)},getOn:(l,s)=>{const c=a();return Jt(l,c.update.type,[s||c.update.form,l])},getOptions:l=>{const s=a();try{const f=vt(s.update.formGrid?.length?s.update.formGrid:s.update.formColumn).find(d=>d.item.key===l)?.item;return f?{options:f.options,bind:s.update.getBind(f)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:l=>{const s=a();if(t.option.form?.editAll)return l;const c={[t.option.table?.rowKey]:s.update.edit.data[t.option.table?.rowKey]};return Object.keys(s.update.edit.data).forEach(f=>{l[f]!==s.update.edit.data[f]&&(c[f]=l[f])}),c}},view:{},openLoading:!1,open:async(l,s)=>{const c=a();if(!(c.update.showContent||c.update.openLoading)){N.loading(!0),c.update.openLoading=!0;try{c.update.type=l;const f=l===tt.Add;c.update.edit.data=f?void 0:JSONUtil.cp(s),c.update.title=S.tCurd(f?"add":l===tt.View?"view":"edit");const d=f?ObjectUtil.deepMerge(JSONUtil.cp(c.update.formDefault),s?JSONUtil.cp(s):{}):JSONUtil.cp(s);we.setValue(c.update.form,d,!0),await c.initApiData("update"),await t.option.form?.openBefore?.(c.update.form,c.update),(!t.option.table?.inlineEdit||f)&&(c.update.show=!0,c.update.showContent=!0),t.option.form?.openAfter?.(c.update.form,c.update)}catch(f){console.error(f)}finally{N.loading(!1),c.update.openLoading=!1}}},validate:async(l=!0)=>{const s=a();try{const c=t.option.table?.editMode?s.tableEditValidate.validate():o(s);return await Promise.all([c,s.formRef.validate()]),!0}catch{return l&&N.fail(S.tCurd("checkFormData")),!1}},submit:async()=>{const l=a();if(!await l.update.validate()||l.update.loading)return;l.update.loading=!0;const c=l.update.type===tt.Add?t.option.api.create:t.option.api.update;try{await t.option.form?.submitBefore?.(l.update.form,l.update)}catch{l.update.loading=!1;return}let f=ObjectUtil.deepMerge(l.update.form,{});delete f.children;const d=new Set(t.option.column.filter(u=>u.type==="datetime").map(u=>u.key));Object.keys(f).forEach(u=>{if(d.has(u)&&f[u]!=null){const p=new Date(f[u]).getTime();isNaN(p)||(f[u]=p)}});try{if(!c)return;await c({...f}),l.update.close(),await l.table.getList(),t.option.form?.submitAfter?.(f,l.update)}catch(u){console.error(u)}finally{l.update.loading=!1}},close:()=>{const l=a();l.update.show=!1,l.update.edit.data=void 0,setTimeout(()=>{l.update.showContent=!1,r.ruleFormRef.value?.resetFields?.(),n.clear()},350)}}}},J=12,ot=(a,t)=>{a.isForm=t,Array.isArray(a.children)&&a.children.forEach(r=>ot(r,t))},Qo=a=>a.isForm===!1?!1:typeof a.show?.form=="boolean"?a.show.form:!0,Wt=a=>a>J?Math.floor(a/2):a,Zo=(a,t,r)=>(a.form=a.form||{span:t},r==="column"?a.form.span=a.form.span??12:a.form.span=a.form.span??t,a.form.span=Wt(a.form.span),a.form.span),Xt=a=>{const t=a.form;return t?.row!=null&&t.row>0?Wt(t.row):J},Te=a=>Math.floor((a.gridRow-1)/J),Yt=(a,t,r)=>{if(t===N.EDialog.View)return a.disabled?.view===void 0?!0:N.isFun(a.disabled?.view,r);const n=a.disabled?.[t===N.EDialog.Add?"create":"update"];return N.isFun(n,r)},qt=(a,t)=>{const r=Oe(a);return a.options?.[t===N.EDialog.Add?"formAdd":"formUpdate"]?.[r]||a.options?.[r]||{}},Jt=(a,t,r=[])=>{const n=Oe(a),o=a.options?.[t===N.EDialog.Add?"formAdd":"formUpdate"]?.[n]?.on||a.options?.[n]?.on||{},l={};return Object.keys(o).forEach(s=>{const c=o[s];typeof c=="function"?l[s]=function(...f){return c.apply(this,[...f,...r])}:l[s]=c}),l},Qt=(a,t,r,n,i)=>{const o=a,l=o.colSpan??a.span;if(!a.item.form?.spanCol)return l;const s=i?.maxSpan||12,c=i?.defaultSpan||s/2,f=o.gridBand,u=t.filter(p=>f!=null?p.gridBand===f&&!N.isFun(p.item.show?.form,r,n):p.gridRow===o.gridRow&&!N.isFun(p.item.show?.form,r,n)).reduce((p,m)=>p+(m.colSpan??m.span??c),0);return l+u},_o=(a,t)=>{const r=(n,i)=>{const o=n.gridRow,l=n.gridRow+n.rowSpan-1,s=i.gridRow,c=i.gridRow+i.rowSpan-1;return o<=c&&s<=l};return a.map(n=>a.filter(o=>r(n,o)).length!==1||n.colSpan>=t?n:{...n,span:t,colSpan:t,gridColumn:1})},Zt=(a,t,r={})=>{const n=new Set,i=[];let o=0,l=0;const s=m=>Math.floor(m/J)*J,c=(m,h)=>`${m},${h}`,f=(m,h,k,T)=>{if(h+k>t)return!1;for(let A=0;A<T;A++)for(let E=0;E<k;E++)if(n.has(c(m+A,h+E)))return!1;return!0},d=(m,h,k,T)=>{for(let A=0;A<T;A++)for(let E=0;E<k;E++)n.add(c(m+A,h+E))},u=(m,h,k,T)=>{for(let E=s(m);E<500*J;E+=J){const R=E+J,X=E===s(m)?Math.max(E,m):E;for(let _=X;_<R;_++){const te=_===m?h:0;for(let ie=te;ie<=t-k;ie++)if(f(_,ie,k,T))return{tr:_,tc:ie}}}return{tr:m,tc:h}},p=(m,h,k,T)=>{const A=s(m);if(T<J&&m+T<A+J){o=m+T,l=h;return}const E=h+k;if(E<t){l=E,o=A;return}l=0,o=A+J};return a.forEach(m=>{const h=m.colSpan??(m.span===0?t:m.span),k=m.rowSpan??Xt(m.item);m.item.form?.rowBreak&&i.length&&(l=0,o=s(o)+J);let{tr:T,tc:A}=f(o,l,h,k)?{tr:o,tc:l}:u(o,l,h,k);f(T,A,h,k)||({tr:T,tc:A}=u(0,0,h,k)),d(T,A,h,k);const E=T+1;i.push({...m,span:h,colSpan:h,rowSpan:k,gridRow:E,gridColumn:A+1,gridBand:Te({gridRow:E})}),p(T,A,h,k)}),r.fillSingleRows?_o(i,t):i},Et=(a,t,r,n=J)=>{const i=a.filter(s=>N.isFun(s.item.show?.form,t,r)),o=new Map;a.forEach(s=>{const f=`${s.gridBand??Te(s)}:${s.gridColumn}:${s.colSpan}`;o.has(f)||o.set(f,[]),o.get(f).push(s)});const l=new Map;return o.forEach(s=>{const c=s.reduce((p,m)=>p+m.rowSpan,0);if(!(s.length>1&&c===J&&s.every(p=>p.rowSpan<J)))return;const d=s.filter(p=>N.isFun(p.item.show?.form,t,r));if(d.length!==1)return;const u=d[0];l.set(u.item.key,{...u,rowSpan:J})}),Zt(i.map(s=>l.get(s.item.key)||s),n,{fillSingleRows:!0})},_t=a=>{const t=new Map;return a.forEach(r=>{const n=r.gridBand??Te(r);t.has(n)||t.set(n,[]),t.get(n).push(r)}),Array.from(t.keys()).sort((r,n)=>r-n).map(r=>t.get(r))},vt=a=>a?.length?Array.isArray(a[0])?a.flat():a:[],vo=(a,t)=>{if(!Qo(a)||!a.key)return null;const r=t.defaultSpan??(t.maxSpan||12)/2,n=Zo(a,r,t.layout);return{item:a,span:n}},en=(a,t={})=>{const r=[],n=i=>{if(i.children?.length){i.children.forEach(l=>n(l));return}const o=vo(i,t);o&&r.push(o)};return a.forEach(i=>n(i)),r},eo=(a,t={})=>{const r=t.maxSpan??12,n=t.defaultSpan??r/2,i=t.layout??"row",l=en(a,{maxSpan:r,defaultSpan:n,layout:i});if(i==="column"){const s=[];let c=1;return l.forEach(f=>{const d=Xt(f.item),u=r;s.push({...f,span:u,colSpan:u,rowSpan:d,gridRow:c,gridColumn:1,gridBand:Te({gridRow:c})}),c+=d}),{cells:s,maxSpan:r}}return{cells:Zt(l,r),maxSpan:r}},tn=a=>a.map(t=>t.item?.show?.form),on=(a,t,r)=>{if(!a.rules)return;const n={required:!0,message:t(a),trigger:"blur"},i=Oe(a),o=a.options?.datetime?.type,l=i==="datetime"&&typeof o=="string"&&o.includes("range"),s=i==="select"&&!!a.options?.select?.multiple;(l||i==="checkbox"||s)&&(n.type="array",n.min=l?2:1);const c=typeof a.rules=="boolean"?[n]:a.rules;return r?c.map(f=>r(f)):c},to=a=>typeof a=="function"?a():a,oo=a=>(t,r)=>on(t,a,n=>{const i=(o,l)=>{if(l&&Object.prototype.hasOwnProperty.call(l,t.key)&&l[t.key]!==void 0)return l[t.key];const s=to(r);return s&&Object.prototype.hasOwnProperty.call(s,t.key)?s[t.key]:o};if(n.validator){const o=n.validator;return{...n,validator:(l,s,c,f)=>{const d=to(r);return o(l,i(s,f),c,d||f)}}}return n}),no=(a,t)=>{const r={input:S.tCurd("placeholderInput"),select:S.tCurd("placeholderSelect")},n=(r[Oe(a)||"input"]||r.input)+a.label;return(t||v.error.callback)?.(a.key,a)||n},ro=a=>oo(t=>no(t,a?.error)),nn=(a,t,r)=>{const n={},i={},o=t?.maxSpan||12,l=t?.defaultSpan||o/2,s=ro(t);a.forEach(d=>ot(d,!0)),St(a,n,i,d=>s(d,r));const{cells:c,maxSpan:f}=eo(a,{maxSpan:o,defaultSpan:l,layout:t?.layout});return{formDefault:n,rules:i,formGrid:c,formMaxSpan:f,formColumn:_t(c)}},St=(a,t,r,n)=>{const i=o=>{if(o.children?.length){o.children.forEach(l=>i(l));return}if(o.key){t[o.key]=o.value;const l=n(o);l&&(r[o.key]=l)}};a.forEach(i)},rn={class:"curd-form-cell-inner"},ao=e.defineComponent({__name:"layout",props:{formGrid:{},maxSpan:{},form:{},type:{},stripe:{type:Boolean},labelWidth:{},formOption:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(a){const t=N.isFun,r=a,n=e.computed(()=>Et(r.formGrid,r.form,r.type,r.maxSpan)),i=e.computed(()=>{const p=Array.from(new Set(n.value.map(m=>m.gridBand??Te(m)))).sort((m,h)=>m-h);return new Map(p.map((m,h)=>[m,h]))}),o=e.computed(()=>({gridTemplateColumns:`repeat(${r.maxSpan}, minmax(0, 1fr))`})),l=e.computed(()=>{let p=0;return n.value.forEach(m=>{const h=m.gridRow+m.rowSpan-1;h>p&&(p=h)}),p}),s=p=>p.gridRow+p.rowSpan-1>=l.value,c=p=>p.rowSpan>=J,f=p=>{const m=p.gridBand??Te(p);return i.value.get(m)??m},d=p=>Qt(p,n.value,r.form,r.type,{maxSpan:r.maxSpan,defaultSpan:r.formOption?.defaultSpan}),u=p=>{const m=d(p)||p.colSpan;return{gridRow:`${p.gridRow} / span ${p.rowSpan}`,gridColumn:`${p.gridColumn} / span ${m}`}};return(p,m)=>e.unref(t)(e.unref(tn)(p.formGrid),p.form,p.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(p.$slots,"form-start",{row:p.form}),e.createElementVNode("div",{class:e.normalizeClass(["curd-form-grid",{stripe:p.stripe!==!1}]),style:e.normalizeStyle(o.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.item.key,class:e.normalizeClass(["curd-form-grid-cell",[p.stripe!==!1&&f(h)%2===0?"stripe-band-odd":"",h.gridColumn>1?"has-col-border":"",p.stripe!==!1&&s(h)?"is-last-row":"",c(h)?"is-row-span":"",`form-item-col-${h.item.key}`]]),style:e.normalizeStyle(u(h))},[e.createElementVNode("div",rn,[e.unref(t)(h.item.show?.form,p.form,p.type)?(e.openBlock(),e.createBlock(Xo,{key:0,class:e.normalizeClass({"is-row-span-field":c(h)}),item:h.item,form:p.form,type:p.type,"label-width":p.labelWidth,"get-bind":p.getBind,"get-on":p.getOn,"get-disabled":p.getDisabled},e.createSlots({_:2},[e.renderList(p.$slots,(k,T)=>({name:T,fn:e.withCtx(A=>[e.renderSlot(p.$slots,T,e.mergeProps({ref_for:!0},A||{}))])}))]),1032,["class","item","form","type","label-width","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)])],6))),128))],6),e.renderSlot(p.$slots,"form-end",{row:p.form})],64)):e.createCommentVNode("",!0)}}),io=e.defineComponent({__name:"column",props:{option:{default:()=>({form:{},column:[]})},type:{default:""},form:{default:void 0}},setup(a,{expose:t}){const r=N.EDialog,n=e.ref(),i=a;let o=ve(i.form);const l=kt.Scope.getConf("curdConf"),s="formRef-"+StrUtil.getId();e.onUnmounted(()=>{l?.formRef?.remove(s)});const c=e.reactive({rules:{},show:!0,formDefault:{},type:i.type||l?.update?.type||r.Add,formColumn:[],formGrid:[],formMaxSpan:12,get form(){return o.get()},set form(f){o.set(f)},getDisabled:f=>Yt(f,c.type,c.form),getBind:f=>qt(f,c.type),getOn:f=>Jt(f,c.type,[c.form,f]),initColumnForm:()=>{const f=o,d=nn(i.option.column,i.option.form,()=>f.get());c.formDefault=d.formDefault,c.rules=d.rules,c.formGrid=d.formGrid,c.formMaxSpan=d.formMaxSpan,c.formColumn=d.formColumn,c.type===r.Add?f.isExternal()?f.merge(JSONUtil.cp(c.formDefault)):f.set(JSONUtil.cp(c.formDefault)):!f.isExternal()&&i.form&&f.set(JSONUtil.cp(i.form))}});return l?.formRef?.set(s,{validate:async f=>{const d=n.value;if(!d)return f?.(!0),!0;await e.nextTick();const u=Et(c.formGrid||[],c.form,c.type,c.formMaxSpan).map(h=>h.item.key).filter(Boolean),p=Object.keys(c.rules||{}).filter(h=>!u.includes(h));if(p.length&&d.clearValidate(p),!u.length)return f?.(!0),!0;const m=await d.validateField(u,async(h,k)=>{h||Le(et(k))});if(f?.(!!m),!m)throw!1;return!0}}),i.option.form?.initStart?.(c),c.initColumnForm(),i.option.form?.initEnd?.(c),e.watch(()=>i.form,f=>{o=ve(f),c.initColumnForm()}),t({ref:n,conf:c}),(f,d)=>(e.openBlock(),e.createBlock(e.unref(b.ElForm),{ref_key:"ruleFormRef",ref:n,model:c.form,rules:c.rules},{default:e.withCtx(()=>[c.show?(e.openBlock(),e.createBlock(ao,{key:0,"form-grid":c.formGrid,"max-span":c.formMaxSpan,form:c.form,type:c.type,stripe:a.option.form?.stripe,"label-width":a.option.form?.labelWidth||"100px","form-option":a.option.form,"get-bind":c.getBind,"get-on":c.getOn,"get-disabled":c.getDisabled},e.createSlots({_:2},[e.renderList(f.$slots,(u,p)=>({name:p,fn:e.withCtx(m=>[e.renderSlot(f.$slots,p,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),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"]))}}),an=a=>a?.value||a,ln=a=>{const t=an(a);return t?.validate?new Promise((r,n)=>{let i=!1;const o=(l,s)=>{i||(i=!0,l===!1?(Le(et(s)),n(!1)):r(!0))};try{const l=t.validate(o);l&&typeof l.then=="function"?l.then(s=>o(s)).catch(s=>{Le(et(s?.fields||s)),n(s)}):(l!==void 0||t.validate.length===0)&&o(l)}catch(l){n(l)}}):Promise.resolve(!0)},sn=()=>{const a=e.reactive({formRef:{map:{},set(t,r){a.formRef.map[t]=r},remove(t){delete a.formRef.map[t]},validate(){const t=Object.keys(a.formRef.map).map(r=>a.formRef.map[r]);return Promise.all(t.map(r=>ln(r))).then(()=>!0)}},regFormRef(t,r,n){t?n?a.formRef.set(r,{validate:async i=>{try{i(await n())}catch{i(!1)}}}):a.formRef.set(r,t):a.formRef.remove(r)}});return a},dn=(a,t)=>{const r=ve(()=>t.searchForm);return{search:{column:{list:[]},get form(){return r.get()},set form(n){r.set(n)},formDefault:{},getPlaceholder:(n,i=S.tCurd("placeholderInput"))=>n.text?.search?.placeholder===void 0?`${i}${n.label}`:n.text?.search?.placeholder,getFormData:()=>{const n=a();let i={};t.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 o=t.option.search?.before?.(i);return o&&(i=o),i},reset:()=>{const n=a(),i=n.search.formDefault;Object.keys(i).forEach(l=>{t.option.search?.resetMode==="none"?i[l]=void 0:i[l]=n.search.formDefault[l]});const o=ObjectUtil.deepMerge(i,{});we.setValue(n.search.form,o,!0),n.page.num=1,t.option.init!==!1&&n.table.getList()},submit:()=>{const n=a();n.page.num=1,n.table.getList()}}}},cn=(a,t)=>({page:{num:1,total:0,layout:t.option.page?.layout||H.config.pagination.layout,showTools:t.option.page?.showTools||H.config.pagination.showTools,size:t.option.page?.size||H.config.pagination.size,sizeList:t.option.page?.sizeList||H.config.pagination.pageSizes,pagerCount:t.option.page?.pagerCount||H.config.pagination.pagerCount,getQuery:(r={})=>{const n=a();return{[H.config.field.page.size]:r.size||n.page.size,[H.config.field.page.num]:r.num||n.page.num,...n.search.getFormData()}}}}),fn=(a,t,r)=>{const n=a;return{table:{op:{width:(...i)=>i.filter(l=>l).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(i,o)=>{},all:()=>{const i=n();if(i.table.expand.isExpand)i.table.expand.rowKeys=[];else{const o=l=>{let s=[];return l.forEach(c=>{s.push(c[t.option.table.rowKey]),c.children?.length&&(s=s.concat(o(c.children)))}),s};i.table.expand.rowKeys=o(i.table.data)}i.table.expand.isExpand=!i.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},sortable:{mode:!1,actionLoading:!1,instance:void 0,modulePromise:void 0,getOption:()=>t.option.table?.sortable||{},showTriggerButton:()=>{const i=n();return t.option.table?.sortable?.button&&!i.table.sortable.mode},showActionButton:()=>{const i=n();return t.option.table?.sortable?.button&&i.table.sortable.mode},showSaveButton:()=>!t.option.table?.sortable?.button&&t.option.table?.sortable?.show&&t.option.table?.sortable?.saveButton,isActive:()=>{const i=n(),o=i.table.sortable.getOption();return o.button?i.table.sortable.mode:!!o.show},showPagination:()=>{const i=n();return!i.table.sortable.isActive()||i.table.sortable.getOption().page},disableScroll:()=>{const i=n(),o=i.table.sortable.getOption();return i.table.sortable.isActive()&&!o.page&&!o.scroll},getTableBindOption:()=>{const i=n();return{...t.option.table||{},...i.table.sortable.disableScroll()?{height:void 0,maxHeight:void 0}:{}}},getColumnBind:()=>{const{show:i,button:o,page:l,scroll:s,field:c,rule:f,api:d,onEnd:u,...p}=n().table.sortable.getOption();return p},destroy:()=>{const i=n();i.table.sortable.instance?.destroy(),i.table.sortable.instance=void 0},getBody:()=>r.tableRef.value?.$el?.querySelector(".el-table__body-wrapper tbody"),loadModule:async()=>{const i=n();i.table.sortable.modulePromise??=Promise.resolve().then(()=>_r);const o=await i.table.sortable.modulePromise;return o.default||o},applyRule:(i,o,l,s)=>{if(l==="value"){i.forEach((c,f)=>{c[o]=s[f]});return}i.forEach((c,f)=>{c[o]=f+1})},sync:async()=>{const i=n();if(i.table.sortable.destroy(),!i.table.sortable.isActive()||i.table.loading)return;await e.nextTick();const o=i.table.sortable.getBody();if(!o)return;const l=await i.table.sortable.loadModule(),s=i.table.sortable.getOption();i.table.sortable.instance=l.create(o,{animation:150,handle:".cc1-form-drag-handle",draggable:".el-table__row",onEnd:({oldIndex:c,newIndex:f})=>{const d=(p,m,h)=>{if(!Number.isInteger(m)||!Number.isInteger(h)||m===h||m<0||h<0||m>=p.length||h>=p.length)return;const k=p.splice(m,1)[0];p.splice(h,0,k)},u=i.table.data.map(p=>p?.[s.field]);d(i.table.data,c,f),s.onEnd?s.onEnd(i.table.data):i.table.sortable.applyRule(i.table.data,s.field,s.rule,u)}})},refreshList:async()=>{const i=n();await i.table.getList(i.table.sortable.isActive()?"sortable":void 0),i.table.sortable.sync()},fitHeight:!1,start:async()=>{const i=n(),o=i.table?.sortable.getOption();i.table.sortable.fitHeight=t.option.table.fitHeight,o.scroll||(t.option.table.fitHeight=!1),i.table.sortable.mode=!0,await i.table.sortable.refreshList()},exit:async()=>{const i=n();t.option.table.fitHeight=i.table.sortable.fitHeight,await i.table.getList(),i.table.sortable.mode=!1,i.table.sortable.destroy()},save:async()=>{const i=n(),l=i.table.sortable.getOption().api?.update||t.option.api.update;if(!l){N.fail(S.tCurd("sortableUpdateApiRequired"));return}i.table.sortable.actionLoading=!0,i.table.loading=!0;try{await l(i.table.data,"sortable"),N.success(S.tCurd("operationSuccess")),await i.table.sortable.exit()}catch(s){console.error(s)}finally{i.table.sortable.actionLoading=!1,i.table.loading=!1}},command:async i=>{const o=n();if(i==="save"){await o.table.sortable.save();return}await o.table.sortable.exit()}},header:{group:{expand:!1,toggleExpandAll:()=>{const i=n(),o=!i.table.header.group.expand;i.table.header.group.expand=o;const l=s=>{s.forEach(c=>{c.table?.header?.group!==void 0&&(c.table.header.group=!o),c.table?.header?.groupKey!==void 0&&(c.table.header.show=o),Array.isArray(c.children)&&c.children.length&&l(c.children)})};l(i.table.column.list)}}},parseListResult:async i=>{const o=n(),l=H.config.field.result,s=i?.data||{[l.list]:i},c=(Array.isArray(s[l.list]),s[l.list]),f=vt(o.update.formGrid?.length?o.update.formGrid:o.update.formColumn),u=ObjectUtil.deepMerge({data:c},{}).data.map(p=>(Object.keys(p).forEach(h=>{const k=f.find(T=>T.item.key===h);k&&["select","radio"].includes(k.item.type)&&(k.item.table.format||(k.item.table.format=T=>k.item.options[k.item.type].data?.find(A=>A.value==T[h])?.label||T[h]))}),p));return{data:t.option.data?await t.option.data(u,c):u,total:s[l.total]||0}},applyListResult:async(i,o)=>{const l=n(),s=await l.table.parseListResult(i);return l.table.data=s.data,l.page.total=o??s.total,l.tableEditValidate?.clear?.(),s},getList:async i=>{const o=n();o.table.loading=!0;const l=t.option.table?.sortable,s=i==="sortable"&&l?.api?.list||t.option.api.list,c=JSONUtil.cp(o.table.selection.list);try{await o.initApiData("init");let f={};if(o.table.sort.prop){const{props:p,order:m}=H.config.table.sort;f={[p.field]:o.table.sort.prop,[m.field]:o.table.sort.order}}const d=i==="sortable"&&l?.page===!1?o.page.getQuery({num:1,size:o.page.total||999999}):o.page.getQuery(),u=await s({...d,...f},i);await o.table.applyListResult(u,i==="sortable"&&l?.page===!1?o.page.total:void 0),setTimeout(()=>{o.table.selection.setList(c),t.option.table?.sortable?.show&&!t.option.table?.sortable?.button&&o.table.sortable.sync()},20)}catch(f){console.error(f)}finally{o.table.loading=!1}},selection:{list:[],change:i=>{n().table.selection.list=i},setList:(i,o)=>{const l=n();l.table.selection.list=[];const s=r.tableRef.value;if(s?.clearSelection(),!s||!i?.length)return;const c=t.option.table?.rowKey,f=d=>{const u=p=>{for(const m of p){if(c!=null&&c!==""){if(m[c]===d[c])return m}else if(m===d)return m;if(Array.isArray(m.children)&&m.children.length){const h=u(m.children);if(h!==void 0)return h}}};return u(l.table.data)};i.forEach(d=>{const u=f(d);if(u)if(o){const p=()=>s.toggleRowSelection(u,!0,!1);o(d)!==!1&&p()}else s.toggleRowSelection(u,!0,!1)})}},sort:{prop:"",order:"",change:i=>{const o=n();H.config.table.sort.resetPage&&(o.page.num=1);const l=H.config.table.sort;if(l.change){l.change(i,o);return}o.table.sort.prop=i.prop,i.order===null?(o.table.sort.order="",o.table.sort.prop=""):o.table.sort.order=i.order==="ascending"?l.order.asc:l.order.desc,o.table.getList()}}}}},pn=(a,t)=>{const r=e.reactive({}),n=new WeakMap;let i=0;const o=g=>{let w=n.get(g);return w||(i+=1,w=`fallback-${i}`,n.set(g,w)),w},l=g=>{const w=t.option.table?.rowKey,F=w?g[w]:void 0;return F!=null&&F!==""?String(F):o(g)},s=(g,w)=>`${l(g)}-${w.key}`,c=g=>no(g,t.option.form?.error),f=oo(c),d=()=>{Object.keys(r).forEach(g=>{delete r[g]})},u=(g,w)=>{delete r[s(g,w)]},p=(g,w)=>r[s(g,w)]||"",m=(g,w)=>g.message||c(w),h=g=>g==null||g===""||Array.isArray(g)&&g.length===0,k=g=>{if(typeof g=="number")return g;if(typeof g=="string"||Array.isArray(g))return g.length},T=(g,w)=>{if(g==="array")return Array.isArray(w);if(g==="integer")return typeof w=="number"&&Number.isInteger(w);if(g==="float")return typeof w=="number"&&!Number.isInteger(w);if(g==="number")return typeof w=="number"&&!Number.isNaN(w);if(g==="boolean")return typeof w=="boolean";if(g==="object")return w!==null&&typeof w=="object"&&!Array.isArray(w);if(g==="date")return w instanceof Date||!Number.isNaN(new Date(w).getTime());if(g==="email")return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(w));if(g==="url")try{return new URL(String(w)),!0}catch{return!1}return g==="string"?typeof w=="string":!0},A=(g,w,F)=>typeof g.validator!="function"?Promise.resolve(!0):new Promise(I=>{let U=!1;const z=$=>{if(!U){if(U=!0,$==null){I(!0);return}if($ instanceof Error){I($.message||m(g,F));return}if(Array.isArray($)){const ye=$[0];I(ye instanceof Error?ye.message:String(ye||m(g,F)));return}I(String($))}};try{const $=g.validator(g,w,z);$&&typeof $.then=="function"?$.then(()=>z()).catch(z):$===!1?z(m(g,F)):typeof $=="string"||$ instanceof Error?z($):g.validator.length<3&&z()}catch($){z($)}}),E=async(g,w,F)=>{const I=typeof g.transform=="function"?g.transform(w):w,U=h(I);if(g.required&&U)return m(g,F);if(U&&!g.required)return!0;if(g.whitespace&&typeof I=="string"&&I.trim()===""||g.type&&!T(g.type,I)||Array.isArray(g.enum)&&!g.enum.includes(I)||g.pattern&&!new RegExp(g.pattern).test(String(I)))return m(g,F);const z=k(I);return g.len!==void 0&&z!==void 0&&z!==g.len||g.min!==void 0&&z!==void 0&&z<g.min||g.max!==void 0&&z!==void 0&&z>g.max?m(g,F):A(g,I,F)},R=g=>{const w=a();return!g.key||!w.table.column.show.list.includes(g.key)||g.table?.header?.groupKey!==void 0&&!g.table.header.show?!1:g.show?.table!==void 0?N.isFun(g.show?.table,w.table.data):!0},X=(g,w)=>g.show?.form!==void 0?N.isFun(g.show.form,w,N.EDialog.Update):!0,_=()=>{const g=a(),w=[],F=I=>{I.forEach(U=>{if(R(U)){if(U.children?.length){F(U.children);return}w.push(U)}})};return F(g.table.column.list),w},te=async(g,w)=>{if(!X(w,g))return u(g,w),!0;const F=f(w,g);if(!F)return!0;u(g,w);const I=Array.isArray(F)?F:[F];for(const U of I){const z=await E(U,g[w.key],w);if(z!==!0)return r[s(g,w)]=z,{field:w.key,error:z}}return!0},ie=g=>{const w=[],F=I=>{I.forEach(U=>{w.push(U),Array.isArray(U.children)&&U.children.length&&F(U.children)})};return F(g),w};return{tableEditValidate:{errors:r,clear:d,clearField:u,getFieldError:p,validate:async()=>{if(d(),!t.option.table?.editMode)return!0;const g=a(),w=_(),F=ie(g.table.data||[]),U=(await Promise.all(F.flatMap(z=>w.map($=>te(z,$))))).filter(z=>z!==!0);if(U.length)throw Le(U),!1;return!0}}}};class lo{static exportToExcel=async(t,r,n)=>{if(!t||t.length===0)return;const i=await N.loadModule("xlsx"),o=t.map(c=>{const f={};return r.forEach(d=>{f[d.label]=c[d.key]}),f}),l=i.utils.json_to_sheet(o),s=i.utils.book_new();i.utils.book_append_sheet(s,l,"Sheet1"),n?typeof n=="function"&&(n=n()):n=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,i.writeFile(s,`${n}.xlsx`)}}const un=(a,t)=>({export:{run:{start:async r=>{let i=await a().export.run[r]();const o=t.option.column,l=ObjectUtil.deepMerge({data:i,columns:o},{}),s=t.option.tools?.export||{};s.before?.(l),lo.exportToExcel(l.data,l.columns,s.fileName)},select:async()=>{const r=a();r.export.loading=!0;try{if(t.option.tools?.export?.select){await t.option.tools.export.select({...r.page.getQuery(),items:r.table.selection.list});return}if(r.table.selection.list.length===0)throw N.fail(S.tCurd("selectDataToExport")),new Error(S.tCurd("selectDataToExport"));return r.table.selection.list}catch(n){console.error(n)}finally{r.export.loading=!1}},page:async()=>{const r=a();r.export.loading=!0;try{if(t.option.tools?.export?.page){await t.option.tools.export.page({...r.page.getQuery()});return}if(r.table.data.length===0)throw N.fail(S.tCurd("noData")),new Error(S.tCurd("noData"));return r.table.data}catch(n){console.error(n)}finally{r.export.loading=!1}},all:async()=>{const r=a();r.export.loading=!0;try{if(t.option.tools?.export?.all){await t.option.tools.export.all({...r.page.getQuery()});return}const n=t.option.api.list,i=await n({...r.page.getQuery({size:999999,num:1})});return(i.data||{[H.config.field.result.list]:i})[H.config.field.result.list]}catch(n){console.error(n)}finally{r.export.loading=!1}}},loading:!1,click:r=>{const n=a();n.export.loading||n.export.run.start(r)}}}),mn=(a,t)=>({remove:{title:S.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{a().remove.show=!1},open:r=>{if(r.length===0){N.fail(S.tCurd("selectDataToDelete"));return}const n=a();n.remove.items=r,n.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{const r=a();r.remove.loading=!0;const n=t.option.api.delete;try{if(!n)return;await n({[t.option.table?.rowKey]:r.remove.items.map(i=>i[t.option.table?.rowKey]),items:r.remove.items}),N.success(S.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}})}}}),hn=(a,t,r)=>({apiDataMap:{},getColumnSpan:(n,i)=>{const o=a(),l=o.update.formGrid?.length?o.update.formGrid:i||[];return Qt(n,l,o.update.form,o.update.type,{maxSpan:o.update.formMaxSpan||t.option.form?.maxSpan,defaultSpan:t.option.form?.defaultSpan||H.config.form.defaultSpan})},init:()=>{const n=a();n.initCurdConfig(),n.initColumnOptions(),n.initColumnForm()},initApiData:async n=>{const i=a(),o=[],l=s=>{if(s.children?.length){s.children.forEach(f=>l(f));return}const c=Oe(s);if(s.options?.[c]?.dataApi&&s.options?.[c]?.dataApiConfig?.[n]){if(i.apiDataMap[s.key]&&s.options?.[c]?.dataApiConfig?.once)return;const f=(async()=>{try{let d=await s.options?.[c]?.dataApi?.(i.update.form,i.update.type);if(d){const u=s.options?.[c]?.dataPath;!Array.isArray(d)&&u&&(d=ObjectUtil.getPathValue(d,u)),s.options[c].data=d,s.options.search[c].data=d,s.options.search[s.options.search.type??c]||(s.options.search[s.options.search.type??c]={}),s.options.search[s.options.search.type??c].data=d,s.options.formAdd[c].data=d,s.options.formUpdate[c].data=d,i.apiDataMap[s.key]=d}}catch{}})();o.push(f)}};return t.option.column.forEach(s=>l(s)),await Promise.all(o),!0},initCurdConfig:()=>{const n=ObjectUtil.deepMerge(H.config,{});n.table.emptyText=S.tCurd("noData"),t.option.size=t.option.size||{},n.table.size=t.option.size.table||n.size.table,n.form.size=t.option.size.form||n.size.form,n.size.search=t.option.size.search||n.size.search;const i=ObjectUtil.deepMerge(n,t.option||{});Object.keys(i).forEach(o=>{t.option[o]=i[o]})},initColumnOptions:()=>{const n=a();let i=JSONUtil.cp(H.config.columnConfig);i.options=ObjectUtil.deepMerge({switch:{activeText:S.tCurd("switchOn"),inactiveText:S.tCurd("switchOff")}},i.options);const o=l=>{const s=Oe(l);for(const f in i){if(f==="table"){if(l.table=ObjectUtil.deepMerge(i.table,l.table||{}),l.children){l.children.forEach(d=>o(d));return}}else f==="type"?l.type=l.type||i.type:l[f]=ObjectUtil.deepMerge(i[f],l[f]||{});l.options=l.options||{},l.options[s]=l.options[s]||{},l.options[s].size=t.option.size.form}["search","formAdd","formUpdate"].forEach(f=>{l.options[f]=ObjectUtil.deepMerge(l.options,l.options[f]||{}),f==="search"?t.option.size.search&&(l.options[f][s].size=t.option.size.search):t.option.size.form&&(l.options[f][s].size=t.option.size.form)}),l.table=ObjectUtil.deepMerge(l.table,l.options[s].table||{}),s==="switch"&&(l.options.switch.tableBeforeChange=async(f,d)=>{const u=l.options?.switch;try{u.tableConfig?.confirm&&await r.switchConfirmRef.value?.open({title:S.tCurd("confirmModify"),content:S.tCurd("confirmSwitchMessage")});try{if(!t.option.api.update&&!u.tableConfig?.api)return;const p=d[t.option.table?.rowKey];u.loadingMap||(u.loadingMap={}),u.loadingMap[p]||(u.loadingMap[p]={loading:!1}),u.loadingMap[p].loading=!0;const m=d[f]===u.activeValue?u.inactiveValue:u.activeValue,h=u.tableConfig?.api?u.tableConfig.api:t.option.api.update;if(!h)return;try{await h({...d,[f]:m},"switch")}catch{return!1}finally{u.loadingMap[p].loading=!1}return N.success(S.tCurd("operationSuccess")),u.tableConfig?.loadList&&(n.table.loading=!0,n.table.getList(),n.table.loading=!1),!0}catch(p){return console.error(p),!1}finally{n.table.loading=!1}}catch{return!1}}),s==="treeSelect"&&(l.options.treeSelect.rowKey=t.option.table?.rowKey,l.options.treeSelect.nodeKey=t.option.table?.rowKey)};t.option.column.forEach(o),t.option.table?.column?.forEach(o)},initColumnForm:()=>{const n=a(),i=t.option;n.update.formColumn=[],n.update.formGrid=[],n.update.formMaxSpan=12,n.table.column.show={list:[],listSource:[]};const o=t.option.form?.maxSpan||12,l=t.option.form?.defaultSpan||o/2,s=ro(t.option.form),c=p=>{if(p.children){n.table.column.show.list.push(p.key),p.children.forEach(m=>c(m));return}n.update.formDefault[p.key]=p.value,p.table?.table&&(p.show?.table&&n.table.column.show.list.push(p.key),n.table.column.show.listSource.push(p.key))};i.column.forEach(p=>{ot(p,!0),c(p)}),t.option.table?.column?.forEach(p=>{ot(p,!1),c(p)}),n.search.column.list=i.column.concat(i.table?.column||[]),n.table.column.list=n.search.column.list.filter(p=>p.table?.table),n.search.column.list.sort((p,m)=>p.sort?.search-m.sort?.search),n.table.column.list.sort((p,m)=>p.sort?.table-m.sort?.table),n.update.rules={},St(i.column,n.update.formDefault,n.update.rules,p=>s(p,()=>n.update.form)),i.table?.editMode&&St(i.table?.column||[],n.update.formDefault,n.update.rules,p=>s(p,()=>n.update.form));const f=eo(i.column,{maxSpan:o,defaultSpan:l,layout:t.option.form?.layout});n.update.formGrid=f.cells,n.update.formMaxSpan=f.maxSpan,n.update.formColumn=_t(f.cells);const d=t.option.search?.formDefault;d&&Object.keys(d).forEach(p=>{n.search.formDefault[p]=d[p]}),i.column.forEach(p=>{p.show?.search||(n.search.formDefault[p.key]=void 0)});const u=ObjectUtil.deepMerge(n.search.formDefault,{});we.setValue(n.search.form,u,!0)}}),gn=a=>{const t=e.ref(),r=e.ref(),n=e.ref(),i={switchConfirmRef:t,ruleFormRef:r,tableRef:n},o=e.getCurrentInstance(),l=kt.Scope.getConf("curdConf"),s=u=>{u=u||f;let p=u,m=u;for(;p?.parentCurdConf;)m=p.parentCurdConf,p=p.parentCurdConf;return m},c=()=>f;let f=e.reactive({parentCurdConf:l,getCurdConf:s,getRootCurdConf:s,...sn(),option:a.option,...dn(c,a),...cn(c,a),...fn(c,a,i),...pn(c,a),...un(c,a),...Jo(c,a,i),...mn(c,a),...hn(c,a,i)});f.init();const d=o?`curdRef-${o.uid}`:"";return l?.formRef&&d&&(l.formRef.set(d,{validate:async u=>{const p=await f.update.validate(!1);if(u?.(!!p),!p)throw!1;return!0}}),e.onUnmounted(()=>{l.formRef.remove(d)})),e.onMounted(()=>{if(a.option.init!==!1){if(a.option.table?.sortable?.show&&!a.option.table?.sortable?.button){(f.table?.sortable.getOption()).scroll||(a.option.table.fitHeight=!1),f.table.sortable.refreshList();return}f.table.getList()}}),e.onBeforeUnmount(()=>{f.table.sortable.destroy()}),kt.Scope.setConf("curdConf",f),{conf:f,switchConfirmRef:t,ruleFormRef:r,tableRef:n}},bn={class:"dialog-footer"},yn=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(a,{expose:t}){const r=e.ref(!1),n=e.ref("确认修改"),i=e.ref("确认要修改状态吗?");let o=null,l=null;const s=d=>(d?.title&&(n.value=d.title),d?.content&&(i.value=d.content),r.value=!0,new Promise((u,p)=>{o=u,l=p})),c=()=>{r.value=!1,o?.(!0),o=null,l=null},f=()=>{r.value=!1,l?.(new Error("用户取消操作")),o=null,l=null};return t({open:s}),(d,u)=>{const p=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(b.ElDialog),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=m=>r.value=m),title:n.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(p,{size:d.size},{default:e.withCtx(()=>[e.createElementVNode("span",bn,[e.createVNode(e.unref(b.ElButton),{onClick:f},{default:e.withCtx(()=>u[1]||(u[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:c},{default:e.withCtx(()=>u[2]||(u[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(i.value),1)]),_:1},8,["modelValue","title"])}}}),wn=["innerHTML"],kn=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(a){const t=a,r=e.computed(()=>typeof t.content=="function"?t.content(t.value):t.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,wn))}}),so=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(a){const t=a,r=e.computed({get:()=>t.conf.search.form?.[t.item?.key],set:n=>{t.item?.key!==void 0&&(t.conf.search.form[t.item.key]=n)}});return(n,i)=>e.unref(v).customComponent[n.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).customComponent[n.type??""]?.search),e.mergeProps({key:0,modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=o=>r.value=o)},n.item.options?.search?.[n.type??""],e.toHandlers(n.item.options?.search?.[n.type??""]?.on||{})),null,16,["modelValue"])):n.type==="input"?(e.openBlock(),e.createBlock(e.unref(b.ElInput),e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=o=>r.value=o),placeholder:n.conf.search.getPlaceholder(n.item),clearable:"",disabled:n.item.disabled?.search},n.item.options?.search?.input||n.item.options?.input,e.toHandlers(n.item.options?.search?.input?.on||n.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(b.ElSelect),e.mergeProps({key:2,modelValue:r.value,"onUpdate:modelValue":i[2]||(i[2]=o=>r.value=o),placeholder:n.conf.search.getPlaceholder(n.item,e.unref(S).tCurd("placeholderSelect")),clearable:"",disabled:n.item.disabled?.search},n.item.options?.search?.switch||n.item.options?.switch,e.toHandlers(n.item.options?.search?.switch?.on||n.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(b.ElOption),{key:n.item.options?.switch?.activeValue,label:n.item.options?.switch?.activeText,value:n.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(b.ElOption),{key:n.item.options?.switch?.inactiveValue,label:n.item.options?.switch?.inactiveText,value:n.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(b.ElSelect),e.mergeProps({key:3,modelValue:r.value,"onUpdate:modelValue":i[3]||(i[3]=o=>r.value=o),placeholder:n.conf.search.getPlaceholder(n.item,e.unref(S).tCurd("placeholderSelect")),clearable:"",disabled:n.item.disabled?.search},n.item.options?.search?.select||n.item.options?.select,e.toHandlers(n.item.options?.search?.select?.on||n.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.item.options?.search?.select?.data||n.item.options?.select?.data||[],o=>(e.openBlock(),e.createBlock(e.unref(b.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):n.type==="radio"?(e.openBlock(),e.createBlock(e.unref(b.ElRadioGroup),e.mergeProps({key:4,modelValue:r.value,"onUpdate:modelValue":i[4]||(i[4]=o=>r.value=o),disabled:n.item.disabled?.search},n.item.options?.search?.radio||n.item.options?.radio,e.toHandlers(n.item.options?.search?.radio?.on||n.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.item.options?.radio?.data,o=>(e.openBlock(),e.createBlock(e.unref(b.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(b.ElDatePicker),e.mergeProps({key:5,modelValue:r.value,"onUpdate:modelValue":i[5]||(i[5]=o=>r.value=o),disabled:n.item.disabled?.search},n.item.options?.search?.datetime||n.item.options?.datetime,e.toHandlers(n.item.options?.search?.datetime?.on||n.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):n.type&&e.unref(v).customComponent[n.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).customComponent[n.type]),e.mergeProps({key:6,modelValue:r.value,"onUpdate:modelValue":i[6]||(i[6]=o=>r.value=o)},n.item.options?.search?.[n.type]||n.item.options?.[n.type],e.toHandlers(n.item.options?.search?.[n.type]?.on||n.item.options?.[n.type]?.on||{}),{disabled:n.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),Me=(a,t)=>{const r=a.__vccOpts||a;for(const[n,i]of t)r[n]=i;return r},Cn={},En={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Sn(a,t){return e.openBlock(),e.createElementBlock("svg",En,t[0]||(t[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 Bn=Me(Cn,[["render",Sn]]),Dn={},Vn={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Nn(a,t){return e.openBlock(),e.createElementBlock("svg",Vn,t[0]||(t[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 On=Me(Dn,[["render",Nn]]),Tn={},Mn={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function An(a,t){return e.openBlock(),e.createElementBlock("svg",Mn,t[0]||(t[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 Fn=Me(Tn,[["render",An]]),zn={},Rn={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function In(a,t){return e.openBlock(),e.createElementBlock("svg",Rn,t[0]||(t[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 co=Me(zn,[["render",In]]),$n={},Ln={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Un(a,t){return e.openBlock(),e.createElementBlock("svg",Ln,t[0]||(t[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 Hn=Me($n,[["render",Un]]),Pn={},jn={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Kn(a,t){return e.openBlock(),e.createElementBlock("svg",jn,t[0]||(t[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 Gn=Me(Pn,[["render",Kn]]),xn={class:"row flex-center table-header-label inline"},Wn={class:"table-header-tooltip"},Xn=["innerHTML"],Yn={key:1,class:"table-header-required"},qn=["onClick"],Jn={key:0,class:"table-edit-form"},Qn={key:1},Zn=["onClick","innerHTML"],_n=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(a){const t=N.isFun,r=a,i=e.getCurrentInstance().type,o=s=>s===!0?!0:(Array.isArray(s)?s:s?[s]:[]).some(f=>f?.required===!0),l=s=>r.option.table?.editMode?o(s.rules)||o(r.conf.update.rules?.[s.key]):!1;return(s,c)=>{const f=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.columnList,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.key},[s.conf.table.column.show.list.includes(d.key)&&(d.show?.table===void 0||e.unref(t)(d.show?.table,s.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(b.ElTableColumn),e.mergeProps({key:0,prop:d.key,label:d.label,ref_for:!0},d.table),{header:e.withCtx(()=>[e.renderSlot(s.$slots,"table-header-"+d.key,{item:d},()=>[e.createElementVNode("div",xn,[d.table?.header?.tooltip?(e.openBlock(),e.createBlock(f,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:d.table?.header?.tooltip},null,8,Xn)]),default:e.withCtx(()=>[e.createElementVNode("span",Wn,[e.createVNode(co)])]),_:2},1024)):e.createCommentVNode("",!0),l(d)?(e.openBlock(),e.createElementBlock("span",Yn,"*")):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,s.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(Hn,{key:0})):(e.openBlock(),e.createBlock(Gn,{key:1}))],8,qn)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:u})=>[d.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c[0]||(c[0]=e.createTextVNode("   ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)),{conf:s.conf,columnList:d.children,option:s.option},e.createSlots({_:2},[e.renderList(s.$slots,(p,m)=>({name:m,fn:e.withCtx(h=>[e.renderSlot(s.$slots,m,e.mergeProps({ref_for:!0},h||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",Jn,[e.createVNode(e.unref(b.ElFormItem),{size:s.option.size?.table,error:s.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(s.$slots,"table-edit-left-"+d.key,{row:u,item:d}),d.type==="input"?(e.openBlock(),e.createBlock(e.unref(b.ElInput),e.mergeProps({key:0,modelValue:u[d.key],"onUpdate:modelValue":p=>u[d.key]=p,disabled:s.conf.update.getDisabled(d,!0),class:"col",ref_for:!0},s.conf.update.getBind(d),e.toHandlers(s.conf.update.getOn(d,u)),{"onUpdate:modelValue":p=>s.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(b.ElSelect),e.mergeProps({key:1,modelValue:u[d.key],"onUpdate:modelValue":p=>u[d.key]=p,disabled:s.conf.update.getDisabled(d,!0),class:"col",ref_for:!0},s.conf.update.getBind(d),e.toHandlers(s.conf.update.getOn(d,u)),{"onUpdate:modelValue":p=>s.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,p=>(e.openBlock(),e.createBlock(e.unref(b.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):d.type==="switch"?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),e.mergeProps({key:2,modelValue:u[d.key],"onUpdate:modelValue":p=>u[d.key]=p,disabled:s.conf.update.getDisabled(d,!0),class:"col",ref_for:!0},s.conf.update.getBind(d),e.toHandlers(s.conf.update.getOn(d,u)),{"onUpdate:modelValue":p=>s.conf.tableEditValidate.clearField(u,d)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"table-edit-right-"+d.key,{row:u,item:d})],2)]),_:2},1032,["size","error"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.conf.update.type===e.unref(N).EDialog.Update&&e.unref(t)(d.show?.form,s.conf.update.form,e.unref(N).EDialog.Update)&&s.option.table?.inlineEdit&&s.conf.update.form[s.option.table?.rowKey]===u[s.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(b.ElInput),e.mergeProps({key:0,modelValue:s.conf.update.form[d.key],"onUpdate:modelValue":p=>s.conf.update.form[d.key]=p,disabled:s.conf.update.getDisabled(d,!0),ref_for:!0},s.conf.update.getBind(d),e.toHandlers(s.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(b.ElSelect),e.mergeProps({key:1,modelValue:s.conf.update.form[d.key],"onUpdate:modelValue":p=>s.conf.update.form[d.key]=p,disabled:s.conf.update.getDisabled(d,!0),ref_for:!0},s.conf.update.getBind(d),e.toHandlers(s.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,p=>(e.openBlock(),e.createBlock(e.unref(b.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):d.type==="switch"?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),e.mergeProps({key:2,modelValue:s.conf.update.form[d.key],"onUpdate:modelValue":p=>s.conf.update.form[d.key]=p,ref_for:!0},s.conf.update.getBind(d),e.toHandlers(s.conf.update.getOn(d,u)),{disabled:s.conf.update.getDisabled(d,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(s.$slots,"table-"+d.key,{key:1,row:u,item:d},()=>[e.unref(v).customComponent[d.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).customComponent[d.type??""]?.table),e.mergeProps({key:0,modelValue:u[d.key],"onUpdate:modelValue":p=>u[d.key]=p,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(b.ElSwitch),e.mergeProps({key:0,modelValue:u[d.key],"onUpdate:modelValue":p=>u[d.key]=p,loading:d.options?.switch?.loadingMap?.[u[s.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",Qn,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:p=>d.table?.click?.callback?.(u),innerHTML:d.table?.format?d.table?.format(u):u[d.key]},null,14,Zn))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),vn={key:0,class:"relative curd-search fit-width"},er={class:"mb-10 flex justify-between items-center fit-width"},tr={class:"flex items-center",style:{gap:"10px"}},or={key:0},nr={key:1},rr={key:2},ar={class:"export-btn"},ir={key:1,class:"export-btn"},lr={class:"flex items-center table-tools-right",style:{gap:"10px"}},sr={class:"table-sortable-tooltip"},dr=["innerHTML"],cr={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},fr={class:"dialog-footer"},pr={key:0},ur={key:1},mr={class:"dialog-footer"},fo=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:void 0},searchForm:{default:void 0}},setup(a,{expose:t}){const r=N.EDialog,n=a,i=N.isFun,{conf:o,switchConfirmRef:l,ruleFormRef:s,tableRef:c}=gn(n);return t({conf:o}),(f,d)=>{const u=e.resolveComponent("el-tooltip"),p=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[a.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[a.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(f.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[a.option.table?.fitHeight?"col":""]])},[a.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",vn,[e.createVNode(e.unref(b.ElForm),{model:e.unref(o).search.form,inline:"",size:a.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m.key},[e.renderSlot(f.$slots,"search-"+m.key+"-start",{row:e.unref(o).search.form}),(typeof m.show?.search=="function"?m.show?.search(e.unref(o).search.form):m.show?.search)?(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0,label:m.text?.search?.label??m.label},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"search-"+m.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(f.$slots,"search-"+m.key,{row:e.unref(o).search.form},()=>[m.options?.search?.type?(e.openBlock(),e.createBlock(so,{key:0,item:m,conf:e.unref(o),type:m.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(so,{key:1,item:m,conf:e.unref(o),type:m.type},null,8,["item","conf","type"]))]),e.renderSlot(f.$slots,"search-"+m.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"search-"+m.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(f.$slots,"search-center",{row:e.unref(o).search.form}),a.option.tools?.search||a.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0},{default:e.withCtx(()=>[a.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),a.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",er,[e.createElementVNode("div",tr,[e.unref(i)(a.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",or,[e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:d[0]||(d[0]=m=>e.unref(o).update.open(e.unref(r).Add)),size:a.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),a.option.table?.selectable&&e.unref(i)(a.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",nr,[e.createVNode(e.unref(b.ElButton),{type:"danger",onClick:d[1]||(d[1]=m=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:a.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),a.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",rr,[e.createVNode(e.unref(b.ElButton),{type:"warning",onClick:d[2]||(d[2]=m=>e.unref(o).table.expand.all()),size:a.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),a.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[a.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(b.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(b.ElDropdownMenu),{size:a.option.size?.search},{default:e.withCtx(()=>[a.option.tools?.export?.dropdown?.select&&(a.option.table?.selectable||e.unref(i)(a.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(b.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),a.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(b.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),a.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(b.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",ar,[e.createVNode(e.unref(b.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:a.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",ir,[e.createVNode(e.unref(b.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:a.option.size?.search,onClick:d[3]||(d[3]=m=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"tools-left")]),e.createElementVNode("div",lr,[e.renderSlot(f.$slots,"tools-right"),e.unref(o).page.showTools&&e.unref(o).table.sortable.showPagination()?(e.openBlock(),e.createBlock(e.unref(b.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":d[4]||(d[4]=m=>e.unref(o).page.num=m),"page-size":e.unref(o).page.size,"onUpdate:pageSize":d[5]||(d[5]=m=>e.unref(o).page.size=m),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:a.option.size?.table,onSizeChange:e.unref(o).table.sortable.refreshList,onCurrentChange:e.unref(o).table.sortable.refreshList},a.option.page?.pagination||{},e.toHandlers(a.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),e.unref(o).table.sortable.showTriggerButton()?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:1,type:"warning",onClick:e.unref(o).table.sortable.start,size:a.option.size?.search,loading:e.unref(o).table.sortable.actionLoading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("sortableStart")),1)]),_:1},8,["onClick","size","loading"])):e.createCommentVNode("",!0),e.unref(o).table.sortable.showActionButton()?(e.openBlock(),e.createBlock(e.unref(b.ElDropdown),{key:2,onCommand:e.unref(o).table.sortable.command},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(b.ElDropdownMenu),{size:a.option.size?.search},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElDropdownItem),{command:"save"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("sortableSave")),1)]),_:1}),e.createVNode(e.unref(b.ElDropdownItem),{command:"exit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("sortableExit")),1)]),_:1})]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{type:"warning",size:a.option.size?.search,loading:e.unref(o).table.sortable.actionLoading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("sortableAction")),1)]),_:1},8,["size","loading"])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.unref(o).table.sortable.showSaveButton()?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:3,type:"warning",onClick:e.unref(o).table.sortable.save,size:a.option.size?.search,loading:e.unref(o).table.sortable.actionLoading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("sortableSave")),1)]),_:1},8,["onClick","size","loading"])):e.createCommentVNode("",!0),a.option.tools?.expandColumn===void 0||a.option.tools?.expandColumn?(e.openBlock(),e.createBlock(u,{key:4,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(S).tCurd("mergeColumn"):e.unref(S).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[a.option.size?.search]]),onClick:d[6]||(d[6]=(...m)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...m))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(Bn,{key:0})):(e.openBlock(),e.createBlock(On,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),a.option.tools?.refresh===void 0||a.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:5,class:e.normalizeClass(["refresh-btn",[a.option.size?.search]]),onClick:d[7]||(d[7]=(...m)=>e.unref(o).table.sortable.refreshList&&e.unref(o).table.sortable.refreshList(...m))},[e.createVNode(Fn)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[a.option.table?.fitHeight?"col ":"",a.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[a.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(b.ElTable),e.mergeProps({ref_key:"tableRef",ref:c,data:e.unref(o).table.data,border:a.option.table?.border===void 0?!0:a.option.table?.border,class:{"cc1-form-sortable-no-scroll":e.unref(o).table.sortable.disableScroll()},onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},e.unref(o).table.sortable.getTableBindOption(),e.toHandlers(a.option.table?.on||{})),{default:e.withCtx(()=>[(typeof a.option.table?.selectable=="object"?a.option.table?.selectable?.show:a.option.table?.selectable)||e.unref(i)(a.option.tools?.delete)||a.option.tools?.export?.show&&a.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(b.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof a.option.table?.selectable=="object"?a.option.table?.selectable:{},e.toHandlers(typeof a.option.table?.selectable=="object"?a.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof a.option.table?.index=="object"?a.option.table?.index?.show:a.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(b.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof a.option.table?.index=="object"?a.option.table?.index:{},e.toHandlers(typeof a.option.table?.index=="object"?a.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.unref(o).table.sortable.isActive()?(e.openBlock(),e.createBlock(e.unref(b.ElTableColumn),e.mergeProps({key:2,align:"center","show-overflow-tooltip":!1,className:"cc1-form-drag-column"},e.unref(o).table.sortable.getColumnBind(),e.toHandlers(e.unref(o).table.sortable.getColumnBind().on||{})),{header:e.withCtx(()=>[e.renderSlot(f.$slots,"table-header-sortable",{},()=>[e.createVNode(u,{effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:e.unref(S).tCurd("sortable")},null,8,dr)]),default:e.withCtx(()=>[e.createElementVNode("span",sr,[e.createVNode(co)])]),_:1})])]),default:e.withCtx(()=>d[12]||(d[12]=[e.createElementVNode("span",{class:"cc1-form-drag-handle"},"::",-1)])),_:3},16)):e.createCommentVNode("",!0),e.createVNode(_n,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:a.option},e.createSlots({_:2},[e.renderList(f.$slots,(m,h)=>({name:h,fn:e.withCtx(k=>[e.renderSlot(f.$slots,h,e.normalizeProps(e.guardReactiveProps(k||{})))])}))]),1032,["conf","columnList","option"]),e.unref(i)(a.option.table?.add)||e.unref(i)(a.option.table?.update)||e.unref(i)(a.option.table?.delete)||e.unref(i)(a.option.table?.view)||f.$slots["table-op-left"]||f.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(b.ElTableColumn),e.mergeProps({key:3,align:"center",fixed:"right"},a.option.table?.operate,{width:a.option.table?.operate?.width||120,"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(f.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("operation")),1)])]),default:e.withCtx(({row:m})=>[e.createVNode(e.unref(b.ElForm),{size:a.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"table-op-left",{row:m}),e.unref(o).update.type===e.unref(r).Update&&a.option.table?.inlineEdit&&e.unref(o).update.form[n.option.table?.rowKey]===m[n.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(b.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(b.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(f.$slots,"table-op-edit-right",{row:m})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(a.option.table?.add,m)?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:0,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(r).Add,m)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(a.option.table?.view,m)?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:1,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(r).View,m)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(a.option.table?.update,m)?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:2,link:"",type:"warning",onClick:h=>e.unref(o).update.open(e.unref(r).Update,m)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(a.option.table?.delete,m)?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:3,link:"",type:"danger",onClick:h=>e.unref(o).remove.open([m])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-op-right",{row:m})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","class","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[p,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",cr,[(a.option.page?.show===void 0||a.option.page?.show)&&!e.unref(o).page.showTools&&e.unref(o).table.sortable.showPagination()?(e.openBlock(),e.createBlock(e.unref(b.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":d[8]||(d[8]=m=>e.unref(o).page.num=m),"page-size":e.unref(o).page.size,"onUpdate:pageSize":d[9]||(d[9]=m=>e.unref(o).page.size=m),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:a.option.size?.table,onSizeChange:e.unref(o).table.sortable.refreshList,onCurrentChange:e.unref(o).table.sortable.refreshList},a.option.page?.pagination||{},e.toHandlers(a.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(f.$slots,"box-right")],2),e.createVNode(e.unref(b.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":d[10]||(d[10]=m=>e.unref(o).update.show=m),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},a.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",fr,[e.createVNode(e.unref(b.ElForm),{size:a.option.size?.form},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"dialog-footer",{row:e.unref(o).update},()=>[e.createVNode(e.unref(b.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(r).View?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),_:3},8,["size"])])]),default:e.withCtx(()=>[e.renderSlot(f.$slots,"dialog-start",{row:e.unref(o).update}),e.createVNode(e.unref(b.ElForm),{ref_key:"ruleFormRef",ref:s,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:a.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(),e.createBlock(ao,{key:0,"form-grid":e.unref(o).update.formGrid,"max-span":e.unref(o).update.formMaxSpan,form:e.unref(o).update.form,type:e.unref(o).update.type,stripe:a.option.form?.stripe,"label-width":a.option.form?.labelWidth,"form-option":a.option.form,"get-bind":e.unref(o).update.getBind,"get-on":e.unref(o).update.getOn,"get-disabled":e.unref(o).update.getDisabled},e.createSlots({_:2},[e.renderList(f.$slots,(m,h)=>({name:h,fn:e.withCtx(k=>[e.renderSlot(f.$slots,h,e.normalizeProps(e.guardReactiveProps(k||{})))])}))]),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(f.$slots,"dialog-end",{row:e.unref(o).update})]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(b.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":d[11]||(d[11]=m=>e.unref(o).remove.show=m),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",mr,[e.createVNode(e.unref(b.ElForm),{size:a.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(b.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[a.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",pr,[e.createVNode(kn,{content:a.option.dialog?.delete?.content,value:e.unref(o).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",ur,e.toDisplayString(e.unref(S).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(yn,{ref_key:"switchConfirmRef",ref:l,size:a.option.size?.form},null,8,["size"])],2)}}});class hr{static async download(t,r="download.png"){const n=document.createElement("a");n.style.display="none",n.href=t,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(t)}static exportJSONFile=(t,r)=>{const n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download=`${r||"config"}.json`,o.click()};static importFile=async t=>new Promise((r,n)=>{const i=document.createElement("input");i.type="file";const o=t?.accept||".json";i.accept=o,i.style.display="none",i.onchange=l=>{const s=l.target.files[0];if(!s){N.fail("未选择文件"),n("未选择文件");return}const c=new FileReader;c.onload=async f=>{const d=o==".json"?JSON.parse(f.target.result):f.target.result;r(d)},c.onerror=()=>{N.fail("文件读取失败"),n("文件读取失败")},c.readAsText(s),document.body.removeChild(i)},document.body.appendChild(i),i.click()})}const po=(a,t)=>{if(a.component("TCurd",fo),a.component("TFormList",Ct),a.component("TColumn",io),t?.customComponent){v.customComponent=t.customComponent;for(const r in t.customComponent)a.component(r,t.customComponent[r])}},gr={install:po};/**!
2
+ * Sortable 1.15.7
3
+ * @author RubaXa <trash@rubaxa.org>
4
+ * @author owenm <owen23355@gmail.com>
5
+ * @license MIT
6
+ */function Bt(a,t){(t==null||t>a.length)&&(t=a.length);for(var r=0,n=Array(t);r<t;r++)n[r]=a[r];return n}function br(a){if(Array.isArray(a))return Bt(a)}function yr(a,t,r){return(t=Dr(t))in a?Object.defineProperty(a,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[t]=r,a}function de(){return de=Object.assign?Object.assign.bind():function(a){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},de.apply(null,arguments)}function wr(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function kr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uo(a,t){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),r.push.apply(r,n)}return r}function ue(a){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uo(Object(r),!0).forEach(function(n){yr(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):uo(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function Cr(a,t){if(a==null)return{};var r,n,i=Er(a,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(a);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function Er(a,t){if(a==null)return{};var r={};for(var n in a)if({}.hasOwnProperty.call(a,n)){if(t.indexOf(n)!==-1)continue;r[n]=a[n]}return r}function Sr(a){return br(a)||wr(a)||Vr(a)||kr()}function Br(a,t){if(typeof a!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var n=r.call(a,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(a)}function Dr(a){var t=Br(a,"string");return typeof t=="symbol"?t:t+""}function Dt(a){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(a)}function Vr(a,t){if(a){if(typeof a=="string")return Bt(a,t);var r={}.toString.call(a).slice(8,-1);return r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set"?Array.from(a):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bt(a,t):void 0}}var Nr="1.15.7";function ge(a){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(a)}var be=ge(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ue=ge(/Edge/i),mo=ge(/firefox/i),He=ge(/safari/i)&&!ge(/chrome/i)&&!ge(/android/i),Vt=ge(/iP(ad|od|hone)/i),ho=ge(/chrome/i)&&ge(/android/i),go={capture:!1,passive:!1};function M(a,t,r){a.addEventListener(t,r,!be&&go)}function O(a,t,r){a.removeEventListener(t,r,!be&&go)}function nt(a,t){if(t){if(t[0]===">"&&(t=t.substring(1)),a)try{if(a.matches)return a.matches(t);if(a.msMatchesSelector)return a.msMatchesSelector(t);if(a.webkitMatchesSelector)return a.webkitMatchesSelector(t)}catch{return!1}return!1}}function bo(a){return a.host&&a!==document&&a.host.nodeType&&a.host!==a?a.host:a.parentNode}function ne(a,t,r,n){if(a){r=r||document;do{if(t!=null&&(t[0]===">"?a.parentNode===r&&nt(a,t):nt(a,t))||n&&a===r)return a;if(a===r)break}while(a=bo(a))}return null}var yo=/\s+/g;function K(a,t,r){if(a&&t)if(a.classList)a.classList[r?"add":"remove"](t);else{var n=(" "+a.className+" ").replace(yo," ").replace(" "+t+" "," ");a.className=(n+(r?" "+t:"")).replace(yo," ")}}function C(a,t,r){var n=a&&a.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(a,""):a.currentStyle&&(r=a.currentStyle),t===void 0?r:r[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=r+(typeof r=="string"?"":"px")}}function Be(a,t){var r="";if(typeof a=="string")r=a;else do{var n=C(a,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!t&&(a=a.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function wo(a,t,r){if(a){var n=a.getElementsByTagName(t),i=0,o=n.length;if(r)for(;i<o;i++)r(n[i],i);return n}return[]}function me(){var a=document.scrollingElement;return a||document.documentElement}function P(a,t,r,n,i){if(!(!a.getBoundingClientRect&&a!==window)){var o,l,s,c,f,d,u;if(a!==window&&a.parentNode&&a!==me()?(o=a.getBoundingClientRect(),l=o.top,s=o.left,c=o.bottom,f=o.right,d=o.height,u=o.width):(l=0,s=0,c=window.innerHeight,f=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||r)&&a!==window&&(i=i||a.parentNode,!be))do if(i&&i.getBoundingClientRect&&(C(i,"transform")!=="none"||r&&C(i,"position")!=="static")){var p=i.getBoundingClientRect();l-=p.top+parseInt(C(i,"border-top-width")),s-=p.left+parseInt(C(i,"border-left-width")),c=l+o.height,f=s+o.width;break}while(i=i.parentNode);if(n&&a!==window){var m=Be(i||a),h=m&&m.a,k=m&&m.d;m&&(l/=k,s/=h,u/=h,d/=k,c=l+d,f=s+u)}return{top:l,left:s,bottom:c,right:f,width:u,height:d}}}function ko(a,t,r){for(var n=ke(a,!0),i=P(a)[t];n;){var o=P(n)[r],l=void 0;if(l=i>=o,!l)return n;if(n===me())break;n=ke(n,!1)}return!1}function Ae(a,t,r,n){for(var i=0,o=0,l=a.children;o<l.length;){if(l[o].style.display!=="none"&&l[o]!==B.ghost&&(n||l[o]!==B.dragged)&&ne(l[o],r.draggable,a,!1)){if(i===t)return l[o];i++}o++}return null}function Nt(a,t){for(var r=a.lastElementChild;r&&(r===B.ghost||C(r,"display")==="none"||t&&!nt(r,t));)r=r.previousElementSibling;return r||null}function x(a,t){var r=0;if(!a||!a.parentNode)return-1;for(;a=a.previousElementSibling;)a.nodeName.toUpperCase()!=="TEMPLATE"&&a!==B.clone&&(!t||nt(a,t))&&r++;return r}function Co(a){var t=0,r=0,n=me();if(a)do{var i=Be(a),o=i.a,l=i.d;t+=a.scrollLeft*o,r+=a.scrollTop*l}while(a!==n&&(a=a.parentNode));return[t,r]}function Or(a,t){for(var r in a)if(a.hasOwnProperty(r)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===a[r][n])return Number(r)}return-1}function ke(a,t){if(!a||!a.getBoundingClientRect)return me();var r=a,n=!1;do if(r.clientWidth<r.scrollWidth||r.clientHeight<r.scrollHeight){var i=C(r);if(r.clientWidth<r.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||r.clientHeight<r.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!r.getBoundingClientRect||r===document.body)return me();if(n||t)return r;n=!0}}while(r=r.parentNode);return me()}function Tr(a,t){if(a&&t)for(var r in t)t.hasOwnProperty(r)&&(a[r]=t[r]);return a}function Ot(a,t){return Math.round(a.top)===Math.round(t.top)&&Math.round(a.left)===Math.round(t.left)&&Math.round(a.height)===Math.round(t.height)&&Math.round(a.width)===Math.round(t.width)}var Pe;function Eo(a,t){return function(){if(!Pe){var r=arguments,n=this;r.length===1?a.call(n,r[0]):a.apply(n,r),Pe=setTimeout(function(){Pe=void 0},t)}}}function Mr(){clearTimeout(Pe),Pe=void 0}function So(a,t,r){a.scrollLeft+=t,a.scrollTop+=r}function Tt(a){var t=window.Polymer,r=window.jQuery||window.Zepto;return t&&t.dom?t.dom(a).cloneNode(!0):r?r(a).clone(!0)[0]:a.cloneNode(!0)}function Bo(a,t){C(a,"position","absolute"),C(a,"top",t.top),C(a,"left",t.left),C(a,"width",t.width),C(a,"height",t.height)}function Mt(a){C(a,"position",""),C(a,"top",""),C(a,"left",""),C(a,"width",""),C(a,"height","")}function Do(a,t,r){var n={};return Array.from(a.children).forEach(function(i){var o,l,s,c;if(!(!ne(i,t.draggable,a,!1)||i.animated||i===r)){var f=P(i);n.left=Math.min((o=n.left)!==null&&o!==void 0?o:1/0,f.left),n.top=Math.min((l=n.top)!==null&&l!==void 0?l:1/0,f.top),n.right=Math.max((s=n.right)!==null&&s!==void 0?s:-1/0,f.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,f.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Q="Sortable"+new Date().getTime();function Ar(){var a=[],t;return{captureAnimationState:function(){if(a=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(C(i,"display")==="none"||i===B.ghost)){a.push({target:i,rect:P(i)});var o=ue({},a[a.length-1].rect);if(i.thisAnimationDuration){var l=Be(i,!0);l&&(o.top-=l.f,o.left-=l.e)}i.fromRect=o}})}},addAnimationState:function(n){a.push(n)},removeAnimationState:function(n){a.splice(Or(a,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var o=!1,l=0;a.forEach(function(s){var c=0,f=s.target,d=f.fromRect,u=P(f),p=f.prevFromRect,m=f.prevToRect,h=s.rect,k=Be(f,!0);k&&(u.top-=k.f,u.left-=k.e),f.toRect=u,f.thisAnimationDuration&&Ot(p,u)&&!Ot(d,u)&&(h.top-u.top)/(h.left-u.left)===(d.top-u.top)/(d.left-u.left)&&(c=zr(h,p,m,i.options)),Ot(u,d)||(f.prevFromRect=d,f.prevToRect=u,c||(c=i.options.animation),i.animate(f,h,u,c)),c&&(o=!0,l=Math.max(l,c),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},c),f.thisAnimationDuration=c)}),clearTimeout(t),o?t=setTimeout(function(){typeof n=="function"&&n()},l):typeof n=="function"&&n(),a=[]},animate:function(n,i,o,l){if(l){C(n,"transition",""),C(n,"transform","");var s=Be(this.el),c=s&&s.a,f=s&&s.d,d=(i.left-o.left)/(c||1),u=(i.top-o.top)/(f||1);n.animatingX=!!d,n.animatingY=!!u,C(n,"transform","translate3d("+d+"px,"+u+"px,0)"),this.forRepaintDummy=Fr(n),C(n,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),C(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){C(n,"transition",""),C(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},l)}}}}function Fr(a){return a.offsetWidth}function zr(a,t,r,n){return Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))/Math.sqrt(Math.pow(t.top-r.top,2)+Math.pow(t.left-r.left,2))*n.animation}var Fe=[],At={initializeByDefault:!0},je={mount:function(t){for(var r in At)At.hasOwnProperty(r)&&!(r in t)&&(t[r]=At[r]);Fe.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Fe.push(t)},pluginEvent:function(t,r,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var o=t+"Global";Fe.forEach(function(l){r[l.pluginName]&&(r[l.pluginName][o]&&r[l.pluginName][o](ue({sortable:r},n)),r.options[l.pluginName]&&r[l.pluginName][t]&&r[l.pluginName][t](ue({sortable:r},n)))})},initializePlugins:function(t,r,n,i){Fe.forEach(function(s){var c=s.pluginName;if(!(!t.options[c]&&!s.initializeByDefault)){var f=new s(t,r,t.options);f.sortable=t,f.options=t.options,t[c]=f,de(n,f.defaults)}});for(var o in t.options)if(t.options.hasOwnProperty(o)){var l=this.modifyOption(t,o,t.options[o]);typeof l<"u"&&(t.options[o]=l)}},getEventProperties:function(t,r){var n={};return Fe.forEach(function(i){typeof i.eventProperties=="function"&&de(n,i.eventProperties.call(r[i.pluginName],t))}),n},modifyOption:function(t,r,n){var i;return Fe.forEach(function(o){t[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[r]=="function"&&(i=o.optionListeners[r].call(t[o.pluginName],n))}),i}};function Ke(a){var t=a.sortable,r=a.rootEl,n=a.name,i=a.targetEl,o=a.cloneEl,l=a.toEl,s=a.fromEl,c=a.oldIndex,f=a.newIndex,d=a.oldDraggableIndex,u=a.newDraggableIndex,p=a.originalEvent,m=a.putSortable,h=a.extraEventProperties;if(t=t||r&&r[Q],!!t){var k,T=t.options,A="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!be&&!Ue?k=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(k=document.createEvent("Event"),k.initEvent(n,!0,!0)),k.to=l||r,k.from=s||r,k.item=i||r,k.clone=o,k.oldIndex=c,k.newIndex=f,k.oldDraggableIndex=d,k.newDraggableIndex=u,k.originalEvent=p,k.pullMode=m?m.lastPutMode:void 0;var E=ue(ue({},h),je.getEventProperties(n,t));for(var R in E)k[R]=E[R];r&&r.dispatchEvent(k),T[A]&&T[A].call(t,k)}}var Rr=["evt"],re=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=Cr(n,Rr);je.pluginEvent.bind(B)(t,r,ue({dragEl:y,parentEl:W,ghostEl:D,rootEl:j,nextEl:De,lastDownEl:rt,cloneEl:G,cloneHidden:Ce,dragStarted:xe,putSortable:Z,activeSortable:B.active,originalEvent:i,oldIndex:ze,oldDraggableIndex:Ge,newIndex:le,newDraggableIndex:Ee,hideGhostForTarget:Fo,unhideGhostForTarget:zo,cloneNowHidden:function(){Ce=!0},cloneNowShown:function(){Ce=!1},dispatchSortableEvent:function(s){oe({sortable:r,name:s,originalEvent:i})}},o))};function oe(a){Ke(ue({putSortable:Z,cloneEl:G,targetEl:y,rootEl:j,oldIndex:ze,oldDraggableIndex:Ge,newIndex:le,newDraggableIndex:Ee},a))}var y,W,D,j,De,rt,G,Ce,ze,le,Ge,Ee,at,Z,Re=!1,it=!1,lt=[],Ve,fe,Ft,zt,Vo,No,xe,Ie,We,Xe=!1,st=!1,dt,ee,Rt=[],It=!1,ct=[],ft=typeof document<"u",pt=Vt,Oo=Ue||be?"cssFloat":"float",Ir=ft&&!ho&&!Vt&&"draggable"in document.createElement("div"),To=(function(){if(ft){if(be)return!1;var a=document.createElement("x");return a.style.cssText="pointer-events:auto",a.style.pointerEvents==="auto"}})(),Mo=function(t,r){var n=C(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Ae(t,0,r),l=Ae(t,1,r),s=o&&C(o),c=l&&C(l),f=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+P(o).width,d=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+P(l).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&s.float&&s.float!=="none"){var u=s.float==="left"?"left":"right";return l&&(c.clear==="both"||c.clear===u)?"vertical":"horizontal"}return o&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||f>=i&&n[Oo]==="none"||l&&n[Oo]==="none"&&f+d>i)?"vertical":"horizontal"},$r=function(t,r,n){var i=n?t.left:t.top,o=n?t.right:t.bottom,l=n?t.width:t.height,s=n?r.left:r.top,c=n?r.right:r.bottom,f=n?r.width:r.height;return i===s||o===c||i+l/2===s+f/2},Lr=function(t,r){var n;return lt.some(function(i){var o=i[Q].options.emptyInsertThreshold;if(!(!o||Nt(i))){var l=P(i),s=t>=l.left-o&&t<=l.right+o,c=r>=l.top-o&&r<=l.bottom+o;if(s&&c)return n=i}}),n},Ao=function(t){function r(o,l){return function(s,c,f,d){var u=s.options.group.name&&c.options.group.name&&s.options.group.name===c.options.group.name;if(o==null&&(l||u))return!0;if(o==null||o===!1)return!1;if(l&&o==="clone")return o;if(typeof o=="function")return r(o(s,c,f,d),l)(s,c,f,d);var p=(l?s:c).options.group.name;return o===!0||typeof o=="string"&&o===p||o.join&&o.indexOf(p)>-1}}var n={},i=t.group;(!i||Dt(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,t.group=n},Fo=function(){!To&&D&&C(D,"display","none")},zo=function(){!To&&D&&C(D,"display","")};ft&&!ho&&document.addEventListener("click",function(a){if(it)return a.preventDefault(),a.stopPropagation&&a.stopPropagation(),a.stopImmediatePropagation&&a.stopImmediatePropagation(),it=!1,!1},!0);var Ne=function(t){if(y){t=t.touches?t.touches[0]:t;var r=Lr(t.clientX,t.clientY);if(r){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[Q]._onDragOver(n)}}},Ur=function(t){y&&y.parentNode[Q]._isOutsideThisEl(t.target)};function B(a,t){if(!(a&&a.nodeType&&a.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(a));this.el=a,this.options=t=de({},t),a[Q]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(a.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Mo(a,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,s){l.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:B.supportPointer!==!1&&"PointerEvent"in window&&(!He||Vt),emptyInsertThreshold:5};je.initializePlugins(this,a,r);for(var n in r)!(n in t)&&(t[n]=r[n]);Ao(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:Ir,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?M(a,"pointerdown",this._onTapStart):(M(a,"mousedown",this._onTapStart),M(a,"touchstart",this._onTapStart)),this.nativeDraggable&&(M(a,"dragover",this),M(a,"dragenter",this)),lt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),de(this,Ar())}B.prototype={constructor:B,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ie=null)},_getDirection:function(t,r){return typeof this.options.direction=="function"?this.options.direction.call(this,t,r,y):this.options.direction},_onTapStart:function(t){if(t.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,l=t.type,s=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,c=(s||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,d=i.filter;if(Xr(n),!y&&!(/mousedown|pointerdown/.test(l)&&t.button!==0||i.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&He&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=ne(c,i.draggable,n,!1),!(c&&c.animated)&&rt!==c)){if(ze=x(c),Ge=x(c,i.draggable),typeof d=="function"){if(d.call(this,t,c,this)){oe({sortable:r,rootEl:f,name:"filter",targetEl:c,toEl:n,fromEl:n}),re("filter",r,{evt:t}),o&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(u){if(u=ne(f,u.trim(),n,!1),u)return oe({sortable:r,rootEl:u,name:"filter",targetEl:c,fromEl:n,toEl:n}),re("filter",r,{evt:t}),!0}),d)){o&&t.preventDefault();return}i.handle&&!ne(f,i.handle,n,!1)||this._prepareDragStart(t,s,c)}}},_prepareDragStart:function(t,r,n){var i=this,o=i.el,l=i.options,s=o.ownerDocument,c;if(n&&!y&&n.parentNode===o){var f=P(n);if(j=o,y=n,W=y.parentNode,De=y.nextSibling,rt=n,at=l.group,B.dragged=y,Ve={target:y,clientX:(r||t).clientX,clientY:(r||t).clientY},Vo=Ve.clientX-f.left,No=Ve.clientY-f.top,this._lastX=(r||t).clientX,this._lastY=(r||t).clientY,y.style["will-change"]="all",c=function(){if(re("delayEnded",i,{evt:t}),B.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!mo&&i.nativeDraggable&&(y.draggable=!0),i._triggerDragStart(t,r),oe({sortable:i,name:"choose",originalEvent:t}),K(y,l.chosenClass,!0)},l.ignore.split(",").forEach(function(d){wo(y,d.trim(),$t)}),M(s,"dragover",Ne),M(s,"mousemove",Ne),M(s,"touchmove",Ne),l.supportPointer?(M(s,"pointerup",i._onDrop),!this.nativeDraggable&&M(s,"pointercancel",i._onDrop)):(M(s,"mouseup",i._onDrop),M(s,"touchend",i._onDrop),M(s,"touchcancel",i._onDrop)),mo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,y.draggable=!0),re("delayStart",this,{evt:t}),l.delay&&(!l.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(Ue||be))){if(B.eventCanceled){this._onDrop();return}l.supportPointer?(M(s,"pointerup",i._disableDelayedDrag),M(s,"pointercancel",i._disableDelayedDrag)):(M(s,"mouseup",i._disableDelayedDrag),M(s,"touchend",i._disableDelayedDrag),M(s,"touchcancel",i._disableDelayedDrag)),M(s,"mousemove",i._delayedDragTouchMoveHandler),M(s,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&M(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(c,l.delay)}else c()}},_delayedDragTouchMoveHandler:function(t){var r=t.touches?t.touches[0]:t;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){y&&$t(y),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;O(t,"mouseup",this._disableDelayedDrag),O(t,"touchend",this._disableDelayedDrag),O(t,"touchcancel",this._disableDelayedDrag),O(t,"pointerup",this._disableDelayedDrag),O(t,"pointercancel",this._disableDelayedDrag),O(t,"mousemove",this._delayedDragTouchMoveHandler),O(t,"touchmove",this._delayedDragTouchMoveHandler),O(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,r){r=r||t.pointerType=="touch"&&t,!this.nativeDraggable||r?this.options.supportPointer?M(document,"pointermove",this._onTouchMove):r?M(document,"touchmove",this._onTouchMove):M(document,"mousemove",this._onTouchMove):(M(y,"dragend",this),M(j,"dragstart",this._onDragStart));try{document.selection?mt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,r){if(Re=!1,j&&y){re("dragStarted",this,{evt:r}),this.nativeDraggable&&M(document,"dragover",Ur);var n=this.options;!t&&K(y,n.dragClass,!1),K(y,n.ghostClass,!0),B.active=this,t&&this._appendGhost(),oe({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(fe){this._lastX=fe.clientX,this._lastY=fe.clientY,Fo();for(var t=document.elementFromPoint(fe.clientX,fe.clientY),r=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(fe.clientX,fe.clientY),t!==r);)r=t;if(y.parentNode[Q]._isOutsideThisEl(t),r)do{if(r[Q]){var n=void 0;if(n=r[Q]._onDragOver({clientX:fe.clientX,clientY:fe.clientY,target:t,rootEl:r}),n&&!this.options.dragoverBubble)break}t=r}while(r=bo(r));zo()}},_onTouchMove:function(t){if(Ve){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=t.touches?t.touches[0]:t,l=D&&Be(D,!0),s=D&&l&&l.a,c=D&&l&&l.d,f=pt&&ee&&Co(ee),d=(o.clientX-Ve.clientX+i.x)/(s||1)+(f?f[0]-Rt[0]:0)/(s||1),u=(o.clientY-Ve.clientY+i.y)/(c||1)+(f?f[1]-Rt[1]:0)/(c||1);if(!B.active&&!Re){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(D){l?(l.e+=d-(Ft||0),l.f+=u-(zt||0)):l={a:1,b:0,c:0,d:1,e:d,f:u};var p="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");C(D,"webkitTransform",p),C(D,"mozTransform",p),C(D,"msTransform",p),C(D,"transform",p),Ft=d,zt=u,fe=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!D){var t=this.options.fallbackOnBody?document.body:j,r=P(y,!0,pt,!0,t),n=this.options;if(pt){for(ee=t;C(ee,"position")==="static"&&C(ee,"transform")==="none"&&ee!==document;)ee=ee.parentNode;ee!==document.body&&ee!==document.documentElement?(ee===document&&(ee=me()),r.top+=ee.scrollTop,r.left+=ee.scrollLeft):ee=me(),Rt=Co(ee)}D=y.cloneNode(!0),K(D,n.ghostClass,!1),K(D,n.fallbackClass,!0),K(D,n.dragClass,!0),C(D,"transition",""),C(D,"transform",""),C(D,"box-sizing","border-box"),C(D,"margin",0),C(D,"top",r.top),C(D,"left",r.left),C(D,"width",r.width),C(D,"height",r.height),C(D,"opacity","0.8"),C(D,"position",pt?"absolute":"fixed"),C(D,"zIndex","100000"),C(D,"pointerEvents","none"),B.ghost=D,t.appendChild(D),C(D,"transform-origin",Vo/parseInt(D.style.width)*100+"% "+No/parseInt(D.style.height)*100+"%")}},_onDragStart:function(t,r){var n=this,i=t.dataTransfer,o=n.options;if(re("dragStart",this,{evt:t}),B.eventCanceled){this._onDrop();return}re("setupClone",this),B.eventCanceled||(G=Tt(y),G.removeAttribute("id"),G.draggable=!1,G.style["will-change"]="",this._hideClone(),K(G,this.options.chosenClass,!1),B.clone=G),n.cloneId=mt(function(){re("clone",n),!B.eventCanceled&&(n.options.removeCloneOnHide||j.insertBefore(G,y),n._hideClone(),oe({sortable:n,name:"clone"}))}),!r&&K(y,o.dragClass,!0),r?(it=!0,n._loopId=setInterval(n._emulateDragOver,50)):(O(document,"mouseup",n._onDrop),O(document,"touchend",n._onDrop),O(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(n,i,y)),M(document,"drop",n),C(y,"transform","translateZ(0)")),Re=!0,n._dragStartId=mt(n._dragStarted.bind(n,r,t)),M(document,"selectstart",n),xe=!0,window.getSelection().removeAllRanges(),He&&C(document.body,"user-select","none")},_onDragOver:function(t){var r=this.el,n=t.target,i,o,l,s=this.options,c=s.group,f=B.active,d=at===c,u=s.sort,p=Z||f,m,h=this,k=!1;if(It)return;function T(_e,vr){re(_e,h,ue({evt:t,isOwner:d,axis:m?"vertical":"horizontal",revert:l,dragRect:i,targetRect:o,canSort:u,fromSortable:p,target:n,completed:E,onMove:function(Lo,ea){return ut(j,r,y,i,Lo,P(Lo),t,ea)},changed:R},vr))}function A(){T("dragOverAnimationCapture"),h.captureAnimationState(),h!==p&&p.captureAnimationState()}function E(_e){return T("dragOverCompleted",{insertion:_e}),_e&&(d?f._hideClone():f._showClone(h),h!==p&&(K(y,Z?Z.options.ghostClass:f.options.ghostClass,!1),K(y,s.ghostClass,!0)),Z!==h&&h!==B.active?Z=h:h===B.active&&Z&&(Z=null),p===h&&(h._ignoreWhileAnimating=n),h.animateAll(function(){T("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(n===y&&!y.animated||n===r&&!n.animated)&&(Ie=null),!s.dragoverBubble&&!t.rootEl&&n!==document&&(y.parentNode[Q]._isOutsideThisEl(t.target),!_e&&Ne(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),k=!0}function R(){le=x(y),Ee=x(y,s.draggable),oe({sortable:h,name:"change",toEl:r,newIndex:le,newDraggableIndex:Ee,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=ne(n,s.draggable,r,!0),T("dragOver"),B.eventCanceled)return k;if(y.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||h._ignoreWhileAnimating===n)return E(!1);if(it=!1,f&&!s.disabled&&(d?u||(l=W!==j):Z===this||(this.lastPutMode=at.checkPull(this,f,y,t))&&c.checkPut(this,f,y,t))){if(m=this._getDirection(t,n)==="vertical",i=P(y),T("dragOverValid"),B.eventCanceled)return k;if(l)return W=j,A(),this._hideClone(),T("revert"),B.eventCanceled||(De?j.insertBefore(y,De):j.appendChild(y)),E(!0);var X=Nt(r,s.draggable);if(!X||Kr(t,m,this)&&!X.animated){if(X===y)return E(!1);if(X&&r===t.target&&(n=X),n&&(o=P(n)),ut(j,r,y,i,n,o,t,!!n)!==!1)return A(),X&&X.nextSibling?r.insertBefore(y,X.nextSibling):r.appendChild(y),W=r,R(),E(!0)}else if(X&&jr(t,m,this)){var _=Ae(r,0,s,!0);if(_===y)return E(!1);if(n=_,o=P(n),ut(j,r,y,i,n,o,t,!1)!==!1)return A(),r.insertBefore(y,_),W=r,R(),E(!0)}else if(n.parentNode===r){o=P(n);var te=0,ie,g=y.parentNode!==r,w=!$r(y.animated&&y.toRect||i,n.animated&&n.toRect||o,m),F=m?"top":"left",I=ko(n,"top","top")||ko(y,"top","top"),U=I?I.scrollTop:void 0;Ie!==n&&(ie=o[F],Xe=!1,st=!w&&s.invertSwap||g),te=Gr(t,n,o,m,w?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,st,Ie===n);var z;if(te!==0){var $=x(y);do $-=te,z=W.children[$];while(z&&(C(z,"display")==="none"||z===D))}if(te===0||z===n)return E(!1);Ie=n,We=te;var ye=n.nextElementSibling,Se=!1;Se=te===1;var wt=ut(j,r,y,i,n,o,t,Se);if(wt!==!1)return(wt===1||wt===-1)&&(Se=wt===1),It=!0,setTimeout(Pr,30),A(),Se&&!ye?r.appendChild(y):n.parentNode.insertBefore(y,Se?ye:n),I&&So(I,0,U-I.scrollTop),W=y.parentNode,ie!==void 0&&!st&&(dt=Math.abs(ie-P(n)[F])),R(),E(!0)}if(r.contains(y))return E(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){O(document,"mousemove",this._onTouchMove),O(document,"touchmove",this._onTouchMove),O(document,"pointermove",this._onTouchMove),O(document,"dragover",Ne),O(document,"mousemove",Ne),O(document,"touchmove",Ne)},_offUpEvents:function(){var t=this.el.ownerDocument;O(t,"mouseup",this._onDrop),O(t,"touchend",this._onDrop),O(t,"pointerup",this._onDrop),O(t,"pointercancel",this._onDrop),O(t,"touchcancel",this._onDrop),O(document,"selectstart",this)},_onDrop:function(t){var r=this.el,n=this.options;if(le=x(y),Ee=x(y,n.draggable),re("drop",this,{evt:t}),W=y&&y.parentNode,le=x(y),Ee=x(y,n.draggable),B.eventCanceled){this._nulling();return}Re=!1,st=!1,Xe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Lt(this.cloneId),Lt(this._dragStartId),this.nativeDraggable&&(O(document,"drop",this),O(r,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),He&&C(document.body,"user-select",""),C(y,"transform",""),t&&(xe&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),D&&D.parentNode&&D.parentNode.removeChild(D),(j===W||Z&&Z.lastPutMode!=="clone")&&G&&G.parentNode&&G.parentNode.removeChild(G),y&&(this.nativeDraggable&&O(y,"dragend",this),$t(y),y.style["will-change"]="",xe&&!Re&&K(y,Z?Z.options.ghostClass:this.options.ghostClass,!1),K(y,this.options.chosenClass,!1),oe({sortable:this,name:"unchoose",toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:t}),j!==W?(le>=0&&(oe({rootEl:W,name:"add",toEl:W,fromEl:j,originalEvent:t}),oe({sortable:this,name:"remove",toEl:W,originalEvent:t}),oe({rootEl:W,name:"sort",toEl:W,fromEl:j,originalEvent:t}),oe({sortable:this,name:"sort",toEl:W,originalEvent:t})),Z&&Z.save()):le!==ze&&le>=0&&(oe({sortable:this,name:"update",toEl:W,originalEvent:t}),oe({sortable:this,name:"sort",toEl:W,originalEvent:t})),B.active&&((le==null||le===-1)&&(le=ze,Ee=Ge),oe({sortable:this,name:"end",toEl:W,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){re("nulling",this),j=y=W=D=De=G=rt=Ce=Ve=fe=xe=le=Ee=ze=Ge=Ie=We=Z=at=B.dragged=B.ghost=B.clone=B.active=null;var t=this.el;ct.forEach(function(r){t.contains(r)&&(r.checked=!0)}),ct.length=Ft=zt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":y&&(this._onDragOver(t),Hr(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],r,n=this.el.children,i=0,o=n.length,l=this.options;i<o;i++)r=n[i],ne(r,l.draggable,this.el,!1)&&t.push(r.getAttribute(l.dataIdAttr)||Wr(r));return t},sort:function(t,r){var n={},i=this.el;this.toArray().forEach(function(o,l){var s=i.children[l];ne(s,this.options.draggable,i,!1)&&(n[o]=s)},this),r&&this.captureAnimationState(),t.forEach(function(o){n[o]&&(i.removeChild(n[o]),i.appendChild(n[o]))}),r&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,r){return ne(t,r||this.options.draggable,this.el,!1)},option:function(t,r){var n=this.options;if(r===void 0)return n[t];var i=je.modifyOption(this,t,r);typeof i<"u"?n[t]=i:n[t]=r,t==="group"&&Ao(n)},destroy:function(){re("destroy",this);var t=this.el;t[Q]=null,O(t,"mousedown",this._onTapStart),O(t,"touchstart",this._onTapStart),O(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(O(t,"dragover",this),O(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(r){r.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),lt.splice(lt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ce){if(re("hideClone",this),B.eventCanceled)return;C(G,"display","none"),this.options.removeCloneOnHide&&G.parentNode&&G.parentNode.removeChild(G),Ce=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ce){if(re("showClone",this),B.eventCanceled)return;y.parentNode==j&&!this.options.group.revertClone?j.insertBefore(G,y):De?j.insertBefore(G,De):j.appendChild(G),this.options.group.revertClone&&this.animate(y,G),C(G,"display",""),Ce=!1}}};function Hr(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.cancelable&&a.preventDefault()}function ut(a,t,r,n,i,o,l,s){var c,f=a[Q],d=f.options.onMove,u;return window.CustomEvent&&!be&&!Ue?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=t,c.from=a,c.dragged=r,c.draggedRect=n,c.related=i||t,c.relatedRect=o||P(t),c.willInsertAfter=s,c.originalEvent=l,a.dispatchEvent(c),d&&(u=d.call(f,c,l)),u}function $t(a){a.draggable=!1}function Pr(){It=!1}function jr(a,t,r){var n=P(Ae(r.el,0,r.options,!0)),i=Do(r.el,r.options,D),o=10;return t?a.clientX<i.left-o||a.clientY<n.top&&a.clientX<n.right:a.clientY<i.top-o||a.clientY<n.bottom&&a.clientX<n.left}function Kr(a,t,r){var n=P(Nt(r.el,r.options.draggable)),i=Do(r.el,r.options,D),o=10;return t?a.clientX>i.right+o||a.clientY>n.bottom&&a.clientX>n.left:a.clientY>i.bottom+o||a.clientX>n.right&&a.clientY>n.top}function Gr(a,t,r,n,i,o,l,s){var c=n?a.clientY:a.clientX,f=n?r.height:r.width,d=n?r.top:r.left,u=n?r.bottom:r.right,p=!1;if(!l){if(s&&dt<f*i){if(!Xe&&(We===1?c>d+f*o/2:c<u-f*o/2)&&(Xe=!0),Xe)p=!0;else if(We===1?c<d+dt:c>u-dt)return-We}else if(c>d+f*(1-i)/2&&c<u-f*(1-i)/2)return xr(t)}return p=p||l,p&&(c<d+f*o/2||c>u-f*o/2)?c>d+f/2?1:-1:0}function xr(a){return x(y)<x(a)?1:-1}function Wr(a){for(var t=a.tagName+a.className+a.src+a.href+a.textContent,r=t.length,n=0;r--;)n+=t.charCodeAt(r);return n.toString(36)}function Xr(a){ct.length=0;for(var t=a.getElementsByTagName("input"),r=t.length;r--;){var n=t[r];n.checked&&ct.push(n)}}function mt(a){return setTimeout(a,0)}function Lt(a){return clearTimeout(a)}ft&&M(document,"touchmove",function(a){(B.active||Re)&&a.cancelable&&a.preventDefault()}),B.utils={on:M,off:O,css:C,find:wo,is:function(t,r){return!!ne(t,r,t,!1)},extend:Tr,throttle:Eo,closest:ne,toggleClass:K,clone:Tt,index:x,nextTick:mt,cancelNextTick:Lt,detectDirection:Mo,getChild:Ae,expando:Q},B.get=function(a){return a[Q]},B.mount=function(){for(var a=arguments.length,t=new Array(a),r=0;r<a;r++)t[r]=arguments[r];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(B.utils=ue(ue({},B.utils),n.utils)),je.mount(n)})},B.create=function(a,t){return new B(a,t)},B.version=Nr;var q=[],Ye,Ut,Ht=!1,Pt,jt,ht,qe;function Yr(){function a(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return a.prototype={dragStarted:function(r){var n=r.originalEvent;this.sortable.nativeDraggable?M(document,"dragover",this._handleAutoScroll):this.options.supportPointer?M(document,"pointermove",this._handleFallbackAutoScroll):n.touches?M(document,"touchmove",this._handleFallbackAutoScroll):M(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(r){var n=r.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?O(document,"dragover",this._handleAutoScroll):(O(document,"pointermove",this._handleFallbackAutoScroll),O(document,"touchmove",this._handleFallbackAutoScroll),O(document,"mousemove",this._handleFallbackAutoScroll)),Ro(),gt(),Mr()},nulling:function(){ht=Ut=Ye=Ht=qe=Pt=jt=null,q.length=0},_handleFallbackAutoScroll:function(r){this._handleAutoScroll(r,!0)},_handleAutoScroll:function(r,n){var i=this,o=(r.touches?r.touches[0]:r).clientX,l=(r.touches?r.touches[0]:r).clientY,s=document.elementFromPoint(o,l);if(ht=r,n||this.options.forceAutoScrollFallback||Ue||be||He){Kt(r,this.options,s,n);var c=ke(s,!0);Ht&&(!qe||o!==Pt||l!==jt)&&(qe&&Ro(),qe=setInterval(function(){var f=ke(document.elementFromPoint(o,l),!0);f!==c&&(c=f,gt()),Kt(r,i.options,f,n)},10),Pt=o,jt=l)}else{if(!this.options.bubbleScroll||ke(s,!0)===me()){gt();return}Kt(r,this.options,ke(s,!1),!1)}}},de(a,{pluginName:"scroll",initializeByDefault:!0})}function gt(){q.forEach(function(a){clearInterval(a.pid)}),q=[]}function Ro(){clearInterval(qe)}var Kt=Eo(function(a,t,r,n){if(t.scroll){var i=(a.touches?a.touches[0]:a).clientX,o=(a.touches?a.touches[0]:a).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=me(),f=!1,d;Ut!==r&&(Ut=r,gt(),Ye=t.scroll,d=t.scrollFn,Ye===!0&&(Ye=ke(r,!0)));var u=0,p=Ye;do{var m=p,h=P(m),k=h.top,T=h.bottom,A=h.left,E=h.right,R=h.width,X=h.height,_=void 0,te=void 0,ie=m.scrollWidth,g=m.scrollHeight,w=C(m),F=m.scrollLeft,I=m.scrollTop;m===c?(_=R<ie&&(w.overflowX==="auto"||w.overflowX==="scroll"||w.overflowX==="visible"),te=X<g&&(w.overflowY==="auto"||w.overflowY==="scroll"||w.overflowY==="visible")):(_=R<ie&&(w.overflowX==="auto"||w.overflowX==="scroll"),te=X<g&&(w.overflowY==="auto"||w.overflowY==="scroll"));var U=_&&(Math.abs(E-i)<=l&&F+R<ie)-(Math.abs(A-i)<=l&&!!F),z=te&&(Math.abs(T-o)<=l&&I+X<g)-(Math.abs(k-o)<=l&&!!I);if(!q[u])for(var $=0;$<=u;$++)q[$]||(q[$]={});(q[u].vx!=U||q[u].vy!=z||q[u].el!==m)&&(q[u].el=m,q[u].vx=U,q[u].vy=z,clearInterval(q[u].pid),(U!=0||z!=0)&&(f=!0,q[u].pid=setInterval(function(){n&&this.layer===0&&B.active._onTouchMove(ht);var ye=q[this.layer].vy?q[this.layer].vy*s:0,Se=q[this.layer].vx?q[this.layer].vx*s:0;typeof d=="function"&&d.call(B.dragged.parentNode[Q],Se,ye,a,ht,q[this.layer].el)!=="continue"||So(q[this.layer].el,Se,ye)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&p!==c&&(p=ke(p,!1)));Ht=f}},30),Io=function(t){var r=t.originalEvent,n=t.putSortable,i=t.dragEl,o=t.activeSortable,l=t.dispatchSortableEvent,s=t.hideGhostForTarget,c=t.unhideGhostForTarget;if(r){var f=n||o;s();var d=r.changedTouches&&r.changedTouches.length?r.changedTouches[0]:r,u=document.elementFromPoint(d.clientX,d.clientY);c(),f&&!f.el.contains(u)&&(l("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Gt(){}Gt.prototype={startIndex:null,dragStart:function(t){var r=t.oldDraggableIndex;this.startIndex=r},onSpill:function(t){var r=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=Ae(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(r,i):this.sortable.el.appendChild(r),this.sortable.animateAll(),n&&n.animateAll()},drop:Io},de(Gt,{pluginName:"revertOnSpill"});function xt(){}xt.prototype={onSpill:function(t){var r=t.dragEl,n=t.putSortable,i=n||this.sortable;i.captureAnimationState(),r.parentNode&&r.parentNode.removeChild(r),i.animateAll()},drop:Io},de(xt,{pluginName:"removeOnSpill"});var ce;function qr(){function a(){this.defaults={swapClass:"sortable-swap-highlight"}}return a.prototype={dragStart:function(r){var n=r.dragEl;ce=n},dragOverValid:function(r){var n=r.completed,i=r.target,o=r.onMove,l=r.activeSortable,s=r.changed,c=r.cancel;if(l.options.swap){var f=this.sortable.el,d=this.options;if(i&&i!==f){var u=ce;o(i)!==!1?(K(i,d.swapClass,!0),ce=i):ce=null,u&&u!==ce&&K(u,d.swapClass,!1)}s(),n(!0),c()}},drop:function(r){var n=r.activeSortable,i=r.putSortable,o=r.dragEl,l=i||this.sortable,s=this.options;ce&&K(ce,s.swapClass,!1),ce&&(s.swap||i&&i.options.swap)&&o!==ce&&(l.captureAnimationState(),l!==n&&n.captureAnimationState(),Jr(o,ce),l.animateAll(),l!==n&&n.animateAll())},nulling:function(){ce=null}},de(a,{pluginName:"swap",eventProperties:function(){return{swapItem:ce}}})}function Jr(a,t){var r=a.parentNode,n=t.parentNode,i,o;!r||!n||r.isEqualNode(t)||n.isEqualNode(a)||(i=x(a),o=x(t),r.isEqualNode(n)&&i<o&&o++,r.insertBefore(t,r.children[i]),n.insertBefore(a,n.children[o]))}var V=[],se=[],Je,pe,Qe=!1,ae=!1,$e=!1,L,Ze,bt;function Qr(){function a(t){for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?M(document,"pointerup",this._deselectMultiDrag):(M(document,"mouseup",this._deselectMultiDrag),M(document,"touchend",this._deselectMultiDrag))),M(document,"keydown",this._checkKeyDown),M(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(i,o){var l="";V.length&&pe===t?V.forEach(function(s,c){l+=(c?", ":"")+s.textContent}):l=o.textContent,i.setData("Text",l)}}}return a.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(r){var n=r.dragEl;L=n},delayEnded:function(){this.isMultiDrag=~V.indexOf(L)},setupClone:function(r){var n=r.sortable,i=r.cancel;if(this.isMultiDrag){for(var o=0;o<V.length;o++)se.push(Tt(V[o])),se[o].sortableIndex=V[o].sortableIndex,se[o].draggable=!1,se[o].style["will-change"]="",K(se[o],this.options.selectedClass,!1),V[o]===L&&K(se[o],this.options.chosenClass,!1);n._hideClone(),i()}},clone:function(r){var n=r.sortable,i=r.rootEl,o=r.dispatchSortableEvent,l=r.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||V.length&&pe===n&&($o(!0,i),o("clone"),l()))},showClone:function(r){var n=r.cloneNowShown,i=r.rootEl,o=r.cancel;this.isMultiDrag&&($o(!1,i),se.forEach(function(l){C(l,"display","")}),n(),bt=!1,o())},hideClone:function(r){var n=this;r.sortable;var i=r.cloneNowHidden,o=r.cancel;this.isMultiDrag&&(se.forEach(function(l){C(l,"display","none"),n.options.removeCloneOnHide&&l.parentNode&&l.parentNode.removeChild(l)}),i(),bt=!0,o())},dragStartGlobal:function(r){r.sortable,!this.isMultiDrag&&pe&&pe.multiDrag._deselectMultiDrag(),V.forEach(function(n){n.sortableIndex=x(n)}),V=V.sort(function(n,i){return n.sortableIndex-i.sortableIndex}),$e=!0},dragStarted:function(r){var n=this,i=r.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){V.forEach(function(l){l!==L&&C(l,"position","absolute")});var o=P(L,!1,!0,!0);V.forEach(function(l){l!==L&&Bo(l,o)}),ae=!0,Qe=!0}i.animateAll(function(){ae=!1,Qe=!1,n.options.animation&&V.forEach(function(l){Mt(l)}),n.options.sort&&yt()})}},dragOver:function(r){var n=r.target,i=r.completed,o=r.cancel;ae&&~V.indexOf(n)&&(i(!1),o())},revert:function(r){var n=r.fromSortable,i=r.rootEl,o=r.sortable,l=r.dragRect;V.length>1&&(V.forEach(function(s){o.addAnimationState({target:s,rect:ae?P(s):l}),Mt(s),s.fromRect=l,n.removeAnimationState(s)}),ae=!1,Zr(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(r){var n=r.sortable,i=r.isOwner,o=r.insertion,l=r.activeSortable,s=r.parentEl,c=r.putSortable,f=this.options;if(o){if(i&&l._hideClone(),Qe=!1,f.animation&&V.length>1&&(ae||!i&&!l.options.sort&&!c)){var d=P(L,!1,!0,!0);V.forEach(function(p){p!==L&&(Bo(p,d),s.appendChild(p))}),ae=!0}if(!i)if(ae||yt(),V.length>1){var u=bt;l._showClone(n),l.options.animation&&!bt&&u&&se.forEach(function(p){l.addAnimationState({target:p,rect:Ze}),p.fromRect=Ze,p.thisAnimationDuration=null})}else l._showClone(n)}},dragOverAnimationCapture:function(r){var n=r.dragRect,i=r.isOwner,o=r.activeSortable;if(V.forEach(function(s){s.thisAnimationDuration=null}),o.options.animation&&!i&&o.multiDrag.isMultiDrag){Ze=de({},n);var l=Be(L,!0);Ze.top-=l.f,Ze.left-=l.e}},dragOverAnimationComplete:function(){ae&&(ae=!1,yt())},drop:function(r){var n=r.originalEvent,i=r.rootEl,o=r.parentEl,l=r.sortable,s=r.dispatchSortableEvent,c=r.oldIndex,f=r.putSortable,d=f||this.sortable;if(n){var u=this.options,p=o.children;if(!$e)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),K(L,u.selectedClass,!~V.indexOf(L)),~V.indexOf(L))V.splice(V.indexOf(L),1),Je=null,Ke({sortable:l,rootEl:i,name:"deselect",targetEl:L,originalEvent:n});else{if(V.push(L),Ke({sortable:l,rootEl:i,name:"select",targetEl:L,originalEvent:n}),n.shiftKey&&Je&&l.el.contains(Je)){var m=x(Je),h=x(L);~m&&~h&&m!==h&&(function(){var E,R;h>m?(R=m,E=h):(R=h,E=m+1);for(var X=u.filter;R<E;R++)if(!~V.indexOf(p[R])&&ne(p[R],u.draggable,o,!1)){var _=X&&(typeof X=="function"?X.call(l,n,p[R],l):X.split(",").some(function(te){return ne(p[R],te.trim(),o,!1)}));_||(K(p[R],u.selectedClass,!0),V.push(p[R]),Ke({sortable:l,rootEl:i,name:"select",targetEl:p[R],originalEvent:n}))}})()}else Je=L;pe=d}if($e&&this.isMultiDrag){if(ae=!1,(o[Q].options.sort||o!==i)&&V.length>1){var k=P(L),T=x(L,":not(."+this.options.selectedClass+")");if(!Qe&&u.animation&&(L.thisAnimationDuration=null),d.captureAnimationState(),!Qe&&(u.animation&&(L.fromRect=k,V.forEach(function(E){if(E.thisAnimationDuration=null,E!==L){var R=ae?P(E):k;E.fromRect=R,d.addAnimationState({target:E,rect:R})}})),yt(),V.forEach(function(E){p[T]?o.insertBefore(E,p[T]):o.appendChild(E),T++}),c===x(L))){var A=!1;V.forEach(function(E){if(E.sortableIndex!==x(E)){A=!0;return}}),A&&(s("update"),s("sort"))}V.forEach(function(E){Mt(E)}),d.animateAll()}pe=d}(i===o||f&&f.lastPutMode!=="clone")&&se.forEach(function(E){E.parentNode&&E.parentNode.removeChild(E)})}},nullingGlobal:function(){this.isMultiDrag=$e=!1,se.length=0},destroyGlobal:function(){this._deselectMultiDrag(),O(document,"pointerup",this._deselectMultiDrag),O(document,"mouseup",this._deselectMultiDrag),O(document,"touchend",this._deselectMultiDrag),O(document,"keydown",this._checkKeyDown),O(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(r){if(!(typeof $e<"u"&&$e)&&pe===this.sortable&&!(r&&ne(r.target,this.options.draggable,this.sortable.el,!1))&&!(r&&r.button!==0))for(;V.length;){var n=V[0];K(n,this.options.selectedClass,!1),V.shift(),Ke({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvent:r})}},_checkKeyDown:function(r){r.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(r){r.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},de(a,{pluginName:"multiDrag",utils:{select:function(r){var n=r.parentNode[Q];!n||!n.options.multiDrag||~V.indexOf(r)||(pe&&pe!==n&&(pe.multiDrag._deselectMultiDrag(),pe=n),K(r,n.options.selectedClass,!0),V.push(r))},deselect:function(r){var n=r.parentNode[Q],i=V.indexOf(r);!n||!n.options.multiDrag||!~i||(K(r,n.options.selectedClass,!1),V.splice(i,1))}},eventProperties:function(){var r=this,n=[],i=[];return V.forEach(function(o){n.push({multiDragElement:o,index:o.sortableIndex});var l;ae&&o!==L?l=-1:ae?l=x(o,":not(."+r.options.selectedClass+")"):l=x(o),i.push({multiDragElement:o,index:l})}),{items:Sr(V),clones:[].concat(se),oldIndicies:n,newIndicies:i}},optionListeners:{multiDragKey:function(r){return r=r.toLowerCase(),r==="ctrl"?r="Control":r.length>1&&(r=r.charAt(0).toUpperCase()+r.substr(1)),r}}})}function Zr(a,t){V.forEach(function(r,n){var i=t.children[r.sortableIndex+(a?Number(n):0)];i?t.insertBefore(r,i):t.appendChild(r)})}function $o(a,t){se.forEach(function(r,n){var i=t.children[r.sortableIndex+(a?Number(n):0)];i?t.insertBefore(r,i):t.appendChild(r)})}function yt(){V.forEach(function(a){a!==L&&a.parentNode&&a.parentNode.removeChild(a)})}B.mount(new Yr),B.mount(xt,Gt);const _r=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:Qr,Sortable:B,Swap:qr,default:B},Symbol.toStringTag,{value:"Module"}));Y.ArrUtil=he,Y.ExcelUtil=lo,Y.TColumn=io,Y.TCurd=fo,Y.TFile=hr,Y.TForm=v,Y.TFormConfig=H,Y.TFormI18n=S,Y.TFormList=Ct,Y.TSys=N,Y.default=gr,Y.install=po,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));