cc1-form 1.2.9 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc1-form.css +1 -1
- package/dist/cc1-form.js +767 -734
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/index.vue.d.ts +40 -26
- package/package.json +1 -1
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],g):(C=typeof globalThis<"u"?globalThis:C||self,g(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,g,Ke,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...f)=>Array.isArray(n)?n.some(d=>typeof d=="function"?d(...f):d):typeof n=="function"?n(...f):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},f=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(f).length?f:{}};static moduleObj={};static loadModule=async n=>{if(!b.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const f=await b.moduleObj[n]();return f.default??f};static tipMessages={};static tipMessagesGap=500;static showMessage(n,f,d={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:f},d);g.ElMessage(o),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,f={})=>{this.showMessage(n,"error",f)};static success=(n,f={})=>{this.showMessage(n,"success",f)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,f="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=g.ElLoading.service({lock:!0,text:f,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,f=!0)=>{if(f){let d=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+d)}else window.open(n,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=n=>new Promise(async(f,d)=>{let a=document.getElementById(n.id);const o=await b.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let r=t.toDataURL("image/png");f(r)})}catch(t){d(t)}})}class w{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:{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=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class V{static customComponent={};static findOptions=(n,f)=>{const d=n.column.find(o=>o.key===f),a=o=>o.replace(/-([a-z])/g,(t,r)=>r.toUpperCase());if(d)return d.options[a(d.type)]};static setOptionsData=(n,f,d)=>{const a=V.findOptions(n,f);a&&(a.data=d)};static form={openBefore:{parentId:(n,f,d,a)=>{const o=w.config.table.rowKey;n?f.type===b.EDialog.Add?(f.form.parentId=n[o],f.form.sort=n.children.length+1):f.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(f.form.parentId="0",f.form.sort=d.length+1),V.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:d}])}}}}function We(l){return l}const x={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...f){if(typeof n=="function")return n(...f);n=String(n);let d=0;return n.replace(/{([^}]+)}/g,(a,o)=>d<f.length?String(f[d++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...f){return this.t(this.curd[n],...f)}static curd=x}class N{static getIdFun=()=>StrUtil.uuid();static setId=(n,f,d)=>{f[n]||(f[n]=[]);const a=w.config.table.rowKey;f[n].forEach(o=>{d.forEach(t=>{let r=t.default??"";t.type==="number"&&(r=t.default??0),t.type==="boolean"&&(r=t.default??!1),t.type==="time"&&(r=t.default??new Date),o[t.value]===void 0&&(o[t.value]=r)}),o[a]||(o[a]=N.getIdFun())})};static add=(n,f,d,a)=>{const o=JSONUtil.cp(d);N.setId(n,f,d);const t=w.config.table.rowKey;f[n].push(o.reduce((r,s)=>{let m=s.default??"";return s.type==="number"&&(m=s.default??0),s.type==="boolean"&&(m=s.default??!1),s.type==="time"&&(m=s.default??new Date),r[s.value]=m,r},{[t]:N.getIdFun()})),a?.(f)};static remove=(n,f,d,a)=>{const o=w.config.table.rowKey;f[n]=f[n].filter(t=>t[o]!==d[o]),a?.(f)};static getNoIdData=(n,f)=>{const d=JSONUtil.cp(n),a=w.config.table.rowKey;return d.forEach(o=>{o[a]&&delete o[a],f&&o[f]&&N.getNoIdData(o[f],f)}),d}}const L={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},A={key:0},H={class:"row items-center",style:{gap:"10px",width:"100%"}},j={key:1},F=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(l,{emit:n}){const f=l,d=e.reactive({show:!1,add:(o,t,r)=>{N.add(o,t,r,()=>{a("change")})},remove:(o,t,r)=>{N.remove(o,t,r,()=>{a("change")})}});e.onMounted(()=>{N.setId(f.field,f.row,f.itemFields),d.show=!0});const a=n;return(o,t)=>{const r=e.resolveComponent("el-button"),s=e.resolveComponent("el-input");return d.show?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(o.$slots,"list-start",{row:l.row}),l.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(r,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>d.add(l.field,l.row,l.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.row[l.field],m=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(o.$slots,"item-start",{item:m,row:l.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.itemFields,p=>(e.openBlock(),e.createBlock(s,{modelValue:m[p.value],"onUpdate:modelValue":c=>m[p.value]=c,style:e.normalizeStyle({width:l.inputWidth}),class:e.normalizeClass(l.inputClass),placeholder:p[l.label]||p[l.value],onChange:t[1]||(t[1]=c=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:l.row}),e.createVNode(r,{link:"",type:"danger",onClick:p=>d.remove(l.field,l.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),l.addBottom?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(r,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>d.add(l.field,l.row,l.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:l.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},R={class:"col"},K={class:"col"},W=["innerHTML"],U=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(l,{expose:n}){const f=b.isFun,d=b.EDialog,a=e.ref(),o=l,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||d.Add,formColumn:[],getDisabled:r=>t.type===d.View?r.disabled?.view===void 0?!0:r.disabled?.view:r.disabled?.[t.type===d.Add?"create":"update"],getBind:r=>r.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[r.type]||r.options?.[r.type]||{},getOn:r=>r.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[r.type]?.on||r.options?.[r.type]?.on||{},getColumnSpan:(r,s)=>{if(r.item.form?.spanCol){const m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2,k=s.filter(i=>!b.isFun(i.item.show?.form,t.form,t.type)).reduce((i,h)=>i+(h.item.form?.span||p),0);return(r.item.form?.span||p)+k}return r.item.form?.span},initColumnForm:()=>{const r=o.option;t.formColumn=[],t.rules={},t.formDefault={};const s=[],m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2;let c=[];const k=h=>{if(h.children){h.children.forEach(u=>{k(u)});return}if(t.formDefault[h.key]=h.value,h.isForm&&(typeof h.show?.form!="boolean"||h.show?.form)){h.form=h.form||{span:p},h.form.span=h.form.span??p;const u=h.form.span,E=c.reduce((S,$)=>S+$.span,u),B=c.length;if(c.push({item:h,span:u}),(B===1&&c[0].span===0||E>=m||u===0&&B>1)&&(s.push(c),c=[]),h.rules){const S={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},$=(S[h.type]||S.input)+h.label;t.rules[h.key]=typeof h.rules=="boolean"?[{required:!0,message:$,trigger:"blur"}]:h.rules}}},i=(h,u)=>{h.isForm=u,Array.isArray(h.children)&&h.children.forEach(E=>i(E,u))};r.column.forEach(h=>{i(h,!0),k(h)}),c.length>0&&s.push(c),t.formColumn=s,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(r,s)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[e.unref(f)(m.map(c=>c.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:l.option.form?.stripe===void 0?!0:l.option.form?.stripe}])},[e.renderSlot(r.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.item.key},[e.unref(f)(c.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([c.item.form.span>0?`col-${t.getColumnSpan(c,m)}`:"col",`form-item-col-${c.item.key}`])},[e.createVNode(e.unref(g.ElFormItem),{label:c.item.text?.form?.label??c.item.label,prop:c.item.key,"label-width":c.item.text?.form?.label==""?0:c.item.form?.labelWidth||l.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(r.$slots,"form-"+c.item.key+"-start",{row:t.form,item:c.item}),e.createElementVNode("div",R,[e.createElementVNode("div",K,[e.renderSlot(r.$slots,"form-"+c.item.key,{row:t.form,item:c.item},()=>[c.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="list"?(e.openBlock(),e.createBlock(F,e.mergeProps({key:4,row:t.form,field:c.item.key,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):c.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type&&(e.unref(V).customComponent[c.item.type]||e.unref(V).customComponent[c.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[c.item.type]?.form||e.unref(V).customComponent[c.item.type]),e.mergeProps({key:7,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(r.$slots,"form-"+c.item.key+"-right",{row:t.form,item:c.item})]),e.renderSlot(r.$slots,"form-"+c.item.key+"-tip",{row:t.form,item:c.item},()=>[c.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof c.item.form?.tipText=="function"?c.item.form?.tipText(t.form,t.type):c.item.form?.tipText},null,8,W)):e.createCommentVNode("",!0)])]),e.renderSlot(r.$slots,"form-"+c.item.key+"-end",{row:t.form,item:c.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(r.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class O{static exportToExcel=async(n,f,d)=>{if(!n||n.length===0)return;const a=await b.loadModule("xlsx"),o=n.map(s=>{const m={};return f.forEach(p=>{m[p.label]=s[p.key]}),m}),t=a.utils.json_to_sheet(o),r=a.utils.book_new();a.utils.book_append_sheet(r,t,"Sheet1"),d?typeof d=="function"&&(d=d()):d=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(r,`${d}.xlsx`)}}const D=b.EDialog,q=l=>{const n=e.ref(),f=e.ref(),d=e.ref(),a=e.reactive({option:l.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};l.option.column.forEach(r=>{(typeof r.show?.search=="function"?r.show?.search(a.search.form):r.show?.search)&&(o[r.key]=a.search.form[r.key])});const t=l.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(t=>{l.option.search?.resetMode==="none"?o[t]=void 0:o[t]=a.search.formDefault[t]}),a.search.form=ObjectUtil.deepMerge(o,{}),a.page.num=1,l.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:l.option.page?.layout||w.config.pagination.layout,showTools:l.option.page?.showTools||w.config.pagination.showTools,size:l.option.page?.size||w.config.pagination.size,sizeList:l.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:l.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(r=>r).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let r=[];return t.forEach(s=>{r.push(s[l.option.table.rowKey]),s.children&&s.children.length>0&&(r=r.concat(o(s.children)))}),r};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=r=>{r.forEach(s=>{s.table?.header?.group!==void 0&&(s.table.header.group=!o),s.table?.header?.groupKey!==void 0&&(s.table.header.show=o),Array.isArray(s.children)&&s.children.length>0&&t(s.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=l.option.api.list;try{await a.initApiData("init");let t={};if(a.table.sort.prop){const{props:h,order:u}=w.config.table.sort;t={[h.field]:a.table.sort.prop,[u.field]:a.table.sort.order}}const r=await o({...a.page.getQuery(),...t}),s=w.config.field.result,m=r.data||{[s.list]:r};let p=(Array.isArray(m[s.list]),m[s.list]);const c=a.update.formColumn.flat(),i=ObjectUtil.deepMerge({data:p},{}).data.map(h=>(Object.keys(h).forEach(E=>{const B=c.find(S=>S.item.key===E);B&&["select","radio"].includes(B.item.type)&&(B.item.table.format||(B.item.table.format=S=>B.item.options[B.item.type].data?.find($=>$.value==S[E])?.label||S[E]))}),h));a.table.data=l.option.data?await l.option.data(i,p):i,a.page.total=m[s.total]||0}catch(t){console.error(t)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const r=d.value;if(r?.clearSelection(),!r||!o?.length)return;const s=l.option.table?.rowKey,m=a.table.data,p=c=>{const k=i=>{for(const h of i){if(s!=null&&s!==""){if(h[s]===c[s])return h}else if(h===c)return h;if(Array.isArray(h.children)&&h.children.length){const u=k(h.children);if(u!==void 0)return u}}};return k(m)};e.nextTick(()=>{o.forEach(c=>{const k=p(c)??c;if(t){const i=()=>{r.toggleRowSelection(k,!0,!1)};t(c)!==!1&&i()}else r.toggleRowSelection(k,!0,!1)})})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?a.table.sort.order="":a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),r=l.option.column;const s=ObjectUtil.deepMerge({data:t,columns:r},{}),m=l.option.tools?.export||{};m.before&&m.before(s),O.exportToExcel(s.data,s.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(l.option.tools?.export?.select){await l.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw b.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(l.option.tools?.export?.page){await l.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw b.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(l.option.tools?.export?.all){await l.option.tools?.export?.all({...a.page.getQuery()});return}const o=l.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>l.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===D.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===D.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const s=o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(s).forEach(p=>{const c=s[p];typeof c=="function"?m[p]=function(...k){return c.apply(this,[...k,t||a.update.form,o])}:m[p]=c}),m},getOptions:o=>{try{const r=a.update.formColumn.flat().find(s=>s.item.key===o)?.item;return r?{options:r.options,bind:a.update.getBind(r)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(l.option.form?.editAll)return o;let t={[l.option.table?.rowKey]:a.update.edit.data[l.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(r=>{o[r]!==a.update.edit.data[r]&&(t[r]=o[r])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{a.update.type=o;const r=o===D.Add;a.update.edit.data=t,a.update.title=y.tCurd(r?"add":o===D.View?"view":"edit"),a.update.form=ObjectUtil.deepMerge(r?a.update.formDefault:t,{}),await a.initApiData("update"),await l.option.form?.openBefore?.(a.update.form,a.update),(!l.option.table?.inlineEdit||r)&&(a.update.show=!0,a.update.showContent=!0),l.option.form?.openAfter?.(a.update.form,a.update)}catch(r){console.error(r)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await f.value?.validate(async(s,m)=>new Promise((p,c)=>{s||(b.fail(y.tCurd("checkFormData")),c(!1)),p()})),a.update.loading=!0;const o=a.update.type===D.Add?l.option.api.create:l.option.api.update;try{await l.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const r=new Set(l.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(t).forEach(s=>{if(r.has(s)&&t[s]!=null){const m=new Date(t[s]).getTime();isNaN(m)||(t[s]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),l.option.form?.submitAfter?.(t,a.update)}catch(s){console.error(s)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,l.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){b.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=l.option.api.delete;try{if(!o)return;await o({[l.option.table?.rowKey]:a.remove.items.map(t=>t[l.option.table?.rowKey]),items:a.remove.items}),b.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],r=s=>{if(s.children&&s.children.length){s.children.forEach(m=>r(m));return}if(s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[o]){if(a.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let p=await s.options?.[s.type]?.dataApi?.(a.update.form,a.update.type);if(p){const c=s.options?.[s.type]?.dataPath;!Array.isArray(p)&&c&&(p=ObjectUtil.getPathValue(p,c)),s.options[s.type].data=p,s.options.search[s.type].data=p,s.options.formAdd[s.type].data=p,s.options.formUpdate[s.type].data=p,a.apiDataMap[s.key]=p}}catch{}})();t.push(m)}};return l.option.column.forEach(s=>{r(s)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),l.option.size=l.option.size||{},o.table.size=l.option.size.table||o.size.table,o.form.size=l.option.size.form||o.size.form,o.size.search=l.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,l.option||{});Object.keys(t).forEach(r=>{l.option[r]=t[r]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=r=>{for(const s in o){if(s==="table"){if(r.table=ObjectUtil.deepMerge(o.table,r.table||{}),r.children){r.children.forEach(p=>{t(p)});return}}else s==="type"?r.type=r.type||o.type:r[s]=ObjectUtil.deepMerge(o[s],r[s]||{});r.options=r.options||{},r.options[r.type]=r.options[r.type]||{},r.options[r.type].size=l.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{r.options[p]=r.options[p]||ObjectUtil.deepMerge(r.options,{}),r.options[p][r.type]=r.options[p][r.type]||{},r.options[p][r.type].size=p==="search"?l.option.size.search:l.option.size.form}),r.table=ObjectUtil.deepMerge(r.table,r.options[r.type].table||{})}r.type==="switch"&&(r.options.switch.tableBeforeChange=async(s,m)=>{const p=r.options?.switch;try{p.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!l.option.api.update&&!p.tableConfig?.api)return;const c=m[l.option.table?.rowKey];p.loadingMap||(p.loadingMap={}),p.loadingMap[c]||(p.loadingMap[c]={loading:!1}),p.loadingMap[c].loading=!0;const k=m[s]===p.activeValue?p.inactiveValue:p.activeValue,i=p.tableConfig?.api?p.tableConfig.api:l.option.api.update;if(!i)return;try{await i({...m,[s]:k},"switch")}catch{return!1}finally{p.loadingMap[c].loading=!1}return b.success(y.tCurd("operationSuccess")),p.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(c){return console.error(c),!1}finally{a.table.loading=!1}}catch{return!1}}),r.type==="treeSelect"&&(r.options.treeSelect.rowKey=l.option.table?.rowKey,r.options.treeSelect.nodeKey=l.option.table?.rowKey)};l.option.column.forEach(t),l.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const r=w.config.form.defaultSpan,m=t.filter(p=>!b.isFun(p.item.show?.form,a.update.form,a.update.type)).reduce((p,c)=>p+(c.item.form?.span||r),0);return(o.item?.form.span||r)+m}return o.item.form.span},initColumnForm:()=>{const o=l.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],r=l.option.form?.maxSpan||12,s=l.option.form?.defaultSpan||r/2;let m=[];const p=i=>{if(i.children){a.table.column.show.list.push(i.key),i.children.forEach(h=>{p(h)});return}if(a.update.formDefault[i.key]=i.value,i.table.table&&(i.show.table&&a.table.column.show.list.push(i.key),i.table.table&&a.table.column.show.listSource.push(i.key)),!(i.isForm&&typeof i.show?.form=="boolean")||i.show?.form){i.form=i.form||{span:s},i.form.span=i.form.span??s;let h=i.form.span,u=m.reduce((B,S)=>B+S.span,h);const E=m.length;if(m.push({item:i,span:h}),(E===1&&m[0].span===0||u>=r||h===0&&E>1)&&(t.push(m),m=[]),i.rules){const B={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(B[i.type]||B.input)+i.label;a.update.rules[i.key]=typeof i.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:i.rules}}},c=(i,h)=>{i.isForm=h,Array.isArray(i.children)&&i.children.forEach(u=>c(u,h))};o.column.forEach(i=>{i.isForm=!0,c(i,!0),p(i)}),l.option.table?.column?.forEach(i=>{c(i,!1),p(i)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(i=>i.table?.table),a.search.column.list.sort((i,h)=>i.sort?.search-h.sort?.search),a.table.column.list.sort((i,h)=>i.sort?.table-h.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=l.option.search?.formDefault;k&&Object.keys(k).forEach(i=>{a.search.formDefault[i]=k[i]}),o.column.forEach(i=>{i.show?.search||(a.search.formDefault[i.key]=void 0)}),a.search.form=ObjectUtil.deepMerge(a.search.formDefault,{})}});return a.init(),e.onMounted(()=>{l.option.init!==!1&&a.table.getList()}),{conf:a,switchConfirmRef:n,ruleFormRef:f,tableRef:d}},J={class:"dialog-footer"},G=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(l,{expose:n}){const f=e.ref(!1),d=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const r=p=>(p?.title&&(d.value=p.title),p?.content&&(a.value=p.content),f.value=!0,new Promise((c,k)=>{o=c,t=k})),s=()=>{f.value=!1,o?.(!0),o=null,t=null},m=()=>{f.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:r}),(p,c)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:f.value,"onUpdate:modelValue":c[0]||(c[0]=i=>f.value=i),title:d.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:p.size},{default:e.withCtx(()=>[e.createElementVNode("span",J,[e.createVNode(e.unref(g.ElButton),{onClick:m},{default:e.withCtx(()=>c[1]||(c[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s},{default:e.withCtx(()=>c[2]||(c[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),z=(l,n)=>{const f=l.__vccOpts||l;for(const[d,a]of n)f[d]=a;return f},Q={},X={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Y(l,n){return e.openBlock(),e.createElementBlock("svg",X,n[0]||(n[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 Z=z(Q,[["render",Y]]),P={},_={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(l,n){return e.openBlock(),e.createElementBlock("svg",_,n[0]||(n[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 ee=z(P,[["render",v]]),te={},oe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ne(l,n){return e.openBlock(),e.createElementBlock("svg",oe,n[0]||(n[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 ae=z(te,[["render",ne]]),le={},re={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ie(l,n){return e.openBlock(),e.createElementBlock("svg",re,n[0]||(n[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 de=z(le,[["render",ie]]),se={class:"row flex-center table-header-label inline"},ce={class:"table-header-tooltip"},fe=["onClick"],pe={key:1},me=["onClick","innerHTML"],he=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(l){const n=b.isFun,f=e.getCurrentInstance().type;return(d,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[d.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(d.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",se,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",content:t.table?.header?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",ce,[e.createVNode(ee)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,d.columnList.forEach(r=>{r.table?.header?.groupKey===t.key&&(r.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ae,{key:0})):(e.openBlock(),e.createBlock(de,{key:1}))],8,fe)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:r})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),{conf:d.conf,columnList:t.children,option:d.option},e.createSlots({_:2},[e.renderList(d.$slots,(s,m)=>({name:m,fn:e.withCtx(p=>[e.renderSlot(d.$slots,m,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(d.$slots,"table-edit-left-"+t.key,{row:r,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:r[t.key],"onUpdate:modelValue":s=>r[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,r))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(r):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:r[t.key],"onUpdate:modelValue":s=>r[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,r))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:r[t.key],"onUpdate:modelValue":s=>r[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,r))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"table-edit-right-"+t.key,{row:r,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.conf.update.type===e.unref(b).EDialog.Update&&e.unref(n)(t.show?.form,d.conf.update.form,e.unref(b).EDialog.Update)&&d.option.table?.inlineEdit&&d.conf.update.form[d.option.table?.rowKey]===r[d.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,r)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(r):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,r)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,r)),{disabled:d.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(d.$slots,"table-"+t.key,{key:1,row:r,item:t},()=>[e.unref(V).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:r[t.key],"onUpdate:modelValue":s=>r[t.key]=s,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:r[t.key],"onUpdate:modelValue":s=>r[t.key]=s,loading:t.options?.switch?.loadingMap?.[r[d.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,r),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(r[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:s=>t.table?.click?.callback?.(r),innerHTML:t.table?.format?t.table?.format(r):r[t.key]},null,14,me))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),ge={class:"row form-item-content",style:{width:"100%"}},ye={class:"col column form-item-content-item"},ke={class:"col"},be=["innerHTML"],ue=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(l){return(n,f)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",ye,[e.createElementVNode("div",ke,[e.renderSlot(n.$slots,"form-"+n.item.item.key,{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[0]||(f[0]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[1]||(f[1]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[2]||(f[2]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[3]||(f[3]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(F,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[4]||(f[4]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[5]||(f[5]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&(e.unref(V).customComponent[n.item.item.type]||e.unref(V).customComponent[n.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[n.item.item.type]?.form||e.unref(V).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[6]||(f[6]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,be)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),we={},Ce={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Be(l,n){return e.openBlock(),e.createElementBlock("svg",Ce,n[0]||(n[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 Ve=z(we,[["render",Be]]),Ee={},Se={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ne(l,n){return e.openBlock(),e.createElementBlock("svg",Se,n[0]||(n[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 De=z(Ee,[["render",Ne]]),ze={key:0,class:"relative curd-search fit-width"},$e={class:"mb-10 flex justify-between items-center fit-width"},Fe={class:"flex items-center",style:{gap:"10px"}},Ue={key:0},Oe={key:1},Te={key:2},Me={class:"export-btn"},xe={key:1,class:"export-btn"},Le={class:"flex items-center table-tools-right",style:{gap:"10px"}},Ae={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},He={class:"dialog-footer"},je={class:"dialog-footer"},T=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(l,{expose:n}){const f=b.EDialog,d=l,a=b.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:r,tableRef:s}=q(d);return n({conf:o}),(m,p)=>{const c=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[l.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[l.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[l.option.table?.fitHeight?"col":""]])},[l.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(e.unref(g.ElForm),{model:e.unref(o).search.form,inline:"",size:l.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$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,i=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i.key},[(typeof i.show?.search=="function"?i.show?.search(e.unref(o).search.form):i.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:i.text?.search?.label??i.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+i.key,{row:e.unref(o).search.form},()=>[i.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:e.unref(o).search.form[i.key],"onUpdate:modelValue":h=>e.unref(o).search.form[i.key]=h,placeholder:e.unref(o).search.getPlaceholder(i),clearable:"",disabled:i.disabled?.search,ref_for:!0},i.options?.search?.input||i.options?.input,e.toHandlers(i.options?.search?.input?.on||i.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):i.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:e.unref(o).search.form[i.key],"onUpdate:modelValue":h=>e.unref(o).search.form[i.key]=h,placeholder:e.unref(o).search.getPlaceholder(i,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:i.disabled?.search,ref_for:!0},i.options?.search?.switch||i.options?.switch,e.toHandlers(i.options?.search?.switch?.on||i.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:i.options?.switch?.activeValue,label:i.options?.switch?.activeText,value:i.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:i.options?.switch?.inactiveValue,label:i.options?.switch?.inactiveText,value:i.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):i.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:e.unref(o).search.form[i.key],"onUpdate:modelValue":h=>e.unref(o).search.form[i.key]=h,placeholder:e.unref(o).search.getPlaceholder(i,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:i.disabled?.search,ref_for:!0},i.options?.search?.select||i.options?.select,e.toHandlers(i.options?.search?.select?.on||i.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options?.select?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):i.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(o).search.form[i.key],"onUpdate:modelValue":h=>e.unref(o).search.form[i.key]=h,disabled:i.disabled?.search,ref_for:!0},i.options?.search?.datetime||i.options?.datetime,e.toHandlers(i.options?.search?.datetime?.on||i.options?.datetime?.on||{})),null,16,["modelValue","onUpdate:modelValue","disabled"])):i.type&&e.unref(V).customComponent[i.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[i.type]),e.mergeProps({key:4,modelValue:e.unref(o).search.form[i.key],"onUpdate:modelValue":h=>e.unref(o).search.form[i.key]=h,ref_for:!0},i.options?.search?.[i.type]||i.options?.[i.type],e.toHandlers(i.options?.search?.[i.type]?.on||i.options?.[i.type]?.on||{}),{disabled:i.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+i.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),l.option.tools?.search||l.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[l.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),l.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",$e,[e.createElementVNode("div",Fe,[e.unref(a)(l.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:p[0]||(p[0]=i=>e.unref(o).update.open(e.unref(f).Add)),size:l.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),l.option.table?.selectable&&e.unref(a)(l.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:p[1]||(p[1]=i=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:l.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),l.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:p[2]||(p[2]=i=>e.unref(o).table.expand.all()),size:l.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),l.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[l.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:l.option.size?.search},{default:e.withCtx(()=>[l.option.tools?.export?.dropdown?.select&&(l.option.table?.selectable||e.unref(a)(l.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),l.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),l.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Me,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:l.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:l.option.size?.search,onClick:p[3]||(p[3]=i=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",Le,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[4]||(p[4]=i=>e.unref(o).page.num=i),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[5]||(p[5]=i=>e.unref(o).page.size=i),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:l.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},l.option.page?.pagination||{},e.toHandlers(l.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),l.option.tools?.expandColumn===void 0||l.option.tools?.expandColumn?(e.openBlock(),e.createBlock(c,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[l.option.size?.search]]),onClick:p[6]||(p[6]=(...i)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...i))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(Ve,{key:0})):(e.openBlock(),e.createBlock(De,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),l.option.tools?.refresh===void 0||l.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[l.option.size?.search]]),onClick:p[7]||(p[7]=(...i)=>e.unref(o).table.getList&&e.unref(o).table.getList(...i))},[e.createVNode(Z)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[l.option.table?.fitHeight?"col ":"",l.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[l.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:s,data:e.unref(o).table.data,border:l.option.table?.border===void 0?!0:l.option.table?.border,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},l.option.table,e.toHandlers(l.option.table?.on||{})),{default:e.withCtx(()=>[(typeof l.option.table?.selectable=="object"?l.option.table?.selectable?.show:l.option.table?.selectable)||e.unref(a)(l.option.tools?.delete)||l.option.tools?.export?.show&&l.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof l.option.table?.selectable=="object"?l.option.table?.selectable:{},e.toHandlers(typeof l.option.table?.selectable=="object"?l.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(he,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:l.option},e.createSlots({_:2},[e.renderList(m.$slots,(i,h)=>({name:h,fn:e.withCtx(u=>[e.renderSlot(m.$slots,h,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(l.option.table?.add)||e.unref(a)(l.option.table?.update)||e.unref(a)(l.option.table?.delete)||e.unref(a)(l.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,width:"auto","max-width":"200",align:"center",fixed:"right"},l.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:i})=>[e.createVNode(e.unref(g.ElForm),{size:l.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:i}),e.unref(o).update.type===e.unref(f).Update&&l.option.table?.inlineEdit&&e.unref(o).update.form[d.option.table?.rowKey]===i[d.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.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(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:i})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(l.option.table?.add,i)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).Add,i)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(l.option.table?.view,i)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).View,i)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(l.option.table?.update,i)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:h=>e.unref(o).update.open(e.unref(f).Update,i)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(l.option.table?.delete,i)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:h=>e.unref(o).remove.open([i])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:i})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",Ae,[(l.option.page?.show===void 0||l.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[8]||(p[8]=i=>e.unref(o).page.num=i),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[9]||(p[9]=i=>e.unref(o).page.size=i),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:l.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},l.option.page?.pagination||{},e.toHandlers(l.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(m.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":p[10]||(p[10]=i=>e.unref(o).update.show=i),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},l.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",He,[e.createVNode(e.unref(g.ElForm),{size:l.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(f).View?(e.openBlock(),e.createBlock(e.unref(g.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(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:r,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:l.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,i=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const h=[],u=E=>{E?.item?.children?u(E.item.children):h.push(...E.map(B=>B.item?.show?.form))};return u(i),h})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:l.option.form?.stripe===void 0?!0:l.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i,h=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(h.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([h.item.form.span>0?`col-${e.unref(o).getColumnSpan(h,i)}`:"col",`form-item-col-${h.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.item.children?h.children:[h],u=>(e.openBlock(),e.createBlock(ue,{key:u.item.key,conf:e.unref(o),item:u},e.createSlots({_:2},[e.renderList(m.$slots,(E,B)=>({name:B,fn:e.withCtx(S=>[e.renderSlot(m.$slots,B,e.mergeProps({ref_for:!0},S||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":p[11]||(p[11]=i=>e.unref(o).remove.show=i),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",je,[e.createVNode(e.unref(g.ElForm),{size:l.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(G,{ref_key:"switchConfirmRef",ref:t,size:l.option.size?.form},null,8,["size"])],2)}}});class Ie{static async download(n,f="download.png"){const d=document.createElement("a");d.style.display="none",d.href=n,d.setAttribute("download",f),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,f)=>{const d=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(d),o=document.createElement("a");o.href=a,o.download=`${f||"config"}.json`,o.click()};static importFile=async n=>new Promise((f,d)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const r=t.target.files[0];if(!r){b.fail("未选择文件"),d("未选择文件");return}const s=new FileReader;s.onload=async m=>{const p=o==".json"?JSON.parse(m.target.result):m.target.result;f(p)},s.onerror=()=>{b.fail("文件读取失败"),d("文件读取失败")},s.readAsText(r),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const M=(l,n)=>{if(l.component("TCurd",T),l.component("TFormList",F),l.component("TColumn",U),n?.customComponent){V.customComponent=n.customComponent;for(const f in n.customComponent)l.component(f,n.customComponent[f])}},Re={install:M};C.ArrUtil=N,C.ExcelUtil=O,C.TColumn=U,C.TCurd=T,C.TFile=Ie,C.TForm=V,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=F,C.TSys=b,C.default=Re,C.install=M,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(C,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],g):(C=typeof globalThis<"u"?globalThis:C||self,g(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,g,We,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...f)=>Array.isArray(n)?n.some(d=>typeof d=="function"?d(...f):d):typeof n=="function"?n(...f):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},f=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(f).length?f:{}};static moduleObj={};static loadModule=async n=>{if(!b.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const f=await b.moduleObj[n]();return f.default??f};static tipMessages={};static tipMessagesGap=500;static showMessage(n,f,d={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:f},d);g.ElMessage(o),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,f={})=>{this.showMessage(n,"error",f)};static success=(n,f={})=>{this.showMessage(n,"success",f)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,f="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=g.ElLoading.service({lock:!0,text:f,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,f=!0)=>{if(f){let d=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+d)}else window.open(n,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=n=>new Promise(async(f,d)=>{let a=document.getElementById(n.id);const o=await b.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");f(i)})}catch(t){d(t)}})}class w{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:{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=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,f)=>{const d=n.column.find(o=>o.key===f),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(d)return d.options[a(d.type)]};static setOptionsData=(n,f,d)=>{const a=B.findOptions(n,f);a&&(a.data=d)};static form={openBefore:{parentId:(n,f,d,a)=>{const o=w.config.table.rowKey;n?f.type===b.EDialog.Add?(f.form.parentId=n[o],f.form.sort=n.children.length+1):f.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(f.form.parentId="0",f.form.sort=d.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:d}])}}}}function qe(r){return r}const L={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...f){if(typeof n=="function")return n(...f);n=String(n);let d=0;return n.replace(/{([^}]+)}/g,(a,o)=>d<f.length?String(f[d++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...f){return this.t(this.curd[n],...f)}static curd=L}class N{static getIdFun=()=>StrUtil.uuid();static setId=(n,f,d)=>{f[n]||(f[n]=[]);const a=w.config.table.rowKey;f[n].forEach(o=>{d.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=N.getIdFun())})};static add=(n,f,d,a)=>{const o=JSONUtil.cp(d);N.setId(n,f,d);const t=w.config.table.rowKey;f[n].push(o.reduce((i,s)=>{let m=s.default??"";return s.type==="number"&&(m=s.default??0),s.type==="boolean"&&(m=s.default??!1),s.type==="time"&&(m=s.default??new Date),i[s.value]=m,i},{[t]:N.getIdFun()})),a?.(f)};static remove=(n,f,d,a)=>{const o=w.config.table.rowKey;f[n]=f[n].filter(t=>t[o]!==d[o]),a?.(f)};static getNoIdData=(n,f)=>{const d=JSONUtil.cp(n),a=w.config.table.rowKey;return d.forEach(o=>{o[a]&&delete o[a],f&&o[f]&&N.getNoIdData(o[f],f)}),d}}const x={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},A={key:0},H={class:"row items-center",style:{gap:"10px",width:"100%"}},j={key:1},U=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(r,{emit:n}){const f=r,d=e.reactive({show:!1,add:(o,t,i)=>{N.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{N.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{N.setId(f.field,f.row,f.itemFields),d.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),s=e.resolveComponent("el-input");return d.show?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>d.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,p=>(e.openBlock(),e.createBlock(s,{modelValue:m[p.value],"onUpdate:modelValue":c=>m[p.value]=c,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:p[r.label]||p[r.value],onChange:t[1]||(t[1]=c=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:p=>d.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>d.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},R={class:"col"},K={class:"col"},W=["innerHTML"],F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const f=b.isFun,d=b.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||d.Add,formColumn:[],getDisabled:i=>t.type===d.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[t.type===d.Add?"create":"update"],getBind:i=>i.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,s)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2,k=s.filter(l=>!b.isFun(l.item.show?.form,t.form,t.type)).reduce((l,h)=>l+(h.item.form?.span||p),0);return(i.item.form?.span||p)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const s=[],m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2;let c=[];const k=h=>{if(h.children){h.children.forEach(u=>{k(u)});return}if(t.formDefault[h.key]=h.value,h.isForm&&(typeof h.show?.form!="boolean"||h.show?.form)){h.form=h.form||{span:p},h.form.span=h.form.span??p;const u=h.form.span,E=c.reduce((S,$)=>S+$.span,u),V=c.length;if(c.push({item:h,span:u}),(V===1&&c[0].span===0||E>=m||u===0&&V>1)&&(s.push(c),c=[]),h.rules){const S={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},$=(S[h.type]||S.input)+h.label;t.rules[h.key]=typeof h.rules=="boolean"?[{required:!0,message:$,trigger:"blur"}]:h.rules}}},l=(h,u)=>{h.isForm=u,Array.isArray(h.children)&&h.children.forEach(E=>l(E,u))};i.column.forEach(h=>{l(h,!0),k(h)}),c.length>0&&s.push(c),t.formColumn=s,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[e.unref(f)(m.map(c=>c.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.item.key},[e.unref(f)(c.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([c.item.form.span>0?`col-${t.getColumnSpan(c,m)}`:"col",`form-item-col-${c.item.key}`])},[e.createVNode(e.unref(g.ElFormItem),{label:c.item.text?.form?.label??c.item.label,prop:c.item.key,"label-width":c.item.text?.form?.label==""?0:c.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(i.$slots,"form-"+c.item.key+"-start",{row:t.form,item:c.item}),e.createElementVNode("div",R,[e.createElementVNode("div",K,[e.renderSlot(i.$slots,"form-"+c.item.key,{row:t.form,item:c.item},()=>[c.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="list"?(e.openBlock(),e.createBlock(U,e.mergeProps({key:4,row:t.form,field:c.item.key,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):c.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type&&(e.unref(B).customComponent[c.item.type]||e.unref(B).customComponent[c.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[c.item.type]?.form||e.unref(B).customComponent[c.item.type]),e.mergeProps({key:7,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+c.item.key+"-right",{row:t.form,item:c.item})]),e.renderSlot(i.$slots,"form-"+c.item.key+"-tip",{row:t.form,item:c.item},()=>[c.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof c.item.form?.tipText=="function"?c.item.form?.tipText(t.form,t.type):c.item.form?.tipText},null,8,W)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+c.item.key+"-end",{row:t.form,item:c.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class T{static exportToExcel=async(n,f,d)=>{if(!n||n.length===0)return;const a=await b.loadModule("xlsx"),o=n.map(s=>{const m={};return f.forEach(p=>{m[p.label]=s[p.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),d?typeof d=="function"&&(d=d()):d=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${d}.xlsx`)}}const D=b.EDialog,q=r=>{const n=e.ref(),f=e.ref(),d=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(t=>{r.option.search?.resetMode==="none"?o[t]=void 0:o[t]=a.search.formDefault[t]}),a.search.form=ObjectUtil.deepMerge(o,{}),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(s=>{i.push(s[r.option.table.rowKey]),s.children&&s.children.length>0&&(i=i.concat(o(s.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(s=>{s.table?.header?.group!==void 0&&(s.table.header.group=!o),s.table?.header?.groupKey!==void 0&&(s.table.header.show=o),Array.isArray(s.children)&&s.children.length>0&&t(s.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list;try{await a.initApiData("init");let t={};if(a.table.sort.prop){const{props:h,order:u}=w.config.table.sort;t={[h.field]:a.table.sort.prop,[u.field]:a.table.sort.order}}const i=await o({...a.page.getQuery(),...t}),s=w.config.field.result,m=i.data||{[s.list]:i};let p=(Array.isArray(m[s.list]),m[s.list]);const c=a.update.formColumn.flat(),l=ObjectUtil.deepMerge({data:p},{}).data.map(h=>(Object.keys(h).forEach(E=>{const V=c.find(S=>S.item.key===E);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=S=>V.item.options[V.item.type].data?.find($=>$.value==S[E])?.label||S[E]))}),h));a.table.data=r.option.data?await r.option.data(l,p):l,a.page.total=m[s.total]||0}catch(t){console.error(t)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=d.value;if(i?.clearSelection(),!i||!o?.length)return;const s=r.option.table?.rowKey,m=a.table.data,p=c=>{const k=l=>{for(const h of l){if(s!=null&&s!==""){if(h[s]===c[s])return h}else if(h===c)return h;if(Array.isArray(h.children)&&h.children.length){const u=k(h.children);if(u!==void 0)return u}}};return k(m)};e.nextTick(()=>{o.forEach(c=>{const k=p(c)??c;if(t){const l=()=>{i.toggleRowSelection(k,!0,!1)};t(c)!==!1&&l()}else i.toggleRowSelection(k,!0,!1)})})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?a.table.sort.order="":a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const s=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(s),T.exportToExcel(s.data,s.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw b.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw b.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>r.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===D.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===D.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const s=o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(s).forEach(p=>{const c=s[p];typeof c=="function"?m[p]=function(...k){return c.apply(this,[...k,t||a.update.form,o])}:m[p]=c}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(s=>s.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{a.update.type=o;const i=o===D.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===D.View?"view":"edit"),a.update.form=ObjectUtil.deepMerge(i?a.update.formDefault:t,{}),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await f.value?.validate(async(s,m)=>new Promise((p,c)=>{s||(b.fail(y.tCurd("checkFormData")),c(!1)),p()})),a.update.loading=!0;const o=a.update.type===D.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(t).forEach(s=>{if(i.has(s)&&t[s]!=null){const m=new Date(t[s]).getTime();isNaN(m)||(t[s]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(s){console.error(s)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){b.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),b.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=s=>{if(s.children&&s.children.length){s.children.forEach(m=>i(m));return}if(s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[o]){if(a.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let p=await s.options?.[s.type]?.dataApi?.(a.update.form,a.update.type);if(p){const c=s.options?.[s.type]?.dataPath;!Array.isArray(p)&&c&&(p=ObjectUtil.getPathValue(p,c)),s.options[s.type].data=p,s.options.search[s.type].data=p,s.options.formAdd[s.type].data=p,s.options.formUpdate[s.type].data=p,a.apiDataMap[s.key]=p}}catch{}})();t.push(m)}};return r.option.column.forEach(s=>{i(s)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const s in o){if(s==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){i.children.forEach(p=>{t(p)});return}}else s==="type"?i.type=i.type||o.type:i[s]=ObjectUtil.deepMerge(o[s],i[s]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{i.options[p]=i.options[p]||ObjectUtil.deepMerge(i.options,{}),i.options[p][i.type]=i.options[p][i.type]||{},i.options[p][i.type].size=p==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(s,m)=>{const p=i.options?.switch;try{p.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!p.tableConfig?.api)return;const c=m[r.option.table?.rowKey];p.loadingMap||(p.loadingMap={}),p.loadingMap[c]||(p.loadingMap[c]={loading:!1}),p.loadingMap[c].loading=!0;const k=m[s]===p.activeValue?p.inactiveValue:p.activeValue,l=p.tableConfig?.api?p.tableConfig.api:r.option.api.update;if(!l)return;try{await l({...m,[s]:k},"switch")}catch{return!1}finally{p.loadingMap[c].loading=!1}return b.success(y.tCurd("operationSuccess")),p.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(c){return console.error(c),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(p=>!b.isFun(p.item.show?.form,a.update.form,a.update.type)).reduce((p,c)=>p+(c.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,s=r.option.form?.defaultSpan||i/2;let m=[];const p=l=>{if(l.children){a.table.column.show.list.push(l.key),l.children.forEach(h=>{p(h)});return}if(a.update.formDefault[l.key]=l.value,l.table.table&&(l.show.table&&a.table.column.show.list.push(l.key),l.table.table&&a.table.column.show.listSource.push(l.key)),!(l.isForm&&typeof l.show?.form=="boolean")||l.show?.form){l.form=l.form||{span:s},l.form.span=l.form.span??s;let h=l.form.span,u=m.reduce((V,S)=>V+S.span,h);const E=m.length;if(m.push({item:l,span:h}),(E===1&&m[0].span===0||u>=i||h===0&&E>1)&&(t.push(m),m=[]),l.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(V[l.type]||V.input)+l.label;a.update.rules[l.key]=typeof l.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:l.rules}}},c=(l,h)=>{l.isForm=h,Array.isArray(l.children)&&l.children.forEach(u=>c(u,h))};o.column.forEach(l=>{l.isForm=!0,c(l,!0),p(l)}),r.option.table?.column?.forEach(l=>{c(l,!1),p(l)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(l=>l.table?.table),a.search.column.list.sort((l,h)=>l.sort?.search-h.sort?.search),a.table.column.list.sort((l,h)=>l.sort?.table-h.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(l=>{a.search.formDefault[l]=k[l]}),o.column.forEach(l=>{l.show?.search||(a.search.formDefault[l.key]=void 0)}),a.search.form=ObjectUtil.deepMerge(a.search.formDefault,{})}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),{conf:a,switchConfirmRef:n,ruleFormRef:f,tableRef:d}},G={class:"dialog-footer"},J=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const f=e.ref(!1),d=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=p=>(p?.title&&(d.value=p.title),p?.content&&(a.value=p.content),f.value=!0,new Promise((c,k)=>{o=c,t=k})),s=()=>{f.value=!1,o?.(!0),o=null,t=null},m=()=>{f.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(p,c)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:f.value,"onUpdate:modelValue":c[0]||(c[0]=l=>f.value=l),title:d.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:p.size},{default:e.withCtx(()=>[e.createElementVNode("span",G,[e.createVNode(e.unref(g.ElButton),{onClick:m},{default:e.withCtx(()=>c[1]||(c[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s},{default:e.withCtx(()=>c[2]||(c[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),z=(r,n)=>{const f=r.__vccOpts||r;for(const[d,a]of n)f[d]=a;return f},Q={},X={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Y(r,n){return e.openBlock(),e.createElementBlock("svg",X,n[0]||(n[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 Z=z(Q,[["render",Y]]),P={},_={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(r,n){return e.openBlock(),e.createElementBlock("svg",_,n[0]||(n[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 ee=z(P,[["render",v]]),te={},oe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ne(r,n){return e.openBlock(),e.createElementBlock("svg",oe,n[0]||(n[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 ae=z(te,[["render",ne]]),re={},le={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ie(r,n){return e.openBlock(),e.createElementBlock("svg",le,n[0]||(n[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 de=z(re,[["render",ie]]),se={class:"row flex-center table-header-label inline"},ce={class:"table-header-tooltip"},fe=["innerHTML"],pe=["onClick"],me={key:1},he=["onClick","innerHTML"],ge=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=b.isFun,f=e.getCurrentInstance().type;return(d,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[d.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(d.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",se,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:t.table?.header?.tooltip},null,8,fe)]),default:e.withCtx(()=>[e.createElementVNode("span",ce,[e.createVNode(ee)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,d.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ae,{key:0})):(e.openBlock(),e.createBlock(de,{key:1}))],8,pe)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),{conf:d.conf,columnList:t.children,option:d.option},e.createSlots({_:2},[e.renderList(d.$slots,(s,m)=>({name:m,fn:e.withCtx(p=>[e.renderSlot(d.$slots,m,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(d.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.conf.update.type===e.unref(b).EDialog.Update&&e.unref(n)(t.show?.form,d.conf.update.form,e.unref(b).EDialog.Update)&&d.option.table?.inlineEdit&&d.conf.update.form[d.option.table?.rowKey]===i[d.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{disabled:d.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(d.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,loading:t.options?.switch?.loadingMap?.[i[d.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:s=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,he))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),ye={class:"row form-item-content",style:{width:"100%"}},ke={class:"col column form-item-content-item"},be={class:"col"},ue=["innerHTML"],we=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,f)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",ke,[e.createElementVNode("div",be,[e.renderSlot(n.$slots,"form-"+n.item.item.key,{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[0]||(f[0]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[1]||(f[1]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[2]||(f[2]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[3]||(f[3]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(U,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[4]||(f[4]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[5]||(f[5]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&(e.unref(B).customComponent[n.item.item.type]||e.unref(B).customComponent[n.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]?.form||e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[6]||(f[6]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,ue)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),Ce={},Be={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ve(r,n){return e.openBlock(),e.createElementBlock("svg",Be,n[0]||(n[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 Ee=z(Ce,[["render",Ve]]),Se={},Ne={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function De(r,n){return e.openBlock(),e.createElementBlock("svg",Ne,n[0]||(n[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 ze=z(Se,[["render",De]]),$e={key:0,class:"relative curd-search fit-width"},Ue={class:"mb-10 flex justify-between items-center fit-width"},Fe={class:"flex items-center",style:{gap:"10px"}},Te={key:0},Oe={key:1},Me={key:2},Le={class:"export-btn"},xe={key:1,class:"export-btn"},Ae={class:"flex items-center table-tools-right",style:{gap:"10px"}},He={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},je={class:"dialog-footer"},Ie={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(r,{expose:n}){const f=b.EDialog,d=r,a=b.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:s}=q(d);return n({conf:o}),(m,p)=>{const c=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(g.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$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,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[e.renderSlot(m.$slots,"search-"+l.key+"-start",{row:e.unref(o).search.form}),(typeof l.show?.search=="function"?l.show?.search(e.unref(o).search.form):l.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:l.text?.search?.label??l.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+l.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+l.key,{row:e.unref(o).search.form},()=>[e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,ref_for:!0},l.options?.search?.[l.type??""],e.toHandlers(l.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:1,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.input||l.options?.input,e.toHandlers(l.options?.search?.input?.on||l.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.switch||l.options?.switch,e.toHandlers(l.options?.search?.switch?.on||l.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:l.options?.switch?.activeValue,label:l.options?.switch?.activeText,value:l.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:l.options?.switch?.inactiveValue,label:l.options?.switch?.inactiveText,value:l.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:3,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.select||l.options?.select,e.toHandlers(l.options?.search?.select?.on||l.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.select?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:4,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,disabled:l.disabled?.search,ref_for:!0},l.options?.search?.radio||l.options?.radio,e.toHandlers(l.options?.search?.radio?.on||l.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.radio?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:5,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,disabled:l.disabled?.search,ref_for:!0},l.options?.search?.datetime||l.options?.datetime,e.toHandlers(l.options?.search?.datetime?.on||l.options?.datetime?.on||{})),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,ref_for:!0},l.options?.search?.[l.type]||l.options?.[l.type],e.toHandlers(l.options?.search?.[l.type]?.on||l.options?.[l.type]?.on||{}),{disabled:l.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+l.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+l.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ue,[e.createElementVNode("div",Fe,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:p[0]||(p[0]=l=>e.unref(o).update.open(e.unref(f).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:p[1]||(p[1]=l=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:p[2]||(p[2]=l=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Le,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:p[3]||(p[3]=l=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",Ae,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[4]||(p[4]=l=>e.unref(o).page.num=l),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[5]||(p[5]=l=>e.unref(o).page.size=l),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:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(c,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[6]||(p[6]=(...l)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...l))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(Ee,{key:0})):(e.openBlock(),e.createBlock(ze,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[7]||(p[7]=(...l)=>e.unref(o).table.getList&&e.unref(o).table.getList(...l))},[e.createVNode(Z)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:s,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,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},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(ge,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(l,h)=>({name:h,fn:e.withCtx(u=>[e.renderSlot(m.$slots,h,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:l})=>[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:l}),e.unref(o).update.type===e.unref(f).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[d.option.table?.rowKey]===l[d.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.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(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:l})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).Add,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).View,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:h=>e.unref(o).update.open(e.unref(f).Update,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:h=>e.unref(o).remove.open([l])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:l})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",He,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[8]||(p[8]=l=>e.unref(o).page.num=l),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[9]||(p[9]=l=>e.unref(o).page.size=l),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:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.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(m.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":p[10]||(p[10]=l=>e.unref(o).update.show=l),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",je,[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(f).View?(e.openBlock(),e.createBlock(e.unref(g.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(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const h=[],u=E=>{E?.item?.children?u(E.item.children):h.push(...E.map(V=>V.item?.show?.form))};return u(l),h})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,h=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(h.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([h.item.form.span>0?`col-${e.unref(o).getColumnSpan(h,l)}`:"col",`form-item-col-${h.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.item.children?h.children:[h],u=>(e.openBlock(),e.createBlock(we,{key:u.item.key,conf:e.unref(o),item:u},e.createSlots({_:2},[e.renderList(m.$slots,(E,V)=>({name:V,fn:e.withCtx(S=>[e.renderSlot(m.$slots,V,e.mergeProps({ref_for:!0},S||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":p[11]||(p[11]=l=>e.unref(o).remove.show=l),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Ie,[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(J,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Re{static async download(n,f="download.png"){const d=document.createElement("a");d.style.display="none",d.href=n,d.setAttribute("download",f),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,f)=>{const d=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(d),o=document.createElement("a");o.href=a,o.download=`${f||"config"}.json`,o.click()};static importFile=async n=>new Promise((f,d)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){b.fail("未选择文件"),d("未选择文件");return}const s=new FileReader;s.onload=async m=>{const p=o==".json"?JSON.parse(m.target.result):m.target.result;f(p)},s.onerror=()=>{b.fail("文件读取失败"),d("文件读取失败")},s.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const M=(r,n)=>{if(r.component("TCurd",O),r.component("TFormList",U),r.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const f in n.customComponent)r.component(f,n.customComponent[f])}},Ke={install:M};C.ArrUtil=N,C.ExcelUtil=T,C.TColumn=F,C.TCurd=O,C.TFile=Re,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=U,C.TSys=b,C.default=Ke,C.install=M,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -4,7 +4,7 @@ import TSys from '../../utils/TSys';
|
|
|
4
4
|
import type { CurdConfig } from './indexType';
|
|
5
5
|
import SwitchConfirm from './com/dialog/switchConfirm.vue';
|
|
6
6
|
import IconRefresh from './icon/refresh.vue';
|
|
7
|
-
import { ElButton, ElDatePicker, ElDialog, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElInput, ElOption, ElPagination, ElSelect, ElTable, ElTableColumn } from 'element-plus';
|
|
7
|
+
import { ElButton, ElDatePicker, ElDialog, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElInput, ElOption, ElPagination, ElSelect, ElTable, ElTableColumn, ElRadio, ElRadioGroup } from 'element-plus';
|
|
8
8
|
import TableColumn from './tableColumn.vue';
|
|
9
9
|
import FormColumn from './formColumn.vue';
|
|
10
10
|
import Collapse from './icon/Collapse.vue';
|
|
@@ -2284,23 +2284,29 @@ declare const conf: {
|
|
|
2284
2284
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
2285
2285
|
declare var __VLS_1: {}, __VLS_7: {
|
|
2286
2286
|
row: Record<string, any>;
|
|
2287
|
-
},
|
|
2287
|
+
}, __VLS_10: string, __VLS_11: {
|
|
2288
2288
|
row: Record<string, any>;
|
|
2289
|
-
},
|
|
2289
|
+
}, __VLS_18: string, __VLS_19: {
|
|
2290
2290
|
row: Record<string, any>;
|
|
2291
|
-
},
|
|
2291
|
+
}, __VLS_22: string, __VLS_23: {
|
|
2292
2292
|
row: Record<string, any>;
|
|
2293
|
-
},
|
|
2293
|
+
}, __VLS_70: string, __VLS_71: {
|
|
2294
2294
|
row: Record<string, any>;
|
|
2295
|
-
},
|
|
2295
|
+
}, __VLS_74: string, __VLS_75: {
|
|
2296
|
+
row: Record<string, any>;
|
|
2297
|
+
}, __VLS_77: {
|
|
2298
|
+
row: Record<string, any>;
|
|
2299
|
+
}, __VLS_99: {
|
|
2300
|
+
row: Record<string, any>;
|
|
2301
|
+
}, __VLS_161: {}, __VLS_163: {}, __VLS_207: string | number, __VLS_208: any, __VLS_214: {}, __VLS_220: {
|
|
2296
2302
|
row: any;
|
|
2297
|
-
},
|
|
2303
|
+
}, __VLS_238: {
|
|
2298
2304
|
row: any;
|
|
2299
|
-
},
|
|
2305
|
+
}, __VLS_272: {
|
|
2300
2306
|
row: any;
|
|
2301
|
-
},
|
|
2307
|
+
}, __VLS_283: {}, __VLS_295: {
|
|
2302
2308
|
row: any;
|
|
2303
|
-
},
|
|
2309
|
+
}, __VLS_301: string | number, __VLS_302: {
|
|
2304
2310
|
row: any;
|
|
2305
2311
|
item: {
|
|
2306
2312
|
key: string;
|
|
@@ -2710,43 +2716,49 @@ declare var __VLS_1: {}, __VLS_7: {
|
|
|
2710
2716
|
form?: number | undefined;
|
|
2711
2717
|
} | undefined;
|
|
2712
2718
|
};
|
|
2713
|
-
},
|
|
2719
|
+
}, __VLS_304: {
|
|
2714
2720
|
row: any;
|
|
2715
2721
|
};
|
|
2716
2722
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
2717
|
-
[K in NonNullable<typeof
|
|
2723
|
+
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
|
|
2724
|
+
} & {
|
|
2725
|
+
[K in NonNullable<typeof __VLS_18>]?: (props: typeof __VLS_19) => any;
|
|
2726
|
+
} & {
|
|
2727
|
+
[K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
|
|
2728
|
+
} & {
|
|
2729
|
+
[K in NonNullable<typeof __VLS_70>]?: (props: typeof __VLS_71) => any;
|
|
2718
2730
|
} & {
|
|
2719
|
-
[K in NonNullable<typeof
|
|
2731
|
+
[K in NonNullable<typeof __VLS_74>]?: (props: typeof __VLS_75) => any;
|
|
2720
2732
|
} & {
|
|
2721
|
-
[K in NonNullable<typeof
|
|
2733
|
+
[K in NonNullable<typeof __VLS_207>]?: (props: typeof __VLS_208) => any;
|
|
2722
2734
|
} & {
|
|
2723
|
-
[K in NonNullable<typeof
|
|
2735
|
+
[K in NonNullable<typeof __VLS_301>]?: (props: typeof __VLS_302) => any;
|
|
2724
2736
|
} & {
|
|
2725
2737
|
'box-left'?: (props: typeof __VLS_1) => any;
|
|
2726
2738
|
} & {
|
|
2727
2739
|
'search-start'?: (props: typeof __VLS_7) => any;
|
|
2728
2740
|
} & {
|
|
2729
|
-
'search-center'?: (props: typeof
|
|
2741
|
+
'search-center'?: (props: typeof __VLS_77) => any;
|
|
2730
2742
|
} & {
|
|
2731
|
-
'search-end'?: (props: typeof
|
|
2743
|
+
'search-end'?: (props: typeof __VLS_99) => any;
|
|
2732
2744
|
} & {
|
|
2733
|
-
'tools-left'?: (props: typeof
|
|
2745
|
+
'tools-left'?: (props: typeof __VLS_161) => any;
|
|
2734
2746
|
} & {
|
|
2735
|
-
'tools-right'?: (props: typeof
|
|
2747
|
+
'tools-right'?: (props: typeof __VLS_163) => any;
|
|
2736
2748
|
} & {
|
|
2737
|
-
'table-header-op'?: (props: typeof
|
|
2749
|
+
'table-header-op'?: (props: typeof __VLS_214) => any;
|
|
2738
2750
|
} & {
|
|
2739
|
-
'table-op-left'?: (props: typeof
|
|
2751
|
+
'table-op-left'?: (props: typeof __VLS_220) => any;
|
|
2740
2752
|
} & {
|
|
2741
|
-
'table-op-edit-right'?: (props: typeof
|
|
2753
|
+
'table-op-edit-right'?: (props: typeof __VLS_238) => any;
|
|
2742
2754
|
} & {
|
|
2743
|
-
'table-op-right'?: (props: typeof
|
|
2755
|
+
'table-op-right'?: (props: typeof __VLS_272) => any;
|
|
2744
2756
|
} & {
|
|
2745
|
-
'box-right'?: (props: typeof
|
|
2757
|
+
'box-right'?: (props: typeof __VLS_283) => any;
|
|
2746
2758
|
} & {
|
|
2747
|
-
'form-start'?: (props: typeof
|
|
2759
|
+
'form-start'?: (props: typeof __VLS_295) => any;
|
|
2748
2760
|
} & {
|
|
2749
|
-
'form-end'?: (props: typeof
|
|
2761
|
+
'form-end'?: (props: typeof __VLS_304) => any;
|
|
2750
2762
|
}>;
|
|
2751
2763
|
declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2752
2764
|
/**
|
|
@@ -2774,6 +2786,8 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
2774
2786
|
ElSelect: typeof ElSelect;
|
|
2775
2787
|
ElTable: typeof ElTable;
|
|
2776
2788
|
ElTableColumn: typeof ElTableColumn;
|
|
2789
|
+
ElRadio: typeof ElRadio;
|
|
2790
|
+
ElRadioGroup: typeof ElRadioGroup;
|
|
2777
2791
|
TableColumn: typeof TableColumn;
|
|
2778
2792
|
FormColumn: typeof FormColumn;
|
|
2779
2793
|
Collapse: typeof Collapse;
|