cc1-form 1.2.3 → 1.2.5
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 +992 -1016
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +28 -28
- package/dist/components/TCurd/formColumn.vue.d.ts +20 -20
- package/dist/components/TCurd/index.d.ts +21 -21
- package/dist/components/TCurd/index.vue.d.ts +46 -46
- package/dist/components/TCurd/indexType.d.ts +3 -3
- package/package.json +1 -1
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,m,Se,e){"use strict";class k{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(a,...c)=>Array.isArray(a)?a.some(o=>typeof o=="function"?o(...c):o):typeof a=="function"?a(...c):a;static getRouterParams=()=>{const a=this.router.currentRoute.value.query||{},c=this.router.currentRoute.value.params||{};return Object.keys(a).length?a:Object.keys(c).length?c:{}};static moduleObj={};static loadModule=async a=>{if(!k.moduleObj[a])throw new Error(`模块${a}未加载,请赋值如:TSys.moduleObj = { ${a}: ()=>import('${a}') }`);const c=await k.moduleObj[a]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(a,c,o={}){const i=Date.now();if(!this.tipMessages[a]||i-this.tipMessages[a]>this.tipMessagesGap){this.tipMessages[a]=i;const n=Object.assign({message:a,type:c},o);m.ElMessage(n),setTimeout(()=>{delete this.tipMessages[a]},this.tipMessagesGap)}}static fail=(a,c={})=>{this.showMessage(a,"error",c)};static success=(a,c={})=>{this.showMessage(a,"success",c)};static loadingObj=null;static loadingTimer=null;static loading=(a=!0,c="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{a?this.loadingObj=m.ElLoading.service({lock:!0,text:c,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(a,c=!0)=>{if(c){let o=screen.width/2-500,i=screen.height/2-800/2-30;window.open(a,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+i+", left="+o)}else window.open(a,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=a=>new Promise(async(c,o)=>{let i=document.getElementById(a.id);const n=await k.loadModule("html2canvas");try{n(i,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:a.windowWidth,height:a.windowHeight,windowWidth:a.windowWidth,windowHeight:a.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let s=t.toDataURL("image/png");c(s)})}catch(t){o(t)}})}class u{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:{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=a=>{u.config=ObjectUtil.deepMerge(u.config,a)}}class B{static customComponent={};static findOptions=(a,c)=>{const o=a.column.find(n=>n.key===c),i=n=>n.replace(/-([a-z])/g,(t,s)=>s.toUpperCase());if(o)return o.options[i(o.type)]};static setOptionsData=(a,c,o)=>{const i=B.findOptions(a,c);i&&(i.data=o)};static form={openBefore:{parentId:(a,c,o,i)=>{const n=u.config.table.rowKey;a?c.type===k.EDialog.Add?(c.form.parentId=a[n],c.form.sort=a.children.length+1):c.form.parentId=a.parentId.substring(a.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=o.length+1),B.setOptionsData(i,"parentId",[{[n]:"0",title:"根",children:o}])}}}}function Ne(r){return r}const M={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:"确认要修改吗?"};class h{static t(a,...c){if(typeof a=="function")return a(...c);a=String(a);let o=0;return a.replace(/{([^}]+)}/g,(i,n)=>o<c.length?String(c[o++]):`{${n}}`)}static setI18n=a=>{h.curd=ObjectUtil.deepMerge(h.curd,a)};static tCurd(a,...c){return this.t(this.curd[a],...c)}static curd=M}class E{static getIdFun=()=>StrUtil.uuid();static setId=(a,c,o)=>{c[a]||(c[a]=[]);const i=u.config.table.rowKey;c[a].forEach(n=>{o.forEach(t=>{let s=t.default??"";t.type==="number"&&(s=t.default??0),t.type==="boolean"&&(s=t.default??!1),t.type==="time"&&(s=t.default??new Date),n[t.value]===void 0&&(n[t.value]=s)}),n[i]||(n[i]=E.getIdFun())})};static add=(a,c,o,i)=>{const n=JSONUtil.cp(o);E.setId(a,c,o);const t=u.config.table.rowKey;c[a].push(n.reduce((s,p)=>{let f=p.default??"";return p.type==="number"&&(f=p.default??0),p.type==="boolean"&&(f=p.default??!1),p.type==="time"&&(f=p.default??new Date),s[p.value]=f,s},{[t]:E.getIdFun()})),i?.(c)};static remove=(a,c,o,i)=>{const n=u.config.table.rowKey;c[a]=c[a].filter(t=>t[n]!==o[n]),i?.(c)};static getNoIdData=(a,c)=>{const o=JSONUtil.cp(a),i=u.config.table.rowKey;return o.forEach(n=>{n[i]&&delete n[i],c&&n[c]&&E.getNoIdData(n[c],c)}),o}}const A={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},x={key:0},H={class:"row items-center",style:{gap:"10px",width:"100%"}},j={key:1},D=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:a}){const c=r,o=e.reactive({show:!1,add:(n,t,s)=>{E.add(n,t,s,()=>{i("change")})},remove:(n,t,s)=>{E.remove(n,t,s,()=>{i("change")})}});e.onMounted(()=>{E.setId(c.field,c.row,c.itemFields),o.show=!0});const i=a;return(n,t)=>{const s=e.resolveComponent("el-button"),p=e.resolveComponent("el-input");return o.show?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(n.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",x,[e.createVNode(s,{link:"",type:"primary",onClick:t[0]||(t[0]=f=>o.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],f=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(n.$slots,"item-start",{item:f,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,g=>(e.openBlock(),e.createBlock(p,{modelValue:f[g.value],"onUpdate:modelValue":l=>f[g.value]=l,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:g[r.label]||g[r.value],onChange:t[1]||(t[1]=l=>i("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(n.$slots,"item-end",{item:f,row:r.row}),e.createVNode(s,{link:"",type:"danger",onClick:g=>o.remove(r.field,r.row,f)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(s,{link:"",type:"primary",onClick:t[2]||(t[2]=f=>o.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},R={class:"col"},K={class:"col"},J=["innerHTML"],$=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:a}){const c=k.isFun,o=k.EDialog,i=e.ref(),n=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:n.type||o.Add,formColumn:[],getDisabled:s=>t.type===o.View?s.disabled?.view===void 0?!0:s.disabled?.view:s.disabled?.[t.type===o.Add?"create":"update"],getBind:s=>s.options?.[t.type===o.Add?"formAdd":"formUpdate"]?.[s.type]||s.options?.[s.type]||{},getOn:s=>s.options?.[t.type===o.Add?"formAdd":"formUpdate"]?.[s.type]?.on||s.options?.[s.type]?.on||{},getColumnSpan:(s,p)=>{if(s.item.form?.spanCol){const f=n.option.form?.maxSpan||12,g=n.option.form?.defaultSpan||f/2,d=p.filter(b=>!k.isFun(b.item.show?.form,t.form,t.type)).reduce((b,y)=>b+(y.item.form?.span||g),0);return(s.item.form?.span||g)+d}return s.item.form?.span},initColumnForm:()=>{const s=n.option;t.formColumn=[],t.rules={},t.formDefault={};const p=[],f=n.option.form?.maxSpan||12,g=n.option.form?.defaultSpan||f/2;let l=[];const d=y=>{if(y.children){y.children.forEach(w=>{d(w)});return}if(t.formDefault[y.key]=y.value,y.isForm&&(typeof y.show?.form!="boolean"||y.show?.form)){y.form=y.form||{span:g},y.form.span=y.form.span??g;const w=y.form.span,V=l.reduce((z,F)=>z+F.span,w),N=l.length;if(l.push({item:y,span:w}),(N===1&&l[0].span===0||V>=f||w===0&&N>1)&&(p.push(l),l=[]),y.rules){const z={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},F=(z[y.type]||z.input)+y.label;t.rules[y.key]=typeof y.rules=="boolean"?[{required:!0,message:F,trigger:"blur"}]:y.rules}}},b=(y,w)=>{y.isForm=w,Array.isArray(y.children)&&y.children.forEach(V=>b(V,w))};s.column.forEach(y=>{b(y,!0),d(y)}),l.length>0&&p.push(l),t.formColumn=p,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),a({ref:i,conf:t}),(s,p)=>(e.openBlock(),e.createBlock(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:i,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[e.unref(c)(f.map(l=>l.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(s.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.item.key},[e.unref(c)(l.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([l.item.form.span>0?`col-${t.getColumnSpan(l,f)}`:"col",`form-item-col-${l.item.key}`])},[e.createVNode(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof l.item.text?.form?.label=="boolean"?!l.item.text?.form?.label:!1}),label:typeof l.item.text?.form?.label=="string"?l.item.text?.form?.label:l.item.label,prop:l.item.key,"label-width":l.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(s.$slots,"form-"+l.item.key+"-start",{row:t.form,item:l.item}),e.createElementVNode("div",R,[e.createElementVNode("div",K,[e.renderSlot(s.$slots,"form-"+l.item.key,{row:t.form,item:l.item},()=>[l.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:t.form,field:l.item.key,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):l.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type&&(e.unref(B).customComponent[l.item.type]||e.unref(B).customComponent[l.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.item.type]?.form||e.unref(B).customComponent[l.item.type]),e.mergeProps({key:7,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(s.$slots,"form-"+l.item.key+"-right",{row:t.form,item:l.item})]),e.renderSlot(s.$slots,"form-"+l.item.key+"-tip",{row:t.form,item:l.item},()=>[l.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof l.item.form?.tipText=="function"?l.item.form?.tipText(t.form,t.type):l.item.form?.tipText},null,8,J)):e.createCommentVNode("",!0)])]),e.renderSlot(s.$slots,"form-"+l.item.key+"-end",{row:t.form,item:l.item})])]),_:2},1032,["class","label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(s.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class O{static exportToExcel=async(a,c,o)=>{if(!a||a.length===0)return;const i=await k.loadModule("xlsx"),n=a.map(p=>{const f={};return c.forEach(g=>{f[g.label]=p[g.key]}),f}),t=i.utils.json_to_sheet(n),s=i.utils.book_new();i.utils.book_append_sheet(s,t,"Sheet1"),o?typeof o=="function"&&(o=o()):o=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,i.writeFile(s,`${o}.xlsx`)}}const S=k.EDialog,W=r=>{const a=e.ref(),c=e.ref(),o=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(i,n=h.tCurd("placeholderInput"))=>i.text?.search?.placeholder===void 0?`${n}${i.label}`:i.text?.search?.placeholder,getFormData:()=>{let i={};r.option.column.forEach(t=>{(typeof t.show?.search=="function"?t.show?.search(o.search.form):t.show?.search)&&(i[t.key]=o.search.form[t.key])});const n=r.option.search?.before?.(i);return n&&(i=n),i},reset:()=>{const i=o.search.formDefault;Object.keys(i).forEach(n=>{r.option.search?.resetMode==="none"?i[n]=void 0:i[n]=o.search.formDefault[n]}),o.search.form=JSONUtil.cp(i),o.page.num=1,r.option.init!==!1&&o.table.getList()},submit:()=>{o.page.num=1,o.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||u.config.pagination.layout,showTools:r.option.page?.showTools||u.config.pagination.showTools,size:r.option.page?.size||u.config.pagination.size,sizeList:r.option.page?.sizeList||u.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||u.config.pagination.pagerCount,getQuery:(i={})=>({[u.config.field.page.size]:i.size||o.page.size,[u.config.field.page.num]:i.num||o.page.num,...o.search.getFormData()})},table:{op:{width:(...i)=>i.filter(t=>t).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(i,n)=>{},all:()=>{if(o.table.expand.isExpand)o.table.expand.rowKeys=[];else{const i=n=>{let t=[];return n.forEach(s=>{t.push(s[r.option.table.rowKey]),s.children&&s.children.length>0&&(t=t.concat(i(s.children)))}),t};o.table.expand.rowKeys=i(o.table.data)}o.table.expand.isExpand=!o.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{o.table.loading=!0;const i=r.option.api.list;try{await o.initApiData("init");let n={};if(o.table.sort.prop){const{props:d,order:b}=u.config.table.sort;n={[d.field]:o.table.sort.prop,[b.field]:o.table.sort.order}}const t=await i({...o.page.getQuery(),...n}),s=u.config.field.result,p=t.data||{[s.list]:t};let f=(Array.isArray(p[s.list]),p[s.list]);const g=o.update.formColumn.flat(),l=JSONUtil.cp(f).map(d=>(Object.keys(d).forEach(y=>{const w=g.find(V=>V.item.key===y);w&&["select","radio"].includes(w.item.type)&&(w.item.table.format||(w.item.table.format=V=>w.item.options[w.item.type].data?.find(N=>N.value==V[y])?.label||V[y]))}),d));o.table.data=r.option.data?await r.option.data(l,f):l,o.page.total=p[s.total]||0}catch(n){console.error(n)}finally{o.table.loading=!1}},selection:{list:[],change:i=>{o.table.selection.list=i}},sort:{prop:"",order:"",change:i=>{u.config.table.sort.resetPage&&(o.page.num=1);const n=u.config.table.sort;if(n.change){n.change(i,o);return}o.table.sort.prop=i.prop,i.order===null?o.table.sort.order="":o.table.sort.order=i.order==="ascending"?n.order.asc:n.order.desc,o.table.getList()}}},export:{run:{start:async i=>{let n=await o.export.run[i](),t=r.option.column;const s=JSONUtil.cp({data:n,columns:t}),p=r.option.tools?.export||{};p.before&&p.before(s),O.exportToExcel(s.data,s.columns,p.fileName)},select:async()=>{o.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...o.page.getQuery(),items:o.table.selection.list});return}if(o.table.selection.list.length===0)throw k.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return o.table.selection.list}catch(i){console.error(i)}finally{o.export.loading=!1}},page:async()=>{o.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...o.page.getQuery()});return}if(o.table.data.length===0)throw k.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return o.table.data}catch(i){console.error(i)}finally{o.export.loading=!1}},all:async()=>{o.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...o.page.getQuery()});return}const i=r.option.api.list,n=await i({...o.page.getQuery({size:999999,num:1})});return(n.data||{[u.config.field.result.list]:n})[u.config.field.result.list]}catch(i){console.error(i)}finally{o.export.loading=!1}}},loading:!1,click:i=>{o.export.loading||o.export.run.start(i)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:S.Add,form:{},formDefault:{},formColumn:[],getDisabled:i=>o.update.type===S.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[o.update.type===S.Add?"create":"update"],getBind:i=>i.options?.[o.update.type===S.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[o.update.type===S.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getOptions:i=>{try{const t=o.update.formColumn.flat().find(s=>s.item.key===i)?.item;return t?{options:t.options,bind:o.update.getBind(t)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:i=>{if(r.option.form?.editAll)return i;let n={[r.option.table?.rowKey]:o.update.edit.data[r.option.table?.rowKey]};return Object.keys(o.update.edit.data).forEach(t=>{i[t]!==o.update.edit.data[t]&&(n[t]=i[t])}),n}},view:{},open:(i,n)=>{o.update.showContent||FunUtil.throttle(async()=>{k.loading(!0);try{o.update.type=i,await o.initApiData("update");const t=i===S.Add;o.update.edit.data=n,o.update.title=h.tCurd(t?"add":i===S.View?"view":"edit"),o.update.form=JSONUtil.cp(t?o.update.formDefault:n),await r.option.form?.openBefore?.(o.update.form,o.update),(!r.option.table?.inlineEdit||t)&&(o.update.show=!0,o.update.showContent=!0),r.option.form?.openAfter?.(o.update.form,o.update)}catch(t){console.error(t)}finally{k.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(s,p)=>new Promise((f,g)=>{s||(k.fail(h.tCurd("checkFormData")),g(!1)),f()})),o.update.loading=!0;const i=o.update.type===S.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(o.update.form,o.update)}catch{o.update.loading=!1;return}let n=JSONUtil.cp(o.update.form);delete n.children;const t=new Set(r.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(n).forEach(s=>{if(t.has(s)&&n[s]!=null){const p=new Date(n[s]).getTime();isNaN(p)||(n[s]=p)}});try{if(!i)return;await i({...n}),o.update.close(),await o.table.getList(),r.option.form?.submitAfter?.(n,o.update)}catch(s){console.error(s)}finally{o.update.loading=!1}})},close:()=>{o.update.show=!1,r.option.table?.inlineEdit&&(o.update.form={}),setTimeout(()=>{o.update.showContent=!1},350)}},remove:{title:h.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{o.remove.show=!1},open:i=>{if(i.length===0){k.fail(h.tCurd("selectDataToDelete"));return}o.remove.items=i,o.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{o.remove.loading=!0;const i=r.option.api.delete;try{if(!i)return;await i({[r.option.table?.rowKey]:o.remove.items.map(n=>n[r.option.table?.rowKey]),items:o.remove.items}),k.success(h.tCurd("operationSuccess")),o.table.data.length<=1&&o.page.num>1&&(o.page.num-=1),o.remove.close(),await o.table.getList()}catch(n){console.error(n)}finally{o.remove.loading=!1}})}},init:()=>{o.initCurdConfig(),o.initColumnOptions(),o.initColumnForm()},apiDataMap:{},initApiData:async i=>{const n=[],t=s=>{if(s.children&&s.children.length){s.children.forEach(p=>t(p));return}if(s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[i]){if(o.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const p=(async()=>{try{let f=await s.options?.[s.type]?.dataApi?.(o.update.form,i);if(f){const g=s.options?.[s.type]?.dataPath;!Array.isArray(f)&&g&&(f=ObjectUtil.getPathValue(f,g)),s.options[s.type].data=f,s.options.search[s.type].data=f,s.options.formAdd[s.type].data=f,s.options.formUpdate[s.type].data=f,o.apiDataMap[s.key]=f}}catch{}})();n.push(p)}};return r.option.column.forEach(s=>{t(s)}),await Promise.all(n),!0},initCurdConfig:()=>{const i=JSONUtil.cp(u.config);i.table.emptyText=h.tCurd("noData"),r.option.size=r.option.size||{},i.table.size=r.option.size.table||i.size.table,i.form.size=r.option.size.form||i.size.form,i.size.search=r.option.size.search||i.size.search;const n=ObjectUtil.deepMerge(i,r.option||{});Object.keys(n).forEach(t=>{r.option[t]=n[t]})},initColumnOptions:()=>{let i=JSONUtil.cp(u.config.columnConfig);i.options=ObjectUtil.deepMerge({switch:{activeText:h.tCurd("switchOn"),inactiveText:h.tCurd("switchOff")}},i.options);const n=t=>{for(const s in i){if(s==="table"){if(t.table=ObjectUtil.deepMerge(i.table,t.table||{}),t.children){t.children.forEach(f=>{n(f)});return}}else s==="type"?t.type=t.type||i.type:t[s]=ObjectUtil.deepMerge(i[s],t[s]||{});t.options=t.options||{},t.options[t.type]=t.options[t.type]||{},t.options[t.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(f=>{t.options[f]=t.options[f]||JSONUtil.cp(t.options),t.options[f][t.type]=t.options[f][t.type]||{},t.options[f][t.type].size=f==="search"?r.option.size.search:r.option.size.form}),t.table=ObjectUtil.deepMerge(t.table,t.options[t.type].table||{})}t.type==="switch"&&(t.options.switch.tableBeforeChange=async(s,p)=>{const f=t.options?.switch;try{f.tableConfig?.confirm&&await a.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update)return;const g=p[r.option.table?.rowKey];f.loadingMap||(f.loadingMap={}),f.loadingMap[g]||(f.loadingMap[g]={loading:!1}),f.loadingMap[g].loading=!0;const l=p[s]===f.activeValue?f.inactiveValue:f.activeValue,d=f.tableConfig?.api?f.tableConfig.api:r.option.api.update;try{await d({...p,[s]:l})}catch{return!1}finally{f.loadingMap[g].loading=!1}return k.success(h.tCurd("operationSuccess")),f.tableConfig?.loadList&&(o.table.loading=!0,o.table.getList(),o.table.loading=!1),!0}catch(g){return console.error(g),!1}finally{o.table.loading=!1}}catch{return!1}}),t.type==="treeSelect"&&(t.options.treeSelect.rowKey=r.option.table?.rowKey,t.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(n),r.option.table?.column?.forEach(n)},getColumnSpan:(i,n)=>{if(i.item.form?.spanCol){const t=u.config.form.defaultSpan,p=n.filter(f=>!k.isFun(f.item.show?.form,o.update.form,o.update.type)).reduce((f,g)=>f+(g.item.form?.span||t),0);return(i.item?.form.span||t)+p}return i.item.form.span},initColumnForm:()=>{const i=r.option;o.update.formColumn=[],o.table.column.show={list:[],listSource:[]};const n=[],t=r.option.form?.maxSpan||12,s=r.option.form?.defaultSpan||t/2;let p=[];const f=d=>{if(d.children){o.table.column.show.list.push(d.key),d.children.forEach(b=>{f(b)});return}if(o.update.formDefault[d.key]=d.value,d.table.table&&(d.show.table&&o.table.column.show.list.push(d.key),d.table.table&&o.table.column.show.listSource.push(d.key)),!(d.isForm&&typeof d.show?.form=="boolean")||d.show?.form){d.form=d.form||{span:s},d.form.span=d.form.span??s;let b=d.form.span,y=p.reduce((V,N)=>V+N.span,b);const w=p.length;if(p.push({item:d,span:b}),(w===1&&p[0].span===0||y>=t||b===0&&w>1)&&(n.push(p),p=[]),d.rules){const V={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},N=(V[d.type]||V.input)+d.label;o.update.rules[d.key]=typeof d.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:d.rules}}},g=(d,b)=>{d.isForm=b,Array.isArray(d.children)&&d.children.forEach(y=>g(y,b))};i.column.forEach(d=>{d.isForm=!0,g(d,!0),f(d)}),r.option.table?.column?.forEach(d=>{g(d,!1),f(d)}),o.search.column.list=i.column.concat(i.table?.column||[]),o.table.column.list=o.search.column.list.filter(d=>d.table?.table),o.search.column.list.sort((d,b)=>d.sort?.search-b.sort?.search),o.table.column.list.sort((d,b)=>d.sort?.table-b.sort?.table),p.length>0&&n.push(p),o.update.formColumn=n;const l=r.option.search?.formDefault;l&&Object.keys(l).forEach(d=>{o.search.formDefault[d]=l[d]}),i.column.forEach(d=>{d.show?.search||(o.search.formDefault[d.key]=void 0)}),o.search.form=JSONUtil.cp(o.search.formDefault)}});return o.init(),e.onMounted(()=>{r.option.init!==!1&&o.table.getList()}),{conf:o,switchConfirmRef:a,ruleFormRef:c}},q={class:"dialog-footer"},Q=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:a}){const c=e.ref(!1),o=e.ref("确认修改"),i=e.ref("确认要修改状态吗?");let n=null,t=null;const s=g=>(g?.title&&(o.value=g.title),g?.content&&(i.value=g.content),c.value=!0,new Promise((l,d)=>{n=l,t=d})),p=()=>{c.value=!1,n?.(!0),n=null,t=null},f=()=>{c.value=!1,t?.(new Error("用户取消操作")),n=null,t=null};return a({open:s}),(g,l)=>{const d=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(m.ElDialog),{modelValue:c.value,"onUpdate:modelValue":l[0]||(l[0]=b=>c.value=b),title:o.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(d,{size:g.size},{default:e.withCtx(()=>[e.createElementVNode("span",q,[e.createVNode(e.unref(m.ElButton),{onClick:f},{default:e.withCtx(()=>l[1]||(l[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:p},{default:e.withCtx(()=>l[2]||(l[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(i.value),1)]),_:1},8,["modelValue","title"])}}}),U=(r,a)=>{const c=r.__vccOpts||r;for(const[o,i]of a)c[o]=i;return c},G={},X={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Y(r,a){return e.openBlock(),e.createElementBlock("svg",X,a[0]||(a[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=U(G,[["render",Y]]),P={},_={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(r,a){return e.openBlock(),e.createElementBlock("svg",_,a[0]||(a[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=U(P,[["render",v]]),te={class:"row flex-center table-header-label inline"},oe={class:"table-header-tooltip"},ae={key:1},ne=["onClick","innerHTML"],le=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const a=k.isFun,c=e.getCurrentInstance().type;return(o,i)=>{const n=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[o.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(o.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",te,[t.table?.tooltip?(e.openBlock(),e.createBlock(n,{key:0,effect:"dark",content:t.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",oe,[e.createVNode(ee)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)])])]),default:e.withCtx(({row:s})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i[0]||(i[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:o.conf,columnList:t.children,option:o.option},e.createSlots({_:2},[e.renderList(o.$slots,(p,f)=>({name:f,fn:e.withCtx(g=>[e.renderSlot(o.$slots,f,e.mergeProps({ref_for:!0},g||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.conf.update.type===e.unref(k).EDialog.Update&&e.unref(a)(t.show?.form,o.conf.update.form,e.unref(k).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.update.form[o.option.table?.rowKey]===s[o.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(m.ElInput),e.mergeProps({key:0,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":p=>o.conf.update.form[t.key]=p,disabled:o.conf.update.getDisabled(t),ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":p=>o.conf.update.form[t.key]=p,disabled:o.conf.update.getDisabled(t),ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{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,p=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:2,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":p=>o.conf.update.form[t.key]=p,ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{disabled:o.conf.update.getDisabled(t)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(o.$slots,"table-"+t.key,{key:1,row:s,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:s[t.key],"onUpdate:modelValue":p=>s[t.key]=p,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(m.ElSwitch),e.mergeProps({key:0,modelValue:s[t.key],"onUpdate:modelValue":p=>s[t.key]=p,loading:t.options?.switch?.loadingMap?.[s[o.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,s),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ae,e.toDisplayString(s[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:p=>t.table?.click?.callback?.(s),innerHTML:t.table?.format?t.table?.format(s):s[t.key]},null,14,ne))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),re={class:"row form-item-content",style:{width:"100%"}},ie={class:"col column form-item-content-item"},se={class:"col"},de=["innerHTML"],ce=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(a,c)=>(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof a.item.item.text?.form?.label=="boolean"?!a.item.item.text?.form?.label:!1}),label:typeof a.item.item.text?.form?.label=="string"?a.item.item.text?.form?.label:a.item.item.label,prop:a.item.item.key,"label-width":a.item.item.form?.labelWidth||a.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.renderSlot(a.$slots,"form-"+a.item.item.key+"-start",{row:a.conf.update.form,item:a.item.item}),e.createElementVNode("div",ie,[e.createElementVNode("div",se,[e.renderSlot(a.$slots,"form-"+a.item.item.key,{row:a.conf.update.form,item:a.item.item},()=>[a.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):a.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):a.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.conf.update.getBind(a.item.item).data,o=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):a.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.conf.update.getBind(a.item.item).data,o=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):a.item.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:a.conf.update.form,field:a.item.item.key},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):a.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):a.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):a.item.item.type&&(e.unref(B).customComponent[a.item.item.type]||e.unref(B).customComponent[a.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[a.item.item.type]?.form||e.unref(B).customComponent[a.item.item.type]),e.mergeProps({key:7,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[6]||(c[6]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(a.$slots,"form-"+a.item.item.key+"-right",{row:a.conf.update.form,item:a.item.item})]),e.renderSlot(a.$slots,"form-"+a.item.item.key+"-tip",{row:a.conf.update.form,item:a.item.item},()=>[a.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof a.item.item.form?.tipText=="function"?a.item.item.form?.tipText(a.conf.update.form,a.conf.update.type):a.item.item.form?.tipText},null,8,de)):e.createCommentVNode("",!0)])]),e.renderSlot(a.$slots,"form-"+a.item.item.key+"-end",{row:a.conf.update.form,item:a.item.item})])]),_:3},8,["class","label","prop","label-width"]))}}),fe={key:0,class:"relative curd-search fit-width"},pe={class:"mb-10 flex justify-between items-center fit-width"},me={class:"flex items-center",style:{gap:"10px"}},ge={key:0},he={key:1},ye={key:2},be={class:"export-btn"},ke={key:1,class:"export-btn"},ue={class:"flex items-center table-tools-right",style:{gap:"10px"}},we={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Ce={class:"dialog-footer"},Be={class:"dialog-footer"},T=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(r,{expose:a}){const c=k.EDialog,o=r,i=k.isFun,{conf:n,switchConfirmRef:t,ruleFormRef:s}=W(o);return a({conf:n}),(p,f)=>{const g=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(p.$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",fe,[e.createVNode(e.unref(m.ElForm),{model:e.unref(n).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-start",{row:e.unref(n).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).search.column.list,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[(typeof l.show?.search=="function"?l.show?.search(e.unref(n).search.form):l.show?.search)?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0,label:typeof l.text?.search?.label=="string"?l.text?.search?.label:l.label,class:e.normalizeClass({"hide-label":typeof l.text?.search?.label=="boolean"?!l.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-"+l.key,{row:e.unref(n).search.form},()=>[l.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:e.unref(n).search.form[l.key],"onUpdate:modelValue":d=>e.unref(n).search.form[l.key]=d,placeholder:e.unref(n).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(m.ElSelect),e.mergeProps({key:1,modelValue:e.unref(n).search.form[l.key],"onUpdate:modelValue":d=>e.unref(n).search.form[l.key]=d,placeholder:e.unref(n).search.getPlaceholder(l,e.unref(h).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(m.ElOption),{key:l.options?.switch?.activeValue,label:l.options?.switch?.activeLabel,value:l.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:l.options?.switch?.inactiveValue,label:l.options?.switch?.inactiveLabel,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(m.ElSelect),e.mergeProps({key:2,modelValue:e.unref(n).search.form[l.key],"onUpdate:modelValue":d=>e.unref(n).search.form[l.key]=d,placeholder:e.unref(n).search.getPlaceholder(l,e.unref(h).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,d=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(n).search.form[l.key],"onUpdate:modelValue":d=>e.unref(n).search.form[l.key]=d,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:4,modelValue:e.unref(n).search.form[l.key],"onUpdate:modelValue":d=>e.unref(n).search.form[l.key]=d,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(p.$slots,"search-"+l.key+"-right",{row:e.unref(n).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(p.$slots,"search-center",{row:e.unref(n).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(n).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:e.unref(n).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-end",{row:e.unref(n).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",pe,[e.createElementVNode("div",me,[e.unref(i)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:f[0]||(f[0]=l=>e.unref(n).update.open(e.unref(c).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(i)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",he,[e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:f[1]||(f[1]=l=>e.unref(n).remove.open(e.unref(n).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(m.ElButton),{type:"warning",onClick:f[2]||(f[2]=l=>e.unref(n).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).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(m.ElDropdown),{key:0,onCommand:e.unref(n).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(m.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(i)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:r.option.size?.search,onClick:f[3]||(f[3]=l=>e.unref(n).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"tools-left")]),e.createElementVNode("div",ue,[e.renderSlot(p.$slots,"tools-right"),e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":f[4]||(f[4]=l=>e.unref(n).page.num=l),"page-size":e.unref(n).page.size,"onUpdate:pageSize":f[5]||(f[5]=l=>e.unref(n).page.size=l),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:r.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).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?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:f[6]||(f[6]=(...l)=>e.unref(n).table.getList&&e.unref(n).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 ":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElTable),e.mergeProps({data:e.unref(n).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(n).table.selection.change,onSortChange:e.unref(n).table.sort.change,"expand-row-keys":e.unref(n).table.expand.rowKeys,onExpandChange:e.unref(n).table.expand.change},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(i)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(m.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(le,{conf:e.unref(n),columnList:e.unref(n).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(p.$slots,(l,d)=>({name:d,fn:e.withCtx(b=>[e.renderSlot(p.$slots,d,e.normalizeProps(e.guardReactiveProps(b||{})))])}))]),1032,["conf","columnList","option"]),e.unref(i)(r.option.table?.add)||e.unref(i)(r.option.table?.update)||e.unref(i)(r.option.table?.delete)||e.unref(i)(r.option.table?.view)||p.$slots["table-op-left"]||p.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:1,width:e.unref(n).table.op.width(e.unref(i)(r.option.table?.add),e.unref(i)(r.option.table?.update),e.unref(i)(r.option.table?.delete),e.unref(i)(r.option.table?.view),p.$slots["table-op-left"],p.$slots["table-op-right"]),align:"center",fixed:"right"},r.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(p.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:l})=>[e.createVNode(e.unref(m.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"table-op-left",{row:l}),e.unref(n).update.type===e.unref(c).Update&&r.option.table?.inlineEdit&&e.unref(n).update.form[o.option.table?.rowKey]===l[o.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(m.ElButton),{link:"",type:"info",onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{link:"",type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(p.$slots,"table-op-edit-right",{row:l})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(r.option.table?.add,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,link:"",type:"primary",onClick:d=>e.unref(n).update.open(e.unref(c).Add,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(r.option.table?.view,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,link:"",type:"primary",onClick:d=>e.unref(n).update.open(e.unref(c).View,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(r.option.table?.update,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,link:"",type:"warning",onClick:d=>e.unref(n).update.open(e.unref(c).Update,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(r.option.table?.delete,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:3,link:"",type:"danger",onClick:d=>e.unref(n).remove.open([l])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"table-op-right",{row:l})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[g,e.unref(n).table.loading]])],2)],2),e.createElementVNode("div",we,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":f[7]||(f[7]=l=>e.unref(n).page.num=l),"page-size":e.unref(n).page.size,"onUpdate:pageSize":f[8]||(f[8]=l=>e.unref(n).page.size=l),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:r.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).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(p.$slots,"box-right")],2),e.createVNode(e.unref(m.ElDialog),e.mergeProps({modelValue:e.unref(n).update.show,"onUpdate:modelValue":f[9]||(f[9]=l=>e.unref(n).update.show=l),title:e.unref(n).update.title,"before-close":e.unref(n).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Ce,[e.createVNode(e.unref(m.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(n).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:s,model:e.unref(n).update.form,rules:e.unref(n).update.rules,size:r.option.size?.form},{default:e.withCtx(()=>[e.unref(n).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(n).update.formColumn,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(i)((()=>{const d=[],b=y=>{y?.item?.children?b(y.item.children):d.push(...y.map(w=>w.item?.show?.form))};return b(l),d})(),e.unref(n).update.form,e.unref(n).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(p.$slots,"form-start",{row:e.unref(n).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(i)(d.item.show?.form,e.unref(n).update.form,e.unref(n).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([d.item.form.span>0?`col-${e.unref(n).getColumnSpan(d,l)}`:"col",`form-item-col-${d.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.item.children?d.children:[d],b=>(e.openBlock(),e.createBlock(ce,{key:b.item.key,conf:e.unref(n),item:b},e.createSlots({_:2},[e.renderList(p.$slots,(y,w)=>({name:w,fn:e.withCtx(V=>[e.renderSlot(p.$slots,w,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(p.$slots,"form-end",{row:e.unref(n).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(m.ElDialog),{modelValue:e.unref(n).remove.show,"onUpdate:modelValue":f[10]||(f[10]=l=>e.unref(n).remove.show=l),title:e.unref(n).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Be,[e.createVNode(e.unref(m.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(n).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:e.unref(n).remove.submit,loading:e.unref(n).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(n).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(Q,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Ve{static async download(a,c="download.png"){const o=document.createElement("a");o.style.display="none",o.href=a,o.setAttribute("download",c),typeof o.download>"u"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)}static exportJSONFile=(a,c)=>{const o=new Blob([JSON.stringify(a)],{type:"application/json"}),i=URL.createObjectURL(o),n=document.createElement("a");n.href=i,n.download=`${c||"config"}.json`,n.click()};static importFile=async a=>new Promise((c,o)=>{const i=document.createElement("input");i.type="file";const n=a?.accept||".json";i.accept=n,i.style.display="none",i.onchange=t=>{const s=t.target.files[0];if(!s){k.fail("未选择文件"),o("未选择文件");return}const p=new FileReader;p.onload=async f=>{const g=n==".json"?JSON.parse(f.target.result):f.target.result;c(g)},p.onerror=()=>{k.fail("文件读取失败"),o("文件读取失败")},p.readAsText(s),document.body.removeChild(i)},document.body.appendChild(i),i.click()})}const L=(r,a)=>{if(r.component("TCurd",T),r.component("TFormList",D),r.component("TColumn",$),a?.customComponent){B.customComponent=a.customComponent;for(const c in a.customComponent)r.component(c,a.customComponent[c])}},Ee={install:L};C.ArrUtil=E,C.ExcelUtil=O,C.TColumn=$,C.TCurd=T,C.TFile=Ve,C.TForm=B,C.TFormConfig=u,C.TFormI18n=h,C.TFormList=D,C.TSys=k,C.default=Ee,C.install=L,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(C,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],p):(C=typeof globalThis<"u"?globalThis:C||self,p(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,p,xe,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=(c,...s)=>Array.isArray(c)?c.some(n=>typeof n=="function"?n(...s):n):typeof c=="function"?c(...s):c;static getRouterParams=()=>{const c=this.router.currentRoute.value.query||{},s=this.router.currentRoute.value.params||{};return Object.keys(c).length?c:Object.keys(s).length?s:{}};static moduleObj={};static loadModule=async c=>{if(!b.moduleObj[c])throw new Error(`模块${c}未加载,请赋值如:TSys.moduleObj = { ${c}: ()=>import('${c}') }`);const s=await b.moduleObj[c]();return s.default??s};static tipMessages={};static tipMessagesGap=500;static showMessage(c,s,n={}){const r=Date.now();if(!this.tipMessages[c]||r-this.tipMessages[c]>this.tipMessagesGap){this.tipMessages[c]=r;const a=Object.assign({message:c,type:s},n);p.ElMessage(a),setTimeout(()=>{delete this.tipMessages[c]},this.tipMessagesGap)}}static fail=(c,s={})=>{this.showMessage(c,"error",s)};static success=(c,s={})=>{this.showMessage(c,"success",s)};static loadingObj=null;static loadingTimer=null;static loading=(c=!0,s="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{c?this.loadingObj=p.ElLoading.service({lock:!0,text:s,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(c,s=!0)=>{if(s){let n=screen.width/2-500,r=screen.height/2-800/2-30;window.open(c,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+r+", left="+n)}else window.open(c,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=c=>new Promise(async(s,n)=>{let r=document.getElementById(c.id);const a=await b.loadModule("html2canvas");try{a(r,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:c.windowWidth,height:c.windowHeight,windowWidth:c.windowWidth,windowHeight:c.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(o){let i=o.toDataURL("image/png");s(i)})}catch(o){n(o)}})}class u{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:{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=c=>{u.config=ObjectUtil.deepMerge(u.config,c)}}class B{static customComponent={};static findOptions=(c,s)=>{const n=c.column.find(a=>a.key===s),r=a=>a.replace(/-([a-z])/g,(o,i)=>i.toUpperCase());if(n)return n.options[r(n.type)]};static setOptionsData=(c,s,n)=>{const r=B.findOptions(c,s);r&&(r.data=n)};static form={openBefore:{parentId:(c,s,n,r)=>{const a=u.config.table.rowKey;c?s.type===b.EDialog.Add?(s.form.parentId=c[a],s.form.sort=c.children.length+1):s.form.parentId=c.parentId.substring(c.parentId.lastIndexOf(",")+1):(s.form.parentId="0",s.form.sort=n.length+1),B.setOptionsData(r,"parentId",[{[a]:"0",title:"根",children:n}])}}}}function Se(t){return t}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:"确认要修改吗?"};class h{static t(c,...s){if(typeof c=="function")return c(...s);c=String(c);let n=0;return c.replace(/{([^}]+)}/g,(r,a)=>n<s.length?String(s[n++]):`{${a}}`)}static setI18n=c=>{h.curd=ObjectUtil.deepMerge(h.curd,c)};static tCurd(c,...s){return this.t(this.curd[c],...s)}static curd=L}class E{static getIdFun=()=>StrUtil.uuid();static setId=(c,s,n)=>{s[c]||(s[c]=[]);const r=u.config.table.rowKey;s[c].forEach(a=>{n.forEach(o=>{let i=o.default??"";o.type==="number"&&(i=o.default??0),o.type==="boolean"&&(i=o.default??!1),o.type==="time"&&(i=o.default??new Date),a[o.value]===void 0&&(a[o.value]=i)}),a[r]||(a[r]=E.getIdFun())})};static add=(c,s,n,r)=>{const a=JSONUtil.cp(n);E.setId(c,s,n);const o=u.config.table.rowKey;s[c].push(a.reduce((i,m)=>{let f=m.default??"";return m.type==="number"&&(f=m.default??0),m.type==="boolean"&&(f=m.default??!1),m.type==="time"&&(f=m.default??new Date),i[m.value]=f,i},{[o]:E.getIdFun()})),r?.(s)};static remove=(c,s,n,r)=>{const a=u.config.table.rowKey;s[c]=s[c].filter(o=>o[a]!==n[a]),r?.(s)};static getNoIdData=(c,s)=>{const n=JSONUtil.cp(c),r=u.config.table.rowKey;return n.forEach(a=>{a[r]&&delete a[r],s&&a[s]&&E.getNoIdData(a[s],s)}),n}}const M={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},N=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:c}){const s=t,n=e.reactive({show:!1,add:(a,o,i)=>{E.add(a,o,i,()=>{r("change")})},remove:(a,o,i)=>{E.remove(a,o,i,()=>{r("change")})}});e.onMounted(()=>{E.setId(s.field,s.row,s.itemFields),n.show=!0});const r=c;return(a,o)=>{const i=e.resolveComponent("el-button"),m=e.resolveComponent("el-input");return n.show?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(a.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(i,{link:"",type:"primary",onClick:o[0]||(o[0]=f=>n.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],f=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(a.$slots,"item-start",{item:f,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,g=>(e.openBlock(),e.createBlock(m,{modelValue:f[g.value],"onUpdate:modelValue":l=>f[g.value]=l,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:g[t.label]||g[t.value],onChange:o[1]||(o[1]=l=>r("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(a.$slots,"item-end",{item:f,row:t.row}),e.createVNode(i,{link:"",type:"danger",onClick:g=>n.remove(t.field,t.row,f)},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{link:"",type:"primary",onClick:o[2]||(o[2]=f=>n.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},R={class:"col"},K={class:"col"},J=["innerHTML"],F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(t,{expose:c}){const s=b.isFun,n=b.EDialog,r=e.ref(),a=t,o=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:a.type||n.Add,formColumn:[],getDisabled:i=>o.type===n.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[o.type===n.Add?"create":"update"],getBind:i=>i.options?.[o.type===n.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[o.type===n.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,m)=>{if(i.item.form?.spanCol){const f=a.option.form?.maxSpan||12,g=a.option.form?.defaultSpan||f/2,d=m.filter(k=>!b.isFun(k.item.show?.form,o.form,o.type)).reduce((k,y)=>k+(y.item.form?.span||g),0);return(i.item.form?.span||g)+d}return i.item.form?.span},initColumnForm:()=>{const i=a.option;o.formColumn=[],o.rules={},o.formDefault={};const m=[],f=a.option.form?.maxSpan||12,g=a.option.form?.defaultSpan||f/2;let l=[];const d=y=>{if(y.children){y.children.forEach(w=>{d(w)});return}if(o.formDefault[y.key]=y.value,y.isForm&&(typeof y.show?.form!="boolean"||y.show?.form)){y.form=y.form||{span:g},y.form.span=y.form.span??g;const w=y.form.span,V=l.reduce((D,z)=>D+z.span,w),S=l.length;if(l.push({item:y,span:w}),(S===1&&l[0].span===0||V>=f||w===0&&S>1)&&(m.push(l),l=[]),y.rules){const D={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},z=(D[y.type]||D.input)+y.label;o.rules[y.key]=typeof y.rules=="boolean"?[{required:!0,message:z,trigger:"blur"}]:y.rules}}},k=(y,w)=>{y.isForm=w,Array.isArray(y.children)&&y.children.forEach(V=>k(V,w))};i.column.forEach(y=>{k(y,!0),d(y)}),l.length>0&&m.push(l),o.formColumn=m,o.form=JSONUtil.cp(o.formDefault)}});return o.initColumnForm(),c({ref:r,conf:o}),(i,m)=>(e.openBlock(),e.createBlock(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:r,model:o.form,rules:o.rules},{default:e.withCtx(()=>[o.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.formColumn,(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[e.unref(s)(f.map(l=>l.item?.show?.form),o.form,o.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:t.option.form?.stripe===void 0?!0:t.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:o.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.item.key},[e.unref(s)(l.item.show?.form,o.form,o.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([l.item.form.span>0?`col-${o.getColumnSpan(l,f)}`:"col",`form-item-col-${l.item.key}`])},[e.createVNode(e.unref(p.ElFormItem),{label:l.item.text?.form?.label??l.item.label,prop:l.item.key,"label-width":l.item.text?.form?.label==""?0:l.item.form?.labelWidth||t.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(i.$slots,"form-"+l.item.key+"-start",{row:o.form,item:l.item}),e.createElementVNode("div",R,[e.createElementVNode("div",K,[e.renderSlot(i.$slots,"form-"+l.item.key,{row:o.form,item:l.item},()=>[l.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(p.ElRadioGroup),e.mergeProps({key:3,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,d=>(e.openBlock(),e.createBlock(e.unref(p.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="list"?(e.openBlock(),e.createBlock(N,e.mergeProps({key:4,row:o.form,field:l.item.key},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):l.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:5,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:6,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type&&(e.unref(B).customComponent[l.item.type]||e.unref(B).customComponent[l.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.item.type]?.form||e.unref(B).customComponent[l.item.type]),e.mergeProps({key:7,modelValue:o.form[l.item.key],"onUpdate:modelValue":d=>o.form[l.item.key]=d},{ref_for:!0},o.getBind(l.item),e.toHandlers(o.getOn(l.item)),{disabled:o.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+l.item.key+"-right",{row:o.form,item:l.item})]),e.renderSlot(i.$slots,"form-"+l.item.key+"-tip",{row:o.form,item:l.item},()=>[l.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof l.item.form?.tipText=="function"?l.item.form?.tipText(o.form,o.type):l.item.form?.tipText},null,8,J)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+l.item.key+"-end",{row:o.form,item:l.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:o.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class ${static exportToExcel=async(c,s,n)=>{if(!c||c.length===0)return;const r=await b.loadModule("xlsx"),a=c.map(m=>{const f={};return s.forEach(g=>{f[g.label]=m[g.key]}),f}),o=r.utils.json_to_sheet(a),i=r.utils.book_new();r.utils.book_append_sheet(i,o,"Sheet1"),n?typeof n=="function"&&(n=n()):n=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,r.writeFile(i,`${n}.xlsx`)}}const x=b.EDialog,W=t=>{const c=e.ref(),s=e.ref(),n=e.reactive({option:t.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(r,a=h.tCurd("placeholderInput"))=>r.text?.search?.placeholder===void 0?`${a}${r.label}`:r.text?.search?.placeholder,getFormData:()=>{let r={};t.option.column.forEach(o=>{(typeof o.show?.search=="function"?o.show?.search(n.search.form):o.show?.search)&&(r[o.key]=n.search.form[o.key])});const a=t.option.search?.before?.(r);return a&&(r=a),r},reset:()=>{const r=n.search.formDefault;Object.keys(r).forEach(a=>{t.option.search?.resetMode==="none"?r[a]=void 0:r[a]=n.search.formDefault[a]}),n.search.form=JSONUtil.cp(r),n.page.num=1,t.option.init!==!1&&n.table.getList()},submit:()=>{n.page.num=1,n.table.getList()}},page:{num:1,total:0,layout:t.option.page?.layout||u.config.pagination.layout,showTools:t.option.page?.showTools||u.config.pagination.showTools,size:t.option.page?.size||u.config.pagination.size,sizeList:t.option.page?.sizeList||u.config.pagination.pageSizes,pagerCount:t.option.page?.pagerCount||u.config.pagination.pagerCount,getQuery:(r={})=>({[u.config.field.page.size]:r.size||n.page.size,[u.config.field.page.num]:r.num||n.page.num,...n.search.getFormData()})},table:{op:{width:(...r)=>r.filter(o=>o).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(r,a)=>{},all:()=>{if(n.table.expand.isExpand)n.table.expand.rowKeys=[];else{const r=a=>{let o=[];return a.forEach(i=>{o.push(i[t.option.table.rowKey]),i.children&&i.children.length>0&&(o=o.concat(r(i.children)))}),o};n.table.expand.rowKeys=r(n.table.data)}n.table.expand.isExpand=!n.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{n.table.loading=!0;const r=t.option.api.list;try{await n.initApiData("init");let a={};if(n.table.sort.prop){const{props:d,order:k}=u.config.table.sort;a={[d.field]:n.table.sort.prop,[k.field]:n.table.sort.order}}const o=await r({...n.page.getQuery(),...a}),i=u.config.field.result,m=o.data||{[i.list]:o};let f=(Array.isArray(m[i.list]),m[i.list]);const g=n.update.formColumn.flat(),l=JSONUtil.cp(f).map(d=>(Object.keys(d).forEach(y=>{const w=g.find(V=>V.item.key===y);w&&["select","radio"].includes(w.item.type)&&(w.item.table.format||(w.item.table.format=V=>w.item.options[w.item.type].data?.find(S=>S.value==V[y])?.label||V[y]))}),d));n.table.data=t.option.data?await t.option.data(l,f):l,n.page.total=m[i.total]||0}catch(a){console.error(a)}finally{n.table.loading=!1}},selection:{list:[],change:r=>{n.table.selection.list=r}},sort:{prop:"",order:"",change:r=>{u.config.table.sort.resetPage&&(n.page.num=1);const a=u.config.table.sort;if(a.change){a.change(r,n);return}n.table.sort.prop=r.prop,r.order===null?n.table.sort.order="":n.table.sort.order=r.order==="ascending"?a.order.asc:a.order.desc,n.table.getList()}}},export:{run:{start:async r=>{let a=await n.export.run[r](),o=t.option.column;const i=JSONUtil.cp({data:a,columns:o}),m=t.option.tools?.export||{};m.before&&m.before(i),$.exportToExcel(i.data,i.columns,m.fileName)},select:async()=>{n.export.loading=!0;try{if(t.option.tools?.export?.select){await t.option.tools?.export?.select({...n.page.getQuery(),items:n.table.selection.list});return}if(n.table.selection.list.length===0)throw b.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return n.table.selection.list}catch(r){console.error(r)}finally{n.export.loading=!1}},page:async()=>{n.export.loading=!0;try{if(t.option.tools?.export?.page){await t.option.tools?.export?.page({...n.page.getQuery()});return}if(n.table.data.length===0)throw b.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return n.table.data}catch(r){console.error(r)}finally{n.export.loading=!1}},all:async()=>{n.export.loading=!0;try{if(t.option.tools?.export?.all){await t.option.tools?.export?.all({...n.page.getQuery()});return}const r=t.option.api.list,a=await r({...n.page.getQuery({size:999999,num:1})});return(a.data||{[u.config.field.result.list]:a})[u.config.field.result.list]}catch(r){console.error(r)}finally{n.export.loading=!1}}},loading:!1,click:r=>{n.export.loading||n.export.run.start(r)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:x.Add,form:{},formDefault:{},formColumn:[],getDisabled:r=>n.update.type===x.View?r.disabled?.view===void 0?!0:r.disabled?.view:r.disabled?.[n.update.type===x.Add?"create":"update"],getBind:r=>r.options?.[n.update.type===x.Add?"formAdd":"formUpdate"]?.[r.type]||r.options?.[r.type]||{},getOn:r=>r.options?.[n.update.type===x.Add?"formAdd":"formUpdate"]?.[r.type]?.on||r.options?.[r.type]?.on||{},getOptions:r=>{try{const o=n.update.formColumn.flat().find(i=>i.item.key===r)?.item;return o?{options:o.options,bind:n.update.getBind(o)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:r=>{if(t.option.form?.editAll)return r;let a={[t.option.table?.rowKey]:n.update.edit.data[t.option.table?.rowKey]};return Object.keys(n.update.edit.data).forEach(o=>{r[o]!==n.update.edit.data[o]&&(a[o]=r[o])}),a}},view:{},open:(r,a)=>{n.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{n.update.type=r,await n.initApiData("update");const o=r===x.Add;n.update.edit.data=a,n.update.title=h.tCurd(o?"add":r===x.View?"view":"edit"),n.update.form=JSONUtil.cp(o?n.update.formDefault:a),await t.option.form?.openBefore?.(n.update.form,n.update),(!t.option.table?.inlineEdit||o)&&(n.update.show=!0,n.update.showContent=!0),t.option.form?.openAfter?.(n.update.form,n.update)}catch(o){console.error(o)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await s.value?.validate(async(i,m)=>new Promise((f,g)=>{i||(b.fail(h.tCurd("checkFormData")),g(!1)),f()})),n.update.loading=!0;const r=n.update.type===x.Add?t.option.api.create:t.option.api.update;try{await t.option.form?.submitBefore?.(n.update.form,n.update)}catch{n.update.loading=!1;return}let a=JSONUtil.cp(n.update.form);delete a.children;const o=new Set(t.option.column.filter(i=>i.type==="datetime").map(i=>i.key));Object.keys(a).forEach(i=>{if(o.has(i)&&a[i]!=null){const m=new Date(a[i]).getTime();isNaN(m)||(a[i]=m)}});try{if(!r)return;await r({...a}),n.update.close(),await n.table.getList(),t.option.form?.submitAfter?.(a,n.update)}catch(i){console.error(i)}finally{n.update.loading=!1}})},close:()=>{n.update.show=!1,t.option.table?.inlineEdit&&(n.update.form={}),setTimeout(()=>{n.update.showContent=!1},350)}},remove:{title:h.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{n.remove.show=!1},open:r=>{if(r.length===0){b.fail(h.tCurd("selectDataToDelete"));return}n.remove.items=r,n.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{n.remove.loading=!0;const r=t.option.api.delete;try{if(!r)return;await r({[t.option.table?.rowKey]:n.remove.items.map(a=>a[t.option.table?.rowKey]),items:n.remove.items}),b.success(h.tCurd("operationSuccess")),n.table.data.length<=1&&n.page.num>1&&(n.page.num-=1),n.remove.close(),await n.table.getList()}catch(a){console.error(a)}finally{n.remove.loading=!1}})}},init:()=>{n.initCurdConfig(),n.initColumnOptions(),n.initColumnForm()},apiDataMap:{},initApiData:async r=>{const a=[],o=i=>{if(i.children&&i.children.length){i.children.forEach(m=>o(m));return}if(i.options?.[i.type]?.dataApi&&i.options?.[i.type]?.dataApiConfig?.[r]){if(n.apiDataMap[i.key]&&i.options?.[i.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let f=await i.options?.[i.type]?.dataApi?.(n.update.form,r);if(f){const g=i.options?.[i.type]?.dataPath;!Array.isArray(f)&&g&&(f=ObjectUtil.getPathValue(f,g)),i.options[i.type].data=f,i.options.search[i.type].data=f,i.options.formAdd[i.type].data=f,i.options.formUpdate[i.type].data=f,n.apiDataMap[i.key]=f}}catch{}})();a.push(m)}};return t.option.column.forEach(i=>{o(i)}),await Promise.all(a),!0},initCurdConfig:()=>{const r=JSONUtil.cp(u.config);r.table.emptyText=h.tCurd("noData"),t.option.size=t.option.size||{},r.table.size=t.option.size.table||r.size.table,r.form.size=t.option.size.form||r.size.form,r.size.search=t.option.size.search||r.size.search;const a=ObjectUtil.deepMerge(r,t.option||{});Object.keys(a).forEach(o=>{t.option[o]=a[o]})},initColumnOptions:()=>{let r=JSONUtil.cp(u.config.columnConfig);r.options=ObjectUtil.deepMerge({switch:{activeText:h.tCurd("switchOn"),inactiveText:h.tCurd("switchOff")}},r.options);const a=o=>{for(const i in r){if(i==="table"){if(o.table=ObjectUtil.deepMerge(r.table,o.table||{}),o.children){o.children.forEach(f=>{a(f)});return}}else i==="type"?o.type=o.type||r.type:o[i]=ObjectUtil.deepMerge(r[i],o[i]||{});o.options=o.options||{},o.options[o.type]=o.options[o.type]||{},o.options[o.type].size=t.option.size.form,["search","formAdd","formUpdate"].forEach(f=>{o.options[f]=o.options[f]||JSONUtil.cp(o.options),o.options[f][o.type]=o.options[f][o.type]||{},o.options[f][o.type].size=f==="search"?t.option.size.search:t.option.size.form}),o.table=ObjectUtil.deepMerge(o.table,o.options[o.type].table||{})}o.type==="switch"&&(o.options.switch.tableBeforeChange=async(i,m)=>{const f=o.options?.switch;try{f.tableConfig?.confirm&&await c.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")});try{if(!t.option.api.update&&!f.tableConfig?.api)return;const g=m[t.option.table?.rowKey];f.loadingMap||(f.loadingMap={}),f.loadingMap[g]||(f.loadingMap[g]={loading:!1}),f.loadingMap[g].loading=!0;const l=m[i]===f.activeValue?f.inactiveValue:f.activeValue,d=f.tableConfig?.api?f.tableConfig.api:t.option.api.update;if(!d)return;try{await d({...m,[i]:l},"switch")}catch{return!1}finally{f.loadingMap[g].loading=!1}return b.success(h.tCurd("operationSuccess")),f.tableConfig?.loadList&&(n.table.loading=!0,n.table.getList(),n.table.loading=!1),!0}catch(g){return console.error(g),!1}finally{n.table.loading=!1}}catch{return!1}}),o.type==="treeSelect"&&(o.options.treeSelect.rowKey=t.option.table?.rowKey,o.options.treeSelect.nodeKey=t.option.table?.rowKey)};t.option.column.forEach(a),t.option.table?.column?.forEach(a)},getColumnSpan:(r,a)=>{if(r.item.form?.spanCol){const o=u.config.form.defaultSpan,m=a.filter(f=>!b.isFun(f.item.show?.form,n.update.form,n.update.type)).reduce((f,g)=>f+(g.item.form?.span||o),0);return(r.item?.form.span||o)+m}return r.item.form.span},initColumnForm:()=>{const r=t.option;n.update.formColumn=[],n.table.column.show={list:[],listSource:[]};const a=[],o=t.option.form?.maxSpan||12,i=t.option.form?.defaultSpan||o/2;let m=[];const f=d=>{if(d.children){n.table.column.show.list.push(d.key),d.children.forEach(k=>{f(k)});return}if(n.update.formDefault[d.key]=d.value,d.table.table&&(d.show.table&&n.table.column.show.list.push(d.key),d.table.table&&n.table.column.show.listSource.push(d.key)),!(d.isForm&&typeof d.show?.form=="boolean")||d.show?.form){d.form=d.form||{span:i},d.form.span=d.form.span??i;let k=d.form.span,y=m.reduce((V,S)=>V+S.span,k);const w=m.length;if(m.push({item:d,span:k}),(w===1&&m[0].span===0||y>=o||k===0&&w>1)&&(a.push(m),m=[]),d.rules){const V={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},S=(V[d.type]||V.input)+d.label;n.update.rules[d.key]=typeof d.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:d.rules}}},g=(d,k)=>{d.isForm=k,Array.isArray(d.children)&&d.children.forEach(y=>g(y,k))};r.column.forEach(d=>{d.isForm=!0,g(d,!0),f(d)}),t.option.table?.column?.forEach(d=>{g(d,!1),f(d)}),n.search.column.list=r.column.concat(r.table?.column||[]),n.table.column.list=n.search.column.list.filter(d=>d.table?.table),n.search.column.list.sort((d,k)=>d.sort?.search-k.sort?.search),n.table.column.list.sort((d,k)=>d.sort?.table-k.sort?.table),m.length>0&&a.push(m),n.update.formColumn=a;const l=t.option.search?.formDefault;l&&Object.keys(l).forEach(d=>{n.search.formDefault[d]=l[d]}),r.column.forEach(d=>{d.show?.search||(n.search.formDefault[d.key]=void 0)}),n.search.form=JSONUtil.cp(n.search.formDefault)}});return n.init(),e.onMounted(()=>{t.option.init!==!1&&n.table.getList()}),{conf:n,switchConfirmRef:c,ruleFormRef:s}},q={class:"dialog-footer"},Q=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:c}){const s=e.ref(!1),n=e.ref("确认修改"),r=e.ref("确认要修改状态吗?");let a=null,o=null;const i=g=>(g?.title&&(n.value=g.title),g?.content&&(r.value=g.content),s.value=!0,new Promise((l,d)=>{a=l,o=d})),m=()=>{s.value=!1,a?.(!0),a=null,o=null},f=()=>{s.value=!1,o?.(new Error("用户取消操作")),a=null,o=null};return c({open:i}),(g,l)=>{const d=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(p.ElDialog),{modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=k=>s.value=k),title:n.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(d,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",q,[e.createVNode(e.unref(p.ElButton),{onClick:f},{default:e.withCtx(()=>[...l[1]||(l[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:m},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(r.value),1)]),_:1},8,["modelValue","title"])}}}),O=(t,c)=>{const s=t.__vccOpts||t;for(const[n,r]of c)s[n]=r;return s},G={},X={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Y(t,c){return e.openBlock(),e.createElementBlock("svg",X,[...c[0]||(c[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=O(G,[["render",Y]]),P={},_={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(t,c){return e.openBlock(),e.createElementBlock("svg",_,[...c[0]||(c[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=O(P,[["render",v]]),te={class:"row flex-center table-header-label inline"},oe={class:"table-header-tooltip"},ne={key:1},ae=["onClick","innerHTML"],le=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const c=b.isFun,s=e.getCurrentInstance().type;return(n,r)=>{const a=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.key},[t.conf.table.column.show.list.includes(o.key)?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,prop:o.key,label:o.label},{ref_for:!0},o.table),{header:e.withCtx(()=>[e.renderSlot(n.$slots,"table-header-"+o.key,{item:o},()=>[e.createElementVNode("div",te,[o.table?.tooltip?(e.openBlock(),e.createBlock(a,{key:0,effect:"dark",content:o.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",oe,[e.createVNode(ee)])]),_:1},8,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)])])]),default:e.withCtx(({row:i})=>[o.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r[0]||(r[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),{conf:t.conf,columnList:o.children,option:t.option},e.createSlots({_:2},[e.renderList(n.$slots,(m,f)=>({name:f,fn:e.withCtx(g=>[e.renderSlot(n.$slots,f,e.mergeProps({ref_for:!0},g||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(b).EDialog.Update&&e.unref(c)(o.show?.form,t.conf.update.form,e.unref(b).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===i[t.option.table?.rowKey]&&(o.type==="input"||o.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":m=>t.conf.update.form[o.key]=m,disabled:t.conf.update.getDisabled(o)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o)),{style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":m=>t.conf.update.form[o.key]=m,disabled:t.conf.update.getDisabled(o)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,m=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":m=>t.conf.update.form[o.key]=m},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o)),{disabled:t.conf.update.getDisabled(o)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(n.$slots,"table-"+o.key,{key:1,row:i,item:o},()=>[e.unref(B).customComponent[o.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[o.type??""]?.table),e.mergeProps({key:0,modelValue:i[o.key],"onUpdate:modelValue":m=>i[o.key]=m},{ref_for:!0},o.options?.[o.type??""],e.toHandlers(o.options?.[o.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):o.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:0,modelValue:i[o.key],"onUpdate:modelValue":m=>i[o.key]=m,loading:o.options?.switch?.loadingMap?.[i[t.option.table?.rowKey]]?.loading,"before-change":()=>o.options?.switch?.tableBeforeChange?.(o.key,i)},{ref_for:!0},o.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ne,e.toDisplayString(i[o.key]===o.options?.switch?.activeValue?o.options?.switch?.activeText:o.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":o.table?.click?.color}),class:e.normalizeClass({"table-text-click":o.table?.click?.callback}),onClick:m=>o.table?.click?.callback?.(i),innerHTML:o.table?.format?o.table?.format(i):i[o.key]},null,14,ae))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),re={class:"row form-item-content",style:{width:"100%"}},ie={class:"col column form-item-content-item"},de={class:"col"},ce=["innerHTML"],se=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(t){return(c,s)=>(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{label:t.item.item.text?.form?.label??t.item.item.label,prop:t.item.item.key,"label-width":t.item.item.text?.form?.label==""?0:t.item.item.form?.labelWidth||t.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.renderSlot(c.$slots,"form-"+t.item.item.key+"-start",{row:t.conf.update.form,item:t.item.item}),e.createElementVNode("div",ie,[e.createElementVNode("div",de,[e.renderSlot(c.$slots,"form-"+t.item.item.key,{row:t.conf.update.form,item:t.item.item},()=>[t.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[0]||(s[0]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):t.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[1]||(s[1]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):t.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[2]||(s[2]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.conf.update.getBind(t.item.item).data,n=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(p.ElRadioGroup),e.mergeProps({key:3,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[3]||(s[3]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.conf.update.getBind(t.item.item).data,n=>(e.openBlock(),e.createBlock(e.unref(p.ElRadio),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.item.item.type==="list"?(e.openBlock(),e.createBlock(N,e.mergeProps({key:4,row:t.conf.update.form,field:t.item.item.key},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:5,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[4]||(s[4]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:6,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[5]||(s[5]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):t.item.item.type&&(e.unref(B).customComponent[t.item.item.type]||e.unref(B).customComponent[t.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.item.item.type]?.form||e.unref(B).customComponent[t.item.item.type]),e.mergeProps({key:7,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":s[6]||(s[6]=n=>t.conf.update.form[t.item.item.key]=n)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(c.$slots,"form-"+t.item.item.key+"-right",{row:t.conf.update.form,item:t.item.item})]),e.renderSlot(c.$slots,"form-"+t.item.item.key+"-tip",{row:t.conf.update.form,item:t.item.item},()=>[t.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.item.form?.tipText=="function"?t.item.item.form?.tipText(t.conf.update.form,t.conf.update.type):t.item.item.form?.tipText},null,8,ce)):e.createCommentVNode("",!0)])]),e.renderSlot(c.$slots,"form-"+t.item.item.key+"-end",{row:t.conf.update.form,item:t.item.item})])]),_:3},8,["label","prop","label-width"]))}}),fe={key:0,class:"relative curd-search fit-width"},me={class:"mb-10 flex justify-between items-center fit-width"},pe={class:"flex items-center",style:{gap:"10px"}},ge={key:0},he={key:1},ye={key:2},ke={class:"export-btn"},be={key:1,class:"export-btn"},ue={class:"flex items-center table-tools-right",style:{gap:"10px"}},we={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Ce={class:"dialog-footer"},Be={class:"dialog-footer"},T=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(t,{expose:c}){const s=b.EDialog,n=t,r=b.isFun,{conf:a,switchConfirmRef:o,ruleFormRef:i}=W(n);return c({conf:a}),(m,f)=>{const g=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(p.ElForm),{model:e.unref(a).search.form,inline:"",size:t.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(a).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).search.column.list,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[(typeof l.show?.search=="function"?l.show?.search(e.unref(a).search.form):l.show?.search)?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0,label:l.text?.search?.label??l.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+l.key,{row:e.unref(a).search.form},()=>[l.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,placeholder:e.unref(a).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(p.ElSelect),e.mergeProps({key:1,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,placeholder:e.unref(a).search.getPlaceholder(l,e.unref(h).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(p.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(p.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(p.ElSelect),e.mergeProps({key:2,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,placeholder:e.unref(a).search.getPlaceholder(l,e.unref(h).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,d=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,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:4,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d},{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(a).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(a).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0},{default:e.withCtx(()=>[t.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(a).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,onClick:e.unref(a).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(a).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",me,[e.createElementVNode("div",pe,[e.unref(r)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:f[0]||(f[0]=l=>e.unref(a).update.open(e.unref(s).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(r)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",he,[e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:f[1]||(f[1]=l=>e.unref(a).remove.open(e.unref(a).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(p.ElButton),{type:"warning",onClick:f[2]||(f[2]=l=>e.unref(a).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(p.ElDropdown),{key:0,onCommand:e.unref(a).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(p.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(r)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",be,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:t.option.size?.search,onClick:f[3]||(f[3]=l=>e.unref(a).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",ue,[e.renderSlot(m.$slots,"tools-right"),e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":f[4]||(f[4]=l=>e.unref(a).page.num=l),"page-size":e.unref(a).page.size,"onUpdate:pageSize":f[5]||(f[5]=l=>e.unref(a).page.size=l),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:t.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:f[6]||(f[6]=(...l)=>e.unref(a).table.getList&&e.unref(a).table.getList(...l))},[e.createVNode(Z)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(p.ElTable),e.mergeProps({data:e.unref(a).table.data,border:t.option.table?.border===void 0?!0:t.option.table?.border,onSelectionChange:e.unref(a).table.selection.change,onSortChange:e.unref(a).table.sort.change,"expand-row-keys":e.unref(a).table.expand.rowKeys,onExpandChange:e.unref(a).table.expand.change},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(r)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(le,{conf:e.unref(a),columnList:e.unref(a).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(m.$slots,(l,d)=>({name:d,fn:e.withCtx(k=>[e.renderSlot(m.$slots,d,e.normalizeProps(e.guardReactiveProps(k||{})))])}))]),1032,["conf","columnList","option"]),e.unref(r)(t.option.table?.add)||e.unref(r)(t.option.table?.update)||e.unref(r)(t.option.table?.delete)||e.unref(r)(t.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:1,width:e.unref(a).table.op.width(e.unref(r)(t.option.table?.add),e.unref(r)(t.option.table?.update),e.unref(r)(t.option.table?.delete),e.unref(r)(t.option.table?.view),m.$slots["table-op-left"],m.$slots["table-op-right"]),align:"center",fixed:"right"},t.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:l})=>[e.createVNode(e.unref(p.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:l}),e.unref(a).update.type===e.unref(s).Update&&t.option.table?.inlineEdit&&e.unref(a).update.form[n.option.table?.rowKey]===l[n.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(p.ElButton),{link:"",type:"info",onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{link:"",type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).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(r)(t.option.table?.add,l)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,link:"",type:"primary",onClick:d=>e.unref(a).update.open(e.unref(s).Add,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(t.option.table?.view,l)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,link:"",type:"primary",onClick:d=>e.unref(a).update.open(e.unref(s).View,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(t.option.table?.update,l)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:2,link:"",type:"warning",onClick:d=>e.unref(a).update.open(e.unref(s).Update,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(t.option.table?.delete,l)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:3,link:"",type:"danger",onClick:d=>e.unref(a).remove.open([l])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:l})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[g,e.unref(a).table.loading]])],2)],2),e.createElementVNode("div",we,[(t.option.page?.show===void 0||t.option.page?.show)&&!e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":f[7]||(f[7]=l=>e.unref(a).page.num=l),"page-size":e.unref(a).page.size,"onUpdate:pageSize":f[8]||(f[8]=l=>e.unref(a).page.size=l),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:t.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(m.$slots,"box-right")],2),e.createVNode(e.unref(p.ElDialog),e.mergeProps({modelValue:e.unref(a).update.show,"onUpdate:modelValue":f[9]||(f[9]=l=>e.unref(a).update.show=l),title:e.unref(a).update.title,"before-close":e.unref(a).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Ce,[e.createVNode(e.unref(p.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(a).update.type!==e.unref(s).View?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(a).update.form,rules:e.unref(a).update.rules,size:t.option.size?.form},{default:e.withCtx(()=>[e.unref(a).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).update.formColumn,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)((()=>{const d=[],k=y=>{y?.item?.children?k(y.item.children):d.push(...y.map(w=>w.item?.show?.form))};return k(l),d})(),e.unref(a).update.form,e.unref(a).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:t.option.form?.stripe===void 0?!0:t.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(a).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)(d.item.show?.form,e.unref(a).update.form,e.unref(a).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([d.item.form.span>0?`col-${e.unref(a).getColumnSpan(d,l)}`:"col",`form-item-col-${d.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.item.children?d.children:[d],k=>(e.openBlock(),e.createBlock(se,{key:k.item.key,conf:e.unref(a),item:k},e.createSlots({_:2},[e.renderList(m.$slots,(y,w)=>({name:w,fn:e.withCtx(V=>[e.renderSlot(m.$slots,w,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(a).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(p.ElDialog),{modelValue:e.unref(a).remove.show,"onUpdate:modelValue":f[10]||(f[10]=l=>e.unref(a).remove.show=l),title:e.unref(a).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Be,[e.createVNode(e.unref(p.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(a).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:e.unref(a).remove.submit,loading:e.unref(a).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(a).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(Q,{ref_key:"switchConfirmRef",ref:o,size:t.option.size?.form},null,8,["size"])],2)}}});class Ve{static async download(c,s="download.png"){const n=document.createElement("a");n.style.display="none",n.href=c,n.setAttribute("download",s),typeof n.download>"u"&&n.setAttribute("target","_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(c)}static exportJSONFile=(c,s)=>{const n=new Blob([JSON.stringify(c)],{type:"application/json"}),r=URL.createObjectURL(n),a=document.createElement("a");a.href=r,a.download=`${s||"config"}.json`,a.click()};static importFile=async c=>new Promise((s,n)=>{const r=document.createElement("input");r.type="file";const a=c?.accept||".json";r.accept=a,r.style.display="none",r.onchange=o=>{const i=o.target.files[0];if(!i){b.fail("未选择文件"),n("未选择文件");return}const m=new FileReader;m.onload=async f=>{const g=a==".json"?JSON.parse(f.target.result):f.target.result;s(g)},m.onerror=()=>{b.fail("文件读取失败"),n("文件读取失败")},m.readAsText(i),document.body.removeChild(r)},document.body.appendChild(r),r.click()})}const U=(t,c)=>{if(t.component("TCurd",T),t.component("TFormList",N),t.component("TColumn",F),c?.customComponent){B.customComponent=c.customComponent;for(const s in c.customComponent)t.component(s,c.customComponent[s])}},Ee={install:U};C.ArrUtil=E,C.ExcelUtil=$,C.TColumn=F,C.TCurd=T,C.TFile=Ve,C.TForm=B,C.TFormConfig=u,C.TFormI18n=h,C.TFormList=N,C.TSys=b,C.default=Ee,C.install=U,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -77,7 +77,7 @@ declare const conf: {
|
|
|
77
77
|
change?: boolean | undefined;
|
|
78
78
|
confirm?: boolean | undefined;
|
|
79
79
|
loadList?: boolean | undefined;
|
|
80
|
-
api?: ((data: any) => any) | undefined;
|
|
80
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
81
81
|
} | undefined;
|
|
82
82
|
} | undefined;
|
|
83
83
|
select?: {
|
|
@@ -163,7 +163,7 @@ declare const conf: {
|
|
|
163
163
|
change?: boolean | undefined;
|
|
164
164
|
confirm?: boolean | undefined;
|
|
165
165
|
loadList?: boolean | undefined;
|
|
166
|
-
api?: ((data: any) => any) | undefined;
|
|
166
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
167
167
|
} | undefined;
|
|
168
168
|
} | undefined;
|
|
169
169
|
select?: {
|
|
@@ -249,7 +249,7 @@ declare const conf: {
|
|
|
249
249
|
change?: boolean | undefined;
|
|
250
250
|
confirm?: boolean | undefined;
|
|
251
251
|
loadList?: boolean | undefined;
|
|
252
|
-
api?: ((data: any) => any) | undefined;
|
|
252
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
253
253
|
} | undefined;
|
|
254
254
|
} | undefined;
|
|
255
255
|
select?: {
|
|
@@ -319,7 +319,7 @@ declare const conf: {
|
|
|
319
319
|
change?: boolean | undefined;
|
|
320
320
|
confirm?: boolean | undefined;
|
|
321
321
|
loadList?: boolean | undefined;
|
|
322
|
-
api?: ((data: any) => any) | undefined;
|
|
322
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
323
323
|
} | undefined;
|
|
324
324
|
} | undefined;
|
|
325
325
|
select?: {
|
|
@@ -499,7 +499,7 @@ declare var __VLS_7: {
|
|
|
499
499
|
change?: boolean | undefined;
|
|
500
500
|
confirm?: boolean | undefined;
|
|
501
501
|
loadList?: boolean | undefined;
|
|
502
|
-
api?: ((data: any) => any) | undefined;
|
|
502
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
503
503
|
} | undefined;
|
|
504
504
|
} | undefined;
|
|
505
505
|
select?: {
|
|
@@ -585,7 +585,7 @@ declare var __VLS_7: {
|
|
|
585
585
|
change?: boolean | undefined;
|
|
586
586
|
confirm?: boolean | undefined;
|
|
587
587
|
loadList?: boolean | undefined;
|
|
588
|
-
api?: ((data: any) => any) | undefined;
|
|
588
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
589
589
|
} | undefined;
|
|
590
590
|
} | undefined;
|
|
591
591
|
select?: {
|
|
@@ -671,7 +671,7 @@ declare var __VLS_7: {
|
|
|
671
671
|
change?: boolean | undefined;
|
|
672
672
|
confirm?: boolean | undefined;
|
|
673
673
|
loadList?: boolean | undefined;
|
|
674
|
-
api?: ((data: any) => any) | undefined;
|
|
674
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
675
675
|
} | undefined;
|
|
676
676
|
} | undefined;
|
|
677
677
|
select?: {
|
|
@@ -741,7 +741,7 @@ declare var __VLS_7: {
|
|
|
741
741
|
change?: boolean | undefined;
|
|
742
742
|
confirm?: boolean | undefined;
|
|
743
743
|
loadList?: boolean | undefined;
|
|
744
|
-
api?: ((data: any) => any) | undefined;
|
|
744
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
745
745
|
} | undefined;
|
|
746
746
|
} | undefined;
|
|
747
747
|
select?: {
|
|
@@ -899,7 +899,7 @@ declare var __VLS_7: {
|
|
|
899
899
|
change?: boolean | undefined;
|
|
900
900
|
confirm?: boolean | undefined;
|
|
901
901
|
loadList?: boolean | undefined;
|
|
902
|
-
api?: ((data: any) => any) | undefined;
|
|
902
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
903
903
|
} | undefined;
|
|
904
904
|
} | undefined;
|
|
905
905
|
select?: {
|
|
@@ -985,7 +985,7 @@ declare var __VLS_7: {
|
|
|
985
985
|
change?: boolean | undefined;
|
|
986
986
|
confirm?: boolean | undefined;
|
|
987
987
|
loadList?: boolean | undefined;
|
|
988
|
-
api?: ((data: any) => any) | undefined;
|
|
988
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
989
989
|
} | undefined;
|
|
990
990
|
} | undefined;
|
|
991
991
|
select?: {
|
|
@@ -1071,7 +1071,7 @@ declare var __VLS_7: {
|
|
|
1071
1071
|
change?: boolean | undefined;
|
|
1072
1072
|
confirm?: boolean | undefined;
|
|
1073
1073
|
loadList?: boolean | undefined;
|
|
1074
|
-
api?: ((data: any) => any) | undefined;
|
|
1074
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1075
1075
|
} | undefined;
|
|
1076
1076
|
} | undefined;
|
|
1077
1077
|
select?: {
|
|
@@ -1141,7 +1141,7 @@ declare var __VLS_7: {
|
|
|
1141
1141
|
change?: boolean | undefined;
|
|
1142
1142
|
confirm?: boolean | undefined;
|
|
1143
1143
|
loadList?: boolean | undefined;
|
|
1144
|
-
api?: ((data: any) => any) | undefined;
|
|
1144
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1145
1145
|
} | undefined;
|
|
1146
1146
|
} | undefined;
|
|
1147
1147
|
select?: {
|
|
@@ -1299,7 +1299,7 @@ declare var __VLS_7: {
|
|
|
1299
1299
|
change?: boolean | undefined;
|
|
1300
1300
|
confirm?: boolean | undefined;
|
|
1301
1301
|
loadList?: boolean | undefined;
|
|
1302
|
-
api?: ((data: any) => any) | undefined;
|
|
1302
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1303
1303
|
} | undefined;
|
|
1304
1304
|
} | undefined;
|
|
1305
1305
|
select?: {
|
|
@@ -1385,7 +1385,7 @@ declare var __VLS_7: {
|
|
|
1385
1385
|
change?: boolean | undefined;
|
|
1386
1386
|
confirm?: boolean | undefined;
|
|
1387
1387
|
loadList?: boolean | undefined;
|
|
1388
|
-
api?: ((data: any) => any) | undefined;
|
|
1388
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1389
1389
|
} | undefined;
|
|
1390
1390
|
} | undefined;
|
|
1391
1391
|
select?: {
|
|
@@ -1471,7 +1471,7 @@ declare var __VLS_7: {
|
|
|
1471
1471
|
change?: boolean | undefined;
|
|
1472
1472
|
confirm?: boolean | undefined;
|
|
1473
1473
|
loadList?: boolean | undefined;
|
|
1474
|
-
api?: ((data: any) => any) | undefined;
|
|
1474
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1475
1475
|
} | undefined;
|
|
1476
1476
|
} | undefined;
|
|
1477
1477
|
select?: {
|
|
@@ -1541,7 +1541,7 @@ declare var __VLS_7: {
|
|
|
1541
1541
|
change?: boolean | undefined;
|
|
1542
1542
|
confirm?: boolean | undefined;
|
|
1543
1543
|
loadList?: boolean | undefined;
|
|
1544
|
-
api?: ((data: any) => any) | undefined;
|
|
1544
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1545
1545
|
} | undefined;
|
|
1546
1546
|
} | undefined;
|
|
1547
1547
|
select?: {
|
|
@@ -1699,7 +1699,7 @@ declare var __VLS_7: {
|
|
|
1699
1699
|
change?: boolean | undefined;
|
|
1700
1700
|
confirm?: boolean | undefined;
|
|
1701
1701
|
loadList?: boolean | undefined;
|
|
1702
|
-
api?: ((data: any) => any) | undefined;
|
|
1702
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1703
1703
|
} | undefined;
|
|
1704
1704
|
} | undefined;
|
|
1705
1705
|
select?: {
|
|
@@ -1785,7 +1785,7 @@ declare var __VLS_7: {
|
|
|
1785
1785
|
change?: boolean | undefined;
|
|
1786
1786
|
confirm?: boolean | undefined;
|
|
1787
1787
|
loadList?: boolean | undefined;
|
|
1788
|
-
api?: ((data: any) => any) | undefined;
|
|
1788
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1789
1789
|
} | undefined;
|
|
1790
1790
|
} | undefined;
|
|
1791
1791
|
select?: {
|
|
@@ -1871,7 +1871,7 @@ declare var __VLS_7: {
|
|
|
1871
1871
|
change?: boolean | undefined;
|
|
1872
1872
|
confirm?: boolean | undefined;
|
|
1873
1873
|
loadList?: boolean | undefined;
|
|
1874
|
-
api?: ((data: any) => any) | undefined;
|
|
1874
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1875
1875
|
} | undefined;
|
|
1876
1876
|
} | undefined;
|
|
1877
1877
|
select?: {
|
|
@@ -1941,7 +1941,7 @@ declare var __VLS_7: {
|
|
|
1941
1941
|
change?: boolean | undefined;
|
|
1942
1942
|
confirm?: boolean | undefined;
|
|
1943
1943
|
loadList?: boolean | undefined;
|
|
1944
|
-
api?: ((data: any) => any) | undefined;
|
|
1944
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
1945
1945
|
} | undefined;
|
|
1946
1946
|
} | undefined;
|
|
1947
1947
|
select?: {
|
|
@@ -2099,7 +2099,7 @@ declare var __VLS_7: {
|
|
|
2099
2099
|
change?: boolean | undefined;
|
|
2100
2100
|
confirm?: boolean | undefined;
|
|
2101
2101
|
loadList?: boolean | undefined;
|
|
2102
|
-
api?: ((data: any) => any) | undefined;
|
|
2102
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2103
2103
|
} | undefined;
|
|
2104
2104
|
} | undefined;
|
|
2105
2105
|
select?: {
|
|
@@ -2185,7 +2185,7 @@ declare var __VLS_7: {
|
|
|
2185
2185
|
change?: boolean | undefined;
|
|
2186
2186
|
confirm?: boolean | undefined;
|
|
2187
2187
|
loadList?: boolean | undefined;
|
|
2188
|
-
api?: ((data: any) => any) | undefined;
|
|
2188
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2189
2189
|
} | undefined;
|
|
2190
2190
|
} | undefined;
|
|
2191
2191
|
select?: {
|
|
@@ -2271,7 +2271,7 @@ declare var __VLS_7: {
|
|
|
2271
2271
|
change?: boolean | undefined;
|
|
2272
2272
|
confirm?: boolean | undefined;
|
|
2273
2273
|
loadList?: boolean | undefined;
|
|
2274
|
-
api?: ((data: any) => any) | undefined;
|
|
2274
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2275
2275
|
} | undefined;
|
|
2276
2276
|
} | undefined;
|
|
2277
2277
|
select?: {
|
|
@@ -2341,7 +2341,7 @@ declare var __VLS_7: {
|
|
|
2341
2341
|
change?: boolean | undefined;
|
|
2342
2342
|
confirm?: boolean | undefined;
|
|
2343
2343
|
loadList?: boolean | undefined;
|
|
2344
|
-
api?: ((data: any) => any) | undefined;
|
|
2344
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2345
2345
|
} | undefined;
|
|
2346
2346
|
} | undefined;
|
|
2347
2347
|
select?: {
|
|
@@ -2615,7 +2615,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
2615
2615
|
change?: boolean | undefined;
|
|
2616
2616
|
confirm?: boolean | undefined;
|
|
2617
2617
|
loadList?: boolean | undefined;
|
|
2618
|
-
api?: ((data: any) => any) | undefined;
|
|
2618
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2619
2619
|
} | undefined;
|
|
2620
2620
|
} | undefined;
|
|
2621
2621
|
select?: {
|
|
@@ -2701,7 +2701,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
2701
2701
|
change?: boolean | undefined;
|
|
2702
2702
|
confirm?: boolean | undefined;
|
|
2703
2703
|
loadList?: boolean | undefined;
|
|
2704
|
-
api?: ((data: any) => any) | undefined;
|
|
2704
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2705
2705
|
} | undefined;
|
|
2706
2706
|
} | undefined;
|
|
2707
2707
|
select?: {
|
|
@@ -2787,7 +2787,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
2787
2787
|
change?: boolean | undefined;
|
|
2788
2788
|
confirm?: boolean | undefined;
|
|
2789
2789
|
loadList?: boolean | undefined;
|
|
2790
|
-
api?: ((data: any) => any) | undefined;
|
|
2790
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2791
2791
|
} | undefined;
|
|
2792
2792
|
} | undefined;
|
|
2793
2793
|
select?: {
|
|
@@ -2857,7 +2857,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
2857
2857
|
change?: boolean | undefined;
|
|
2858
2858
|
confirm?: boolean | undefined;
|
|
2859
2859
|
loadList?: boolean | undefined;
|
|
2860
|
-
api?: ((data: any) => any) | undefined;
|
|
2860
|
+
api?: ((data: any, type: "switch") => any) | undefined;
|
|
2861
2861
|
} | undefined;
|
|
2862
2862
|
} | undefined;
|
|
2863
2863
|
select?: {
|