cc1-form 1.1.26 → 1.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(u,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("element-plus"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue"],p):(u=typeof globalThis<"u"?globalThis:u||self,p(u.cc1Form={},u.ElementPlus,u.Vue))})(this,(function(u,p,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Insert:"Insert",Update:"Update",View:"View",Remove:"Remove"};static isFun=(i,...s)=>Array.isArray(i)?i.some(l=>typeof l=="function"?l(...s):l):typeof i=="function"?i(...s):i;static getRouterParams=()=>{const i=this.router.currentRoute.value.query||{},s=this.router.currentRoute.value.params||{};return Object.keys(i).length?i:Object.keys(s).length?s:{}};static moduleObj={};static loadModule=async i=>{if(!b.moduleObj[i])throw new Error(`模块${i}未加载,请赋值如:TSys.moduleObj = { ${i}: ()=>import('${i}') }`);const s=await b.moduleObj[i]();return s.default??s};static tipMessages={};static tipMessagesGap=500;static showMessage(i,s,l={}){const a=Date.now();if(!this.tipMessages[i]||a-this.tipMessages[i]>this.tipMessagesGap){this.tipMessages[i]=a;const t=Object.assign({message:i,type:s},l);p.ElMessage(t),setTimeout(()=>{delete this.tipMessages[i]},this.tipMessagesGap)}}static fail=(i,s={})=>{this.showMessage(i,"error",s)};static success=(i,s={})=>{this.showMessage(i,"success",s)};static loadingObj=null;static loadingTimer=null;static loading=(i=!0,s="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{i?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=(i,s=!0)=>{if(s){let l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(i,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}else window.open(i,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=i=>new Promise(async(s,l)=>{let a=document.getElementById(i.id);const t=await b.loadModule("html2canvas");try{t(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:i.windowWidth,height:i.windowHeight,windowWidth:i.windowWidth,windowHeight:i.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(n){let d=n.toDataURL("image/png");s(d)})}catch(n){l(n)}})}class y{static config={page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"},dialog:{width:"980px",closeOnClickModal:!1},tools:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,fileName:"Export Data "}},form:{stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{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}},columnConfig:{type:"input",form:{labelWidth:"100px",width:"100%"},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},options:{switch:{activeValue:!0,inactiveValue:!1},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=i=>{y.config=ObjectUtil.deepMerge(y.config,i)}}class B{static customComponent={};static findOptions=(i,s)=>{const l=i.column.find(t=>t.key===s),a=t=>t.replace(/-([a-z])/g,(n,d)=>d.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(i,s,l)=>{const a=B.findOptions(i,s);a&&(a.data=l)};static form={openBefore:{parentId:(i,s,l,a)=>{const t=y.config.table.rowKey;i?s.type===b.EDialog.Insert?(s.form.parentId=i[t],s.form.sort=i.children.length+1):s.form.parentId=i.parentId.substring(i.parentId.lastIndexOf(",")+1):(s.form.parentId="0",s.form.sort=l.length+1),B.setOptionsData(a,"parentId",[{[t]:"0",title:"根",children:l}])}}}}class E{static getIdFun=()=>StrUtil.uuid();static setId=(i,s,l)=>{s[i]||(s[i]=[]);const a=y.config.table.rowKey;s[i].forEach(t=>{l.forEach(n=>{let d=n.default??"";n.type==="number"&&(d=n.default??0),n.type==="boolean"&&(d=n.default??!1),n.type==="time"&&(d=n.default??new Date),t[n.value]===void 0&&(t[n.value]=d)}),t[a]||(t[a]=E.getIdFun())})};static add=(i,s,l,a)=>{const t=JSONUtil.cp(l);E.setId(i,s,l);const n=y.config.table.rowKey;s[i].push(t.reduce((d,m)=>{let h=m.default??"";return m.type==="number"&&(h=m.default??0),m.type==="boolean"&&(h=m.default??!1),m.type==="time"&&(h=m.default??new Date),d[m.value]=h,d},{[n]:E.getIdFun()})),a?.(s)};static remove=(i,s,l,a)=>{const t=y.config.table.rowKey;s[i]=s[i].filter(n=>n[t]!==l[t]),a?.(s)};static getNoIdData=(i,s)=>{const l=JSONUtil.cp(i),a=y.config.table.rowKey;return l.forEach(t=>{t[a]&&delete t[a],s&&t[s]&&E.getNoIdData(t[s],s)}),l}}const L={key:0,class:"column",style:{width:"100%",gap:"10px"}},I={class:"row items-center",style:{gap:"10px",width:"100%"}},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:""}},emits:["change"],setup(o,{emit:i}){const s=o,l=e.reactive({show:!1,add:(t,n,d)=>{E.add(t,n,d,()=>{a("change")})},remove:(t,n,d)=>{E.remove(t,n,d,()=>{a("change")})}});e.onMounted(()=>{E.setId(s.field,s.row,s.itemFields),l.show=!0});const a=i;return(t,n)=>{const d=e.resolveComponent("el-button"),m=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(t.$slots,"list-start",{row:o.row}),e.createElementVNode("div",null,[e.createVNode(d,{link:"",type:"primary",onClick:n[0]||(n[0]=h=>l.add(o.field,o.row,o.itemFields))},{default:e.withCtx(()=>[...n[2]||(n[2]=[e.createTextVNode("添加",-1)])]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.row[o.field],h=>(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"item-start",{item:h,row:o.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.itemFields,f=>(e.openBlock(),e.createBlock(m,{modelValue:h[f.value],"onUpdate:modelValue":r=>h[f.value]=r,style:e.normalizeStyle({width:o.inputWidth}),class:e.normalizeClass(o.inputClass),placeholder:f[o.label]||f[o.value],onChange:n[1]||(n[1]=r=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(t.$slots,"item-end",{item:h,row:o.row}),e.createVNode(d,{link:"",type:"danger",onClick:f=>l.remove(o.field,o.row,h)},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),e.renderSlot(t.$slots,"list-end",{row:o.row})])):e.createCommentVNode("",!0)}}}),M={class:"row curd-row"},D=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(o,{expose:i}){const s=b.isFun,l=b.EDialog,a=e.ref(),t=o,n=e.reactive({rules:{},show:!0,form:{},formDefault:{},formColumn:[],getDisabled:d=>d.disabled?.[(t.type||l.Insert)===l.Insert?"create":"update"],initColumnForm:async()=>{const d=t.option;n.formColumn=[];const m=[],h=t.option.form?.maxSpan||12,f=t.option.form?.defaultSpan||h;let r=[];const c=g=>{if(n.formDefault[g.key]=g.value,g.isForm){g.form=g.form||{span:f},g.form.span=g.form.span??f;let w=g.form.span,C=r.reduce((x,Ce)=>x+Ce.span,w);const V=r.length;r.push({item:g,span:w}),(V===1&&r[0].span===0||C>=h||w===0&&V>1)&&(m.push(r),r=[]),g.rules&&(n.rules[g.key]=g.rules)}};d.column.forEach(g=>{g.isForm=!0,c(g)}),r.length>0&&m.push(r),n.formColumn=m,n.form=JSONUtil.cp(n.formDefault)},init:async()=>{n.show=!1,await e.nextTick(),n.initColumnForm()}});return n.initColumnForm(),i({ref:a,conf:n}),(d,m)=>(e.openBlock(),e.createBlock(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:a,model:n.form,rules:n.rules},{default:e.withCtx(()=>[n.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.formColumn,h=>(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(d.$slots,"form-start",{row:n.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s)(f.item.show?.form,n.form)??!0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.item.form.span>0?`col-${f.item.form.span}`:"col")},[e.createVNode(e.unref(p.ElFormItem),{label:f.item.label,prop:f.item.key,"label-width":f.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"form-"+f.item.key+"-start",{row:n.form,item:f.item}),e.renderSlot(d.$slots,"form-"+f.item.key,{row:n.form,item:f.item},()=>[f.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.input,e.toHandlers(f.item.options?.input?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.switch,e.toHandlers(f.item.options?.switch?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.select,e.toHandlers(f.item.options?.select?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.select?.data,r=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="list"?(e.openBlock(),e.createBlock(N,e.mergeProps({key:3,row:n.form,field:f.item.key},{ref_for:!0},f.item.options?.list,e.toHandlers(f.item.options?.list?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):f.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:4,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.treeSelect,e.toHandlers(f.item.options?.treeSelect?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:5,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.datetime,e.toHandlers(f.item.options?.datetime?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type&&e.unref(B).customComponent[f.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[f.item.type]),e.mergeProps({key:6,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.[f.item.type],e.toHandlers(f.item.options?.[f.item.type]?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(d.$slots,"form-"+f.item.key+"-end",{row:n.form,item:f.item})]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(d.$slots,"form-end",{row:n.form})]))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});function Ve(o){return o}const j={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 k{static t(i,...s){if(typeof i=="function")return i(...s);i=String(i);let l=0;return i.replace(/{([^}]+)}/g,(a,t)=>l<s.length?String(s[l++]):`{${t}}`)}static setI18n=i=>{k.curd=ObjectUtil.deepMerge(k.curd,i)};static tCurd(i,...s){return this.t(this.curd[i],...s)}static curd=j}class F{static exportToExcel=async(i,s,l)=>{if(!i||i.length===0)return;const a=await b.loadModule("xlsx"),t=i.map(m=>{const h={};return s.forEach(f=>{h[f.label]=m[f.key]}),h}),n=a.utils.json_to_sheet(t),d=a.utils.book_new();a.utils.book_append_sheet(d,n,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(d,`${l}.xlsx`)}}const S=b.EDialog,z=o=>{const i=e.ref(),s=e.ref(),l=e.reactive({search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(a,t=k.tCurd("placeholderInput"))=>a.text?.search?.placeholder===void 0?`${t}${a.label}`:a.text?.search?.placeholder,getFormData:()=>{let a={};o.option.column.forEach(n=>{(typeof n.show?.search=="function"?n.show?.search(l.search.form):n.show?.search)&&(a[n.key]=l.search.form[n.key])});const t=o.option.search?.before?.(a);return t&&(a=t),a},reset:()=>{const a=l.search.formDefault;Object.keys(a).forEach(t=>{o.option.search?.resetMode==="none"?a[t]=void 0:a[t]=l.search.formDefault[t]}),l.search.form=JSONUtil.cp(a),l.page.num=1,o.option.init!==!1&&l.table.getList()},submit:()=>{l.page.num=1,l.table.getList()}},page:{size:o.option.page?.size||10,sizeList:o.option.page?.sizeList||[10,20,50,100],num:1,total:0,layout:o.option.page?.layout||"total, sizes, prev, pager, next, jumper"},table:{op:{width:(...a)=>a.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(a,t)=>{},all:()=>{if(l.table.expand.isExpand)l.table.expand.rowKeys=[];else{const a=t=>{let n=[];return t.forEach(d=>{n.push(d[o.option.table.rowKey]),d.children&&d.children.length>0&&(n=n.concat(a(d.children)))}),n};l.table.expand.rowKeys=a(l.table.data)}l.table.expand.isExpand=!l.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{l.table.loading=!0;const a=o.option.api.list;try{await l.initApiData("init");let t={};if(l.table.sort.prop){const{props:c,order:g}=y.config.table.sort;t={[c.field]:l.table.sort.prop,[g.field]:l.table.sort.order}}const n=await a({[y.config.page.size]:l.page.size,[y.config.page.num]:l.page.num,...l.search.getFormData(),...t}),d=y.config.result,m=n.data||{[d.list]:n};let h=(Array.isArray(m[d.list]),m[d.list]);const f=l.update.formColumn.flat(),r=JSONUtil.cp(h).map(c=>(Object.keys(c).forEach(w=>{const C=f.find(V=>V.item.key===w);C&&["select","radio"].includes(C.item.type)&&(C.item.table.format||(C.item.table.format=V=>C.item.options[C.item.type].data?.find(x=>x.value==V[w])?.label||V[w]))}),c));l.table.data=o.option.data?await o.option.data(r,h):r,l.page.total=m[d.total]||0}catch(t){console.error(t)}finally{l.table.loading=!1}},selection:{list:[],change:a=>{l.table.selection.list=a}},sort:{prop:"",order:"",change:a=>{y.config.table.sort.resetPage&&(l.page.num=1);const t=y.config.table.sort;if(t.change){t.change(a,l);return}l.table.sort.prop=a.prop,a.order===null?l.table.sort.order="":l.table.sort.order=a.order==="ascending"?t.order.asc:t.order.desc,l.table.getList()}}},export:{run:{start:async a=>{let t=await l.export.run[a](),n=o.option.column;const d=JSONUtil.cp({data:t,columns:n}),m=o.option.tools?.export||{};m.before&&m.before(d),F.exportToExcel(d.data,d.columns,m.fileName)},select:()=>{if(l.table.selection.list.length===0)throw b.fail(k.tCurd("selectDataToExport")),new Error(k.tCurd("selectDataToExport"));return l.table.selection.list},page:()=>{if(l.table.data.length===0)throw b.fail(k.tCurd("noData")),new Error(k.tCurd("noData"));return l.table.data},all:async()=>{l.export.loading=!0;try{if(o.option.tools?.export?.all){await o.option.tools?.export?.all({[y.config.page.size]:l.page.size,[y.config.page.num]:l.page.num,...l.search.getFormData()});return}const a=o.option.api.list,t=await a({[y.config.page.size]:999999,[y.config.page.num]:1});return(t.data||{[y.config.result.list]:t})[y.config.result.list]}catch(a){console.error(a)}finally{l.export.loading=!1}}},loading:!1,click:a=>{l.export.loading||l.export.run.start(a)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:S.Insert,form:{},formDefault:{},formColumn:[],getDisabled:a=>l.update.type===S.View?!0:a.disabled?.[l.update.type===S.Insert?"create":"update"],edit:{data:{},getApiData:a=>{if(o.option.form?.editAll)return a;let t={[o.option.table?.rowKey]:l.update.edit.data[o.option.table?.rowKey]};return Object.keys(l.update.edit.data).forEach(n=>{a[n]!==l.update.edit.data[n]&&(t[n]=a[n])}),t}},view:{},open:(a,t)=>{l.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{await l.initApiData("update");const n=a===S.Insert;if(!n&&o.option.table?.inlineEdit){l.inlineEdit.open(t);return}l.update.type=a,l.update.edit.data=t,l.update.title=k.tCurd(n?"add":a===S.View?"view":"edit"),l.update.form=JSONUtil.cp(n?l.update.formDefault:t),await o.option.form?.openBefore?.(t,l.update),l.update.show=!0,l.update.showContent=!0,o.option.form?.openAfter?.(t,l.update)}catch(n){console.error(n)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await s.value?.validate(async(d,m)=>new Promise((h,f)=>{d||(b.fail(k.tCurd("checkFormData")),f(!1)),h()})),l.update.loading=!0;const a=l.update.type===S.Insert?o.option.api.create:o.option.api.update;let t=JSONUtil.cp(l.update.form);delete t.children,await o.option.form?.submitBefore?.(t,l.update);const n=new Set(o.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(t).forEach(d=>{if(n.has(d)&&t[d]!=null){const m=new Date(t[d]).getTime();isNaN(m)||(t[d]=m)}});try{if(!a)return;await a({...t}),l.update.close(),await l.table.getList(),o.option.form?.submitAfter?.(t,l.update)}catch(d){console.error(d)}finally{l.update.loading=!1}})},close:()=>{l.update.show=!1,setTimeout(()=>{l.update.showContent=!1},350)}},inlineEdit:{row:null,form:{},loading:!1,open:a=>{l.inlineEdit.row=a,l.inlineEdit.form=JSONUtil.cp(a)},close:()=>{l.inlineEdit.row=null,l.inlineEdit.form={}},submit:()=>{FunUtil.throttle(async()=>{l.inlineEdit.loading=!0;const a=o.option.api.update;let t=JSONUtil.cp(l.inlineEdit.form);delete t.children;try{if(!a)return;await a({...t}),l.inlineEdit.close(),await l.table.getList(),b.success(k.tCurd("operationSuccess"))}catch(n){console.error(n)}finally{l.inlineEdit.loading=!1}})}},remove:{title:k.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{l.remove.show=!1},open:a=>{if(a.length===0){b.fail(k.tCurd("selectDataToDelete"));return}l.remove.items=a,l.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{l.remove.loading=!0;const a=o.option.api.delete;try{if(!a)return;await a({[o.option.table?.rowKey]:l.remove.items.map(t=>t[o.option.table?.rowKey]),items:l.remove.items}),b.success(k.tCurd("operationSuccess")),l.table.data.length<=1&&l.page.num>1&&(l.page.num-=1),l.remove.close(),await l.table.getList()}catch(t){console.error(t)}finally{l.remove.loading=!1}})}},init:()=>{l.initCurdConfig(),l.initColumnOptions(),l.initColumnForm()},apiDataMap:{},initApiData:async a=>{const t=[],n=d=>{if(d.children&&d.children.length){d.children.forEach(m=>n(m));return}if(d.type==="select"&&d.options?.select?.dataApi&&d.options?.select?.dataApiConfig?.[a]){if(l.apiDataMap[d.key]&&d.options?.select?.dataApiConfig?.once)return;const m=(async()=>{try{let h=await d.options?.select?.dataApi?.();if(h){const f=d.options?.select?.dataPath;f&&(h=ObjectUtil.getPathValue(h,f)),d.options.select.data=h,l.apiDataMap[d.key]=h}}catch{}})();t.push(m)}};return o.option.column.forEach(d=>{n(d)}),await Promise.all(t),!0},initCurdConfig:()=>{const a=JSONUtil.cp(y.config);a.table.emptyText=k.tCurd("noData");const t=ObjectUtil.deepMerge(a,o.option||{});Object.keys(t).forEach(n=>{o.option[n]=t[n]})},initColumnOptions:()=>{let a=JSONUtil.cp(y.config.columnConfig);a.options=ObjectUtil.deepMerge(a.options,{switch:{activeLabel:k.tCurd("switchOn"),inactiveLabel:k.tCurd("switchOff")}});const t=n=>{if(n.table=ObjectUtil.deepMerge(a.table,n.table||{}),n.children){n.children.forEach(d=>{t(d)});return}n.options=ObjectUtil.deepMerge(a.options,n.options||{}),n.form=ObjectUtil.deepMerge(a.form,n.form||{}),n.show=ObjectUtil.deepMerge(a.show,n.show||{}),n.sort=ObjectUtil.deepMerge(a.sort,n.sort||{}),n.type=n.type||a.type,n.type==="switch"&&(n.options.switch.tableBeforeChange=async(d,m)=>{const h=n.options?.switch;try{await i.value?.open({title:k.tCurd("confirmModify"),content:k.tCurd("confirmSwitchMessage")}),l.table.loading=!0;try{return o.option.api.update?(await o.option.api.update({[o.option.table?.rowKey]:m[o.option.table?.rowKey],[d]:m[d]===h.activeValue?h.inactiveValue:h.activeValue,final(f,r,c){l.table.loading=!1}}),l.table.loading=!1,b.success(k.tCurd("operationSuccess")),l.table.getList(),!0):void 0}catch(f){return console.error(f),!1}finally{l.table.loading=!1}}catch{return!1}}),n.type==="tree-select"&&(n.options.treeSelect.rowKey=o.option.table?.rowKey,n.options.treeSelect.nodeKey=o.option.table?.rowKey)};o.option.column.forEach(t),o.option.table?.column?.forEach(t)},initColumnForm:()=>{const a=o.option;l.update.formColumn=[],l.table.column.show={list:[],listSource:[]};const t=[],n=o.option.form?.maxSpan||12,d=o.option.form?.defaultSpan||n/2;let m=[];const h=c=>{if(c.children){l.table.column.show.list.push(c.key),c.children.forEach(g=>{h(g)});return}if(l.update.formDefault[c.key]=c.value,c.table.table&&(c.show.table&&l.table.column.show.list.push(c.key),c.table.table&&l.table.column.show.listSource.push(c.key)),c.isForm){c.form=c.form||{span:d},c.form.span=c.form.span??d;let g=c.form.span,w=m.reduce((V,x)=>V+x.span,g);const C=m.length;if(m.push({item:c,span:g}),(C===1&&m[0].span===0||w>=n||g===0&&C>1)&&(t.push(m),m=[]),c.rules){const V={input:k.tCurd("placeholderInput"),select:k.tCurd("placeholderSelect")},x=(V[c.type]||V.input)+c.label;l.update.rules[c.key]=typeof c.rules=="boolean"?[{required:!0,message:x,trigger:"blur"}]:c.rules}}},f=(c,g)=>{c.isForm=g,Array.isArray(c.children)&&c.children.forEach(w=>f(w,g))};a.column.forEach(c=>{c.isForm=!0,f(c,!0),h(c)}),o.option.table?.column?.forEach(c=>{f(c,!1),h(c)}),l.search.column.list=a.column.concat(a.table?.column||[]),l.table.column.list=l.search.column.list.filter(c=>c.table?.table),l.search.column.list.sort((c,g)=>c.sort?.search-g.sort?.search),l.table.column.list.sort((c,g)=>c.sort?.table-g.sort?.table),m.length>0&&t.push(m),l.update.formColumn=t;const r=o.option.search?.formDefault;r&&Object.keys(r).forEach(c=>{l.search.formDefault[c]=r[c]}),a.column.forEach(c=>{c.show?.search||(l.search.formDefault[c.key]=void 0)}),l.search.form=JSONUtil.cp(l.search.formDefault)}});return l.init(),e.onMounted(()=>{o.option.init!==!1&&l.table.getList()}),{conf:l,switchConfirmRef:i,ruleFormRef:s}},A={class:"dialog-footer"},R=e.defineComponent({__name:"switchConfirm",setup(o,{expose:i}){const s=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let t=null,n=null;const d=f=>(f?.title&&(l.value=f.title),f?.content&&(a.value=f.content),s.value=!0,new Promise((r,c)=>{t=r,n=c})),m=()=>{s.value=!1,t?.(!0),t=null,n=null},h=()=>{s.value=!1,n?.(new Error("用户取消操作")),t=null,n=null};return i({open:d}),(f,r)=>(e.openBlock(),e.createBlock(e.unref(p.ElDialog),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=c=>s.value=c),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createElementVNode("span",A,[e.createVNode(e.unref(p.ElButton),{onClick:h},{default:e.withCtx(()=>[...r[1]||(r[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:m},{default:e.withCtx(()=>[...r[2]||(r[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"]))}}),U=(o,i)=>{const s=o.__vccOpts||o;for(const[l,a]of i)s[l]=a;return s},H={},K={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function J(o,i){return e.openBlock(),e.createElementBlock("svg",K,[...i[0]||(i[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 W=U(H,[["render",J]]),q={},G={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(o,i){return e.openBlock(),e.createElementBlock("svg",G,[...i[0]||(i[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 Q=U(q,[["render",X]]),Y={class:"row flex-center table-header-label inline"},Z={class:"table-header-tooltip"},P=["onClick"],_=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(o){const i=b.isFun,s=e.getCurrentInstance().type;return(l,a)=>{const t=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.key},[o.conf.table.column.show.list.includes(n.key)?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,prop:n.key,label:n.label},{ref_for:!0},n.table),{header:e.withCtx(()=>[e.renderSlot(l.$slots,"table-header-"+n.key,{item:n},()=>[e.createElementVNode("div",Y,[n.table?.tooltip?(e.openBlock(),e.createBlock(t,{key:0,effect:"dark",content:n.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",Z,[e.createVNode(Q)])]),_:1},8,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)])])]),default:e.withCtx(({row:d})=>[n.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode("   ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),{conf:o.conf,columnList:n.children,option:o.option},e.createSlots({_:2},[e.renderList(l.$slots,(m,h)=>({name:h,fn:e.withCtx(f=>[e.renderSlot(l.$slots,h,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(n.show?.form,o.conf.inlineEdit.form,e.unref(b).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.inlineEdit.row===d&&(n.type==="input"||n.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.conf.inlineEdit.form[n.key],"onUpdate:modelValue":m=>o.conf.inlineEdit.form[n.key]=m},{ref_for:!0},n.options?.input,{size:"small",style:{width:"100%"},onKeyup:e.withKeys(o.conf.inlineEdit.submit,["enter"])}),null,16,["modelValue","onUpdate:modelValue","onKeyup"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:o.conf.inlineEdit.form[n.key],"onUpdate:modelValue":m=>o.conf.inlineEdit.form[n.key]=m},{ref_for:!0},n.options?.select,{size:"small",style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.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"])):e.createCommentVNode("",!0)],64)):e.renderSlot(l.$slots,"table-"+n.key,{key:1,row:d,item:n},()=>[n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:0,modelValue:d[n.key],"onUpdate:modelValue":m=>d[n.key]=m,"before-change":()=>n.options?.switch?.tableBeforeChange?.(n.key,d)},{ref_for:!0},n.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({"--table-text-click-color":n.table?.click?.color}),class:e.normalizeClass({"table-text-click":n.table?.click?.callback}),onClick:m=>n.table?.click?.callback?.(d)},e.toDisplayString(n.table?.format?n.table?.format(d):d[n.key]),15,P))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),$=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(o){return(i,s)=>{const l=e.resolveComponent("el-radio"),a=e.resolveComponent("el-radio-group");return o.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[0]||(s[0]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.input,e.toHandlers(o.item.item.options?.input?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[1]||(s[1]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.switch,{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[2]||(s[2]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.select,e.toHandlers(o.item.item.options?.select?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.item.item.options?.select?.data,t=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):o.item.item.type==="radio"?(e.openBlock(),e.createBlock(a,e.mergeProps({key:3,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[3]||(s[3]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.radio,e.toHandlers(o.item.item.options?.radio?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.item.item.options?.radio?.data,t=>(e.openBlock(),e.createBlock(l,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):o.item.item.type==="list"?(e.openBlock(),e.createBlock(N,e.mergeProps({key:4,row:o.conf.update.form,field:o.item.item.key},o.item.item.options?.list,e.toHandlers(o.item.item.options?.list?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):o.item.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:5,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[4]||(s[4]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.treeSelect,e.toHandlers(o.item.item.options?.treeSelect?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):o.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:6,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[5]||(s[5]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.datetime,e.toHandlers(o.item.item.options?.datetime?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type&&e.unref(B).customComponent[o.item.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[o.item.item.type]),e.mergeProps({key:7,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[6]||(s[6]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.[o.item.item.type],e.toHandlers(o.item.item.options?.[o.item.item.type]?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}}),v={class:"col relative cc1-form-box"},ee={class:"absolute row fit",style:{overflow:"hidden"}},te={class:"col column fit-width no-wrap"},oe={key:0,class:"relative curd-search fit-width"},le={class:"mb-10 flex justify-between items-center fit-width"},ne={class:"flex items-center",style:{gap:"10px"}},ae={key:0},re={key:1},ie={key:2},se={class:"export-btn"},ce={class:"flex items-center",style:{gap:"10px"}},de={class:"col fit-width relative form-box"},fe={class:"absolute column fit form-box-content"},me={class:"row justify-end mt-10 mb-10"},pe={class:"row form-item-content",style:{width:"100%"}},he={class:"col"},ge={class:"row form-item-content",style:{width:"100%"}},ke={class:"col"},be={class:"dialog-footer"},ye={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(o,{expose:i}){const s=b.EDialog,l=o,a=b.isFun,{conf:t,switchConfirmRef:n,ruleFormRef:d}=z(l);return i({conf:t}),(m,h)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",ee,[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",te,[o.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",oe,[e.createVNode(e.unref(p.ElForm),{model:e.unref(t).search.form,inline:""},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(t).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).search.column.list,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.key},[(typeof r.show?.search=="function"?r.show?.search(e.unref(t).search.form):r.show?.search)?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0,label:typeof r.text?.search?.label=="string"?r.text?.search?.label:r.label,class:e.normalizeClass({"hide-label":typeof r.text?.search?.label=="boolean"?!r.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+r.key,{row:e.unref(t).search.form},()=>[r.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c,placeholder:e.unref(t).search.getPlaceholder(r),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.input,e.toHandlers(r.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c,placeholder:e.unref(t).search.getPlaceholder(r,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.switch,e.toHandlers(r.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.options?.switch?.activeValue,label:r.options?.switch?.activeLabel,value:r.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.options?.switch?.inactiveValue,label:r.options?.switch?.inactiveLabel,value:r.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c,placeholder:e.unref(t).search.getPlaceholder(r,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.select,e.toHandlers(r.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options?.select?.data,c=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c},{ref_for:!0},r.options?.datetime,e.toHandlers(r.options?.datetime?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.type&&e.unref(B).customComponent[r.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[r.type]),e.mergeProps({key:4,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c},{ref_for:!0},r.options?.[r.type],e.toHandlers(r.options?.[r.type]?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+r.key+"-right",{row:e.unref(t).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(t).search.form}),o.option.tools?.search||o.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0},{default:e.withCtx(()=>[o.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(t).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),o.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,onClick:e.unref(t).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(t).search.form})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createElementVNode("div",ne,[e.unref(a)(o.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:h[0]||(h[0]=r=>e.unref(t).update.open(e.unref(s).Insert))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.table?.selectable&&e.unref(a)(o.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:h[1]||(h[1]=r=>e.unref(t).remove.open(e.unref(t).table.selection.list))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(p.ElButton),{type:"warning",onClick:h[2]||(h[2]=r=>e.unref(t).table.expand.all())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("expandCollapse")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(p.ElDropdown),{key:3,onCommand:e.unref(t).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(p.ElDropdownMenu),null,{default:e.withCtx(()=>[o.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(p.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportAll")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(t).export.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",ce,[e.renderSlot(m.$slots,"tools-right"),o.option.tools?.refresh===void 0||o.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:0,class:"refresh-btn",onClick:h[3]||(h[3]=(...r)=>e.unref(t).table.getList&&e.unref(t).table.getList(...r))},[e.createVNode(W)])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",de,[e.createElementVNode("div",fe,[e.withDirectives((e.openBlock(),e.createBlock(e.unref(p.ElTable),e.mergeProps({data:e.unref(t).table.data,border:o.option.table?.border===void 0?!0:o.option.table?.border,onSelectionChange:e.unref(t).table.selection.change,onSortChange:e.unref(t).table.sort.change,"expand-row-keys":e.unref(t).table.expand.rowKeys,onExpandChange:e.unref(t).table.expand.change},o.option.table,e.toHandlers(o.option.table?.on||{})),{default:e.withCtx(()=>[o.option.table?.selectable||e.unref(a)(o.option.tools?.delete)||o.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),{key:0,type:"selection",selectable:typeof o.option.table?.selectable=="function"?o.option.table?.selectable:void 0,width:"55"},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(_,{conf:e.unref(t),columnList:e.unref(t).table.column.list,option:o.option},e.createSlots({_:2},[e.renderList(m.$slots,(r,c)=>({name:c,fn:e.withCtx(g=>[e.renderSlot(m.$slots,c,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(o.option.table?.add)||e.unref(a)(o.option.table?.update)||e.unref(a)(o.option.table?.delete)||e.unref(a)(o.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(t).table.op.width(e.unref(a)(o.option.table?.add),e.unref(a)(o.option.table?.update),e.unref(a)(o.option.table?.delete),e.unref(a)(o.option.table?.view),m.$slots["table-op-left"],m.$slots["table-op-right"]),align:"center",fixed:"right"},o.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("operation")),1)])]),default:e.withCtx(({row:r})=>[e.renderSlot(m.$slots,"table-op-left",{row:r}),o.option.table?.inlineEdit&&e.unref(t).inlineEdit.row===r?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(p.ElButton),{link:"",type:"info",onClick:e.unref(t).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{link:"",type:"primary",onClick:e.unref(t).inlineEdit.submit,loading:e.unref(t).inlineEdit.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:r})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(o.option.table?.add,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,link:"",type:"primary",onClick:c=>e.unref(t).update.open(e.unref(s).Insert,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.view,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,link:"",type:"primary",onClick:c=>e.unref(t).update.open(e.unref(s).View,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.update,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:2,link:"",type:"warning",onClick:c=>e.unref(t).update.open(e.unref(s).Update,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.delete,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:3,link:"",type:"danger",onClick:c=>e.unref(t).remove.open([r])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:r})],64))]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[f,e.unref(t).table.loading]])])]),e.createElementVNode("div",me,[o.option.page?.show===void 0||o.option.page?.show?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),{key:0,"current-page":e.unref(t).page.num,"onUpdate:currentPage":h[4]||(h[4]=r=>e.unref(t).page.num=r),"page-size":e.unref(t).page.size,"onUpdate:pageSize":h[5]||(h[5]=r=>e.unref(t).page.size=r),background:"","page-sizes":e.unref(t).page.sizeList,"pager-count":7,layout:e.unref(t).page.layout,total:e.unref(t).page.total,onSizeChange:e.unref(t).table.getList,onCurrentChange:e.unref(t).table.getList},null,8,["current-page","page-size","page-sizes","layout","total","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])]),e.renderSlot(m.$slots,"box-right")]),e.createVNode(e.unref(p.ElDialog),e.mergeProps({modelValue:e.unref(t).update.show,"onUpdate:modelValue":h[6]||(h[6]=r=>e.unref(t).update.show=r),title:e.unref(t).update.title,"before-close":e.unref(t).update.close},o.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",be,[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(t).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(t).update.type!==e.unref(s).View?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(t).update.submit,loading:e.unref(t).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:d,model:e.unref(t).update.form,rules:e.unref(t).update.rules},{default:e.withCtx(()=>[e.unref(t).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t).update.formColumn,r=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(()=>{const c=[],g=w=>{if(w.children)return g(w.children);c.push(...w.map(C=>C.item.show?.form))};return g(r),c},e.unref(t).update.form,e.unref(t).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:o.option.form?.stripe===void 0?!0:o.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(t).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(c.item.show?.form,e.unref(t).update.form)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(c.item.form.span>0?`col-${c.item.form.span}`:"col")},[c.item.children?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.children,g=>(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{class:e.normalizeClass({"hide-label":typeof g.item.text?.form?.label=="boolean"?!g.item.text?.form?.label:!1}),label:typeof g.item.text?.form?.label=="string"?g.item.text?.form?.label:g.item.label,prop:g.item.key,"label-width":g.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.renderSlot(m.$slots,"form-"+g.item.key+"-start",{row:e.unref(t).update.form,item:g.item}),e.createElementVNode("div",he,[e.renderSlot(m.$slots,"form-"+g.item.key,{row:e.unref(t).update.form,item:g.item},()=>[e.createVNode($,{conf:e.unref(t),item:c},null,8,["conf","item"])]),e.renderSlot(m.$slots,"form-"+g.item.key+"-right",{row:e.unref(t).update.form,item:g.item})]),e.renderSlot(m.$slots,"form-"+g.item.key+"-end",{row:e.unref(t).update.form,item:g.item})])]),_:2},1032,["class","label","prop","label-width"]))),256)):(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:1,class:e.normalizeClass({"hide-label":typeof c.item.text?.form?.label=="boolean"?!c.item.text?.form?.label:!1}),label:typeof c.item.text?.form?.label=="string"?c.item.text?.form?.label:c.item.label,prop:c.item.key,"label-width":c.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.renderSlot(m.$slots,"form-"+c.item.key+"-start",{row:e.unref(t).update.form,item:c.item}),e.createElementVNode("div",ke,[e.renderSlot(m.$slots,"form-"+c.item.key,{row:e.unref(t).update.form,item:c.item},()=>[e.createVNode($,{conf:e.unref(t),item:c},null,8,["conf","item"])]),e.renderSlot(m.$slots,"form-"+c.item.key+"-right",{row:e.unref(t).update.form,item:c.item})]),e.renderSlot(m.$slots,"form-"+c.item.key+"-end",{row:e.unref(t).update.form,item:c.item})])]),_:2},1032,["class","label","prop","label-width"]))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(t).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(p.ElDialog),{modelValue:e.unref(t).remove.show,"onUpdate:modelValue":h[7]||(h[7]=r=>e.unref(t).remove.show=r),title:e.unref(t).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",ye,[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(t).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:e.unref(t).remove.submit,loading:e.unref(t).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(k).tCurd("confirmDeleteMessage",e.unref(t).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(R,{ref_key:"switchConfirmRef",ref:n},null,512)])}}});class ue{static async download(i,s="download.png"){const l=document.createElement("a");l.style.display="none",l.href=i,l.setAttribute("download",s),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(i)}static exportJSONFile=(i,s)=>{const l=new Blob([JSON.stringify(i)],{type:"application/json"}),a=URL.createObjectURL(l),t=document.createElement("a");t.href=a,t.download=`${s||"config"}.json`,t.click()};static importFile=async i=>new Promise((s,l)=>{const a=document.createElement("input");a.type="file";const t=i?.accept||".json";a.accept=t,a.style.display="none",a.onchange=n=>{const d=n.target.files[0];if(!d){b.fail("未选择文件"),l("未选择文件");return}const m=new FileReader;m.onload=async h=>{const f=t==".json"?JSON.parse(h.target.result):h.target.result;s(f)},m.onerror=()=>{b.fail("文件读取失败"),l("文件读取失败")},m.readAsText(d),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const T=(o,i)=>{if(o.component("TCurd",O),o.component("TFormList",N),o.component("TColumn",D),i?.customComponent){B.customComponent=i.customComponent;for(const s in i.customComponent)o.component(s,i.customComponent[s])}},we={install:T};u.ArrUtil=E,u.ExcelUtil=F,u.TColumn=D,u.TCurd=O,u.TFile=ue,u.TForm=B,u.TFormConfig=y,u.TFormI18n=k,u.TFormList=N,u.TSys=b,u.default=we,u.install=T,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(u,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):(u=typeof globalThis<"u"?globalThis:u||self,m(u.cc1Form={},u.ElementPlus,u.VueRouter,u.Vue))})(this,(function(u,m,Se,e){"use strict";class y{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Insert:"Insert",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...d)=>Array.isArray(n)?n.some(o=>typeof o=="function"?o(...d):o):typeof n=="function"?n(...d):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},d=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(d).length?d:{}};static moduleObj={};static loadModule=async n=>{if(!y.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const d=await y.moduleObj[n]();return d.default??d};static tipMessages={};static tipMessagesGap=500;static showMessage(n,d,o={}){const r=Date.now();if(!this.tipMessages[n]||r-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=r;const t=Object.assign({message:n,type:d},o);m.ElMessage(t),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,d={})=>{this.showMessage(n,"error",d)};static success=(n,d={})=>{this.showMessage(n,"success",d)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,d="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=m.ElLoading.service({lock:!0,text:d,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,d=!0)=>{if(d){let o=screen.width/2-500,r=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+r+", left="+o)}else window.open(n,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=n=>new Promise(async(d,o)=>{let r=document.getElementById(n.id);const t=await y.loadModule("html2canvas");try{t(r,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(l){let c=l.toDataURL("image/png");d(c)})}catch(l){o(l)}})}class b{static config={page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"},dialog:{width:"980px",closeOnClickModal:!1},tools:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,fileName:"Export Data "}},form:{stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{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}},columnConfig:{type:"input",form:{labelWidth:"100px",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},options:{switch:{activeValue:!0,inactiveValue:!1},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=n=>{b.config=ObjectUtil.deepMerge(b.config,n)}}class B{static customComponent={};static findOptions=(n,d)=>{const o=n.column.find(t=>t.key===d),r=t=>t.replace(/-([a-z])/g,(l,c)=>c.toUpperCase());if(o)return o.options[r(o.type)]};static setOptionsData=(n,d,o)=>{const r=B.findOptions(n,d);r&&(r.data=o)};static form={openBefore:{parentId:(n,d,o,r)=>{const t=b.config.table.rowKey;n?d.type===y.EDialog.Insert?(d.form.parentId=n[t],d.form.sort=n.children.length+1):d.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(d.form.parentId="0",d.form.sort=o.length+1),B.setOptionsData(r,"parentId",[{[t]:"0",title:"根",children:o}])}}}}class E{static getIdFun=()=>StrUtil.uuid();static setId=(n,d,o)=>{d[n]||(d[n]=[]);const r=b.config.table.rowKey;d[n].forEach(t=>{o.forEach(l=>{let c=l.default??"";l.type==="number"&&(c=l.default??0),l.type==="boolean"&&(c=l.default??!1),l.type==="time"&&(c=l.default??new Date),t[l.value]===void 0&&(t[l.value]=c)}),t[r]||(t[r]=E.getIdFun())})};static add=(n,d,o,r)=>{const t=JSONUtil.cp(o);E.setId(n,d,o);const l=b.config.table.rowKey;d[n].push(t.reduce((c,p)=>{let h=p.default??"";return p.type==="number"&&(h=p.default??0),p.type==="boolean"&&(h=p.default??!1),p.type==="time"&&(h=p.default??new Date),c[p.value]=h,c},{[l]:E.getIdFun()})),r?.(d)};static remove=(n,d,o,r)=>{const t=b.config.table.rowKey;d[n]=d[n].filter(l=>l[t]!==o[t]),r?.(d)};static getNoIdData=(n,d)=>{const o=JSONUtil.cp(n),r=b.config.table.rowKey;return o.forEach(t=>{t[r]&&delete t[r],d&&t[d]&&E.getNoIdData(t[d],d)}),o}}const I={key:0,class:"column",style:{width:"100%",gap:"10px"}},L={class:"row items-center",style:{gap:"10px",width:"100%"}},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:""}},emits:["change"],setup(i,{emit:n}){const d=i,o=e.reactive({show:!1,add:(t,l,c)=>{E.add(t,l,c,()=>{r("change")})},remove:(t,l,c)=>{E.remove(t,l,c,()=>{r("change")})}});e.onMounted(()=>{E.setId(d.field,d.row,d.itemFields),o.show=!0});const r=n;return(t,l)=>{const c=e.resolveComponent("el-button"),p=e.resolveComponent("el-input");return o.show?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"list-start",{row:i.row}),e.createElementVNode("div",null,[e.createVNode(c,{link:"",type:"primary",onClick:l[0]||(l[0]=h=>o.add(i.field,i.row,i.itemFields))},{default:e.withCtx(()=>l[2]||(l[2]=[e.createTextVNode("添加")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.row[i.field],h=>(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(t.$slots,"item-start",{item:h,row:i.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.itemFields,f=>(e.openBlock(),e.createBlock(p,{modelValue:h[f.value],"onUpdate:modelValue":a=>h[f.value]=a,style:e.normalizeStyle({width:i.inputWidth}),class:e.normalizeClass(i.inputClass),placeholder:f[i.label]||f[i.value],onChange:l[1]||(l[1]=a=>r("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(t.$slots,"item-end",{item:h,row:i.row}),e.createVNode(c,{link:"",type:"danger",onClick:f=>o.remove(i.field,i.row,h)},{default:e.withCtx(()=>l[3]||(l[3]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),e.renderSlot(t.$slots,"list-end",{row:i.row})])):e.createCommentVNode("",!0)}}}),M={class:"row curd-row"},F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(i,{expose:n}){const d=y.isFun,o=y.EDialog,r=e.ref(),t=i,l=e.reactive({rules:{},show:!0,form:{},formDefault:{},formColumn:[],getDisabled:c=>c.disabled?.[(t.type||o.Insert)===o.Insert?"create":"update"],initColumnForm:async()=>{const c=t.option;l.formColumn=[];const p=[],h=t.option.form?.maxSpan||12,f=t.option.form?.defaultSpan||h;let a=[];const s=g=>{if(l.formDefault[g.key]=g.value,g.isForm){g.form=g.form||{span:f},g.form.span=g.form.span??f;let w=g.form.span,C=a.reduce((S,Ee)=>S+Ee.span,w);const V=a.length;a.push({item:g,span:w}),(V===1&&a[0].span===0||C>=h||w===0&&V>1)&&(p.push(a),a=[]),g.rules&&(l.rules[g.key]=g.rules)}};c.column.forEach(g=>{g.isForm=!0,s(g)}),a.length>0&&p.push(a),l.formColumn=p,l.form=JSONUtil.cp(l.formDefault)},init:async()=>{l.show=!1,await e.nextTick(),l.initColumnForm()}});return l.initColumnForm(),n({ref:r,conf:l}),(c,p)=>(e.openBlock(),e.createBlock(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:r,model:l.form,rules:l.rules},{default:e.withCtx(()=>[l.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.formColumn,h=>(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(c.$slots,"form-start",{row:l.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(d)(f.item.show?.form,l.form)??!0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.item.form.span>0?`col-${f.item.form.span}`:"col")},[e.createVNode(e.unref(m.ElFormItem),{label:f.item.label,prop:f.item.key,"label-width":f.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"form-"+f.item.key+"-start",{row:l.form,item:f.item}),e.renderSlot(c.$slots,"form-"+f.item.key,{row:l.form,item:f.item},()=>[f.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.input,e.toHandlers(f.item.options?.input?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.switch,e.toHandlers(f.item.options?.switch?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.select,e.toHandlers(f.item.options?.select?.on||{}),{disabled:l.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.select?.data,a=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:3,row:l.form,field:f.item.key,ref_for:!0},f.item.options?.list,e.toHandlers(f.item.options?.list?.on||{}),{disabled:l.getDisabled(f.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):f.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:4,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.treeSelect,e.toHandlers(f.item.options?.treeSelect?.on||{}),{disabled:l.getDisabled(f.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:5,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.datetime,e.toHandlers(f.item.options?.datetime?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type&&e.unref(B).customComponent[f.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[f.item.type]),e.mergeProps({key:6,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.[f.item.type],e.toHandlers(f.item.options?.[f.item.type]?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(c.$slots,"form-"+f.item.key+"-end",{row:l.form,item:f.item})]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(c.$slots,"form-end",{row:l.form})]))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});function Ne(i){return i}const j={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 k{static t(n,...d){if(typeof n=="function")return n(...d);n=String(n);let o=0;return n.replace(/{([^}]+)}/g,(r,t)=>o<d.length?String(d[o++]):`{${t}}`)}static setI18n=n=>{k.curd=ObjectUtil.deepMerge(k.curd,n)};static tCurd(n,...d){return this.t(this.curd[n],...d)}static curd=j}class U{static exportToExcel=async(n,d,o)=>{if(!n||n.length===0)return;const r=await y.loadModule("xlsx"),t=n.map(p=>{const h={};return d.forEach(f=>{h[f.label]=p[f.key]}),h}),l=r.utils.json_to_sheet(t),c=r.utils.book_new();r.utils.book_append_sheet(c,l,"Sheet1"),o?typeof o=="function"&&(o=o()):o=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,r.writeFile(c,`${o}.xlsx`)}}const N=y.EDialog,z=i=>{const n=e.ref(),d=e.ref(),o=e.reactive({search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(r,t=k.tCurd("placeholderInput"))=>r.text?.search?.placeholder===void 0?`${t}${r.label}`:r.text?.search?.placeholder,getFormData:()=>{let r={};i.option.column.forEach(l=>{(typeof l.show?.search=="function"?l.show?.search(o.search.form):l.show?.search)&&(r[l.key]=o.search.form[l.key])});const t=i.option.search?.before?.(r);return t&&(r=t),r},reset:()=>{const r=o.search.formDefault;Object.keys(r).forEach(t=>{i.option.search?.resetMode==="none"?r[t]=void 0:r[t]=o.search.formDefault[t]}),o.search.form=JSONUtil.cp(r),o.page.num=1,i.option.init!==!1&&o.table.getList()},submit:()=>{o.page.num=1,o.table.getList()}},page:{size:i.option.page?.size||10,sizeList:i.option.page?.sizeList||[10,20,50,100],num:1,total:0,layout:i.option.page?.layout||"total, sizes, prev, pager, next, jumper"},table:{op:{width:(...r)=>r.filter(l=>l).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(r,t)=>{},all:()=>{if(o.table.expand.isExpand)o.table.expand.rowKeys=[];else{const r=t=>{let l=[];return t.forEach(c=>{l.push(c[i.option.table.rowKey]),c.children&&c.children.length>0&&(l=l.concat(r(c.children)))}),l};o.table.expand.rowKeys=r(o.table.data)}o.table.expand.isExpand=!o.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{o.table.loading=!0;const r=i.option.api.list;try{await o.initApiData("init");let t={};if(o.table.sort.prop){const{props:s,order:g}=b.config.table.sort;t={[s.field]:o.table.sort.prop,[g.field]:o.table.sort.order}}const l=await r({[b.config.page.size]:o.page.size,[b.config.page.num]:o.page.num,...o.search.getFormData(),...t}),c=b.config.result,p=l.data||{[c.list]:l};let h=(Array.isArray(p[c.list]),p[c.list]);const f=o.update.formColumn.flat(),a=JSONUtil.cp(h).map(s=>(Object.keys(s).forEach(w=>{const C=f.find(V=>V.item.key===w);C&&["select","radio"].includes(C.item.type)&&(C.item.table.format||(C.item.table.format=V=>C.item.options[C.item.type].data?.find(S=>S.value==V[w])?.label||V[w]))}),s));o.table.data=i.option.data?await i.option.data(a,h):a,o.page.total=p[c.total]||0}catch(t){console.error(t)}finally{o.table.loading=!1}},selection:{list:[],change:r=>{o.table.selection.list=r}},sort:{prop:"",order:"",change:r=>{b.config.table.sort.resetPage&&(o.page.num=1);const t=b.config.table.sort;if(t.change){t.change(r,o);return}o.table.sort.prop=r.prop,r.order===null?o.table.sort.order="":o.table.sort.order=r.order==="ascending"?t.order.asc:t.order.desc,o.table.getList()}}},export:{run:{start:async r=>{let t=await o.export.run[r](),l=i.option.column;const c=JSONUtil.cp({data:t,columns:l}),p=i.option.tools?.export||{};p.before&&p.before(c),U.exportToExcel(c.data,c.columns,p.fileName)},select:()=>{if(o.table.selection.list.length===0)throw y.fail(k.tCurd("selectDataToExport")),new Error(k.tCurd("selectDataToExport"));return o.table.selection.list},page:()=>{if(o.table.data.length===0)throw y.fail(k.tCurd("noData")),new Error(k.tCurd("noData"));return o.table.data},all:async()=>{o.export.loading=!0;try{if(i.option.tools?.export?.all){await i.option.tools?.export?.all({[b.config.page.size]:o.page.size,[b.config.page.num]:o.page.num,...o.search.getFormData()});return}const r=i.option.api.list,t=await r({[b.config.page.size]:999999,[b.config.page.num]:1});return(t.data||{[b.config.result.list]:t})[b.config.result.list]}catch(r){console.error(r)}finally{o.export.loading=!1}}},loading:!1,click:r=>{o.export.loading||o.export.run.start(r)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:N.Insert,form:{},formDefault:{},formColumn:[],getDisabled:r=>o.update.type===N.View?!0:r.disabled?.[o.update.type===N.Insert?"create":"update"],edit:{data:{},getApiData:r=>{if(i.option.form?.editAll)return r;let t={[i.option.table?.rowKey]:o.update.edit.data[i.option.table?.rowKey]};return Object.keys(o.update.edit.data).forEach(l=>{r[l]!==o.update.edit.data[l]&&(t[l]=r[l])}),t}},view:{},open:(r,t)=>{o.update.showContent||FunUtil.throttle(async()=>{y.loading(!0);try{await o.initApiData("update");const l=r===N.Insert;if(!l&&i.option.table?.inlineEdit){o.inlineEdit.open(t);return}o.update.type=r,o.update.edit.data=t,o.update.title=k.tCurd(l?"add":r===N.View?"view":"edit"),o.update.form=JSONUtil.cp(l?o.update.formDefault:t),await i.option.form?.openBefore?.(t,o.update),o.update.show=!0,o.update.showContent=!0,i.option.form?.openAfter?.(t,o.update)}catch(l){console.error(l)}finally{y.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await d.value?.validate(async(c,p)=>new Promise((h,f)=>{c||(y.fail(k.tCurd("checkFormData")),f(!1)),h()})),o.update.loading=!0;const r=o.update.type===N.Insert?i.option.api.create:i.option.api.update;let t=JSONUtil.cp(o.update.form);delete t.children,await i.option.form?.submitBefore?.(t,o.update);const l=new Set(i.option.column.filter(c=>c.type==="datetime").map(c=>c.key));Object.keys(t).forEach(c=>{if(l.has(c)&&t[c]!=null){const p=new Date(t[c]).getTime();isNaN(p)||(t[c]=p)}});try{if(!r)return;await r({...t}),o.update.close(),await o.table.getList(),i.option.form?.submitAfter?.(t,o.update)}catch(c){console.error(c)}finally{o.update.loading=!1}})},close:()=>{o.update.show=!1,setTimeout(()=>{o.update.showContent=!1},350)}},inlineEdit:{row:null,form:{},loading:!1,open:r=>{o.inlineEdit.row=r,o.inlineEdit.form=JSONUtil.cp(r)},close:()=>{o.inlineEdit.row=null,o.inlineEdit.form={}},submit:()=>{FunUtil.throttle(async()=>{o.inlineEdit.loading=!0;const r=i.option.api.update;let t=JSONUtil.cp(o.inlineEdit.form);delete t.children;try{if(!r)return;await r({...t}),o.inlineEdit.close(),await o.table.getList(),y.success(k.tCurd("operationSuccess"))}catch(l){console.error(l)}finally{o.inlineEdit.loading=!1}})}},remove:{title:k.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{o.remove.show=!1},open:r=>{if(r.length===0){y.fail(k.tCurd("selectDataToDelete"));return}o.remove.items=r,o.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{o.remove.loading=!0;const r=i.option.api.delete;try{if(!r)return;await r({[i.option.table?.rowKey]:o.remove.items.map(t=>t[i.option.table?.rowKey]),items:o.remove.items}),y.success(k.tCurd("operationSuccess")),o.table.data.length<=1&&o.page.num>1&&(o.page.num-=1),o.remove.close(),await o.table.getList()}catch(t){console.error(t)}finally{o.remove.loading=!1}})}},init:()=>{o.initCurdConfig(),o.initColumnOptions(),o.initColumnForm()},apiDataMap:{},initApiData:async r=>{const t=[],l=c=>{if(c.children&&c.children.length){c.children.forEach(p=>l(p));return}if(c.type==="select"&&c.options?.select?.dataApi&&c.options?.select?.dataApiConfig?.[r]){if(o.apiDataMap[c.key]&&c.options?.select?.dataApiConfig?.once)return;const p=(async()=>{try{let h=await c.options?.select?.dataApi?.();if(h){const f=c.options?.select?.dataPath;f&&(h=ObjectUtil.getPathValue(h,f)),c.options.select.data=h,o.apiDataMap[c.key]=h}}catch{}})();t.push(p)}};return i.option.column.forEach(c=>{l(c)}),await Promise.all(t),!0},initCurdConfig:()=>{const r=JSONUtil.cp(b.config);r.table.emptyText=k.tCurd("noData");const t=ObjectUtil.deepMerge(r,i.option||{});Object.keys(t).forEach(l=>{i.option[l]=t[l]})},initColumnOptions:()=>{let r=JSONUtil.cp(b.config.columnConfig);r.options=ObjectUtil.deepMerge(r.options,{switch:{activeLabel:k.tCurd("switchOn"),inactiveLabel:k.tCurd("switchOff")}});const t=l=>{if(l.table=ObjectUtil.deepMerge(r.table,l.table||{}),l.children){l.children.forEach(c=>{t(c)});return}l.options=ObjectUtil.deepMerge(r.options,l.options||{}),l.form=ObjectUtil.deepMerge(r.form,l.form||{}),l.show=ObjectUtil.deepMerge(r.show,l.show||{}),l.sort=ObjectUtil.deepMerge(r.sort,l.sort||{}),l.type=l.type||r.type,l.type==="switch"&&(l.options.switch.tableBeforeChange=async(c,p)=>{const h=l.options?.switch;try{await n.value?.open({title:k.tCurd("confirmModify"),content:k.tCurd("confirmSwitchMessage")}),o.table.loading=!0;try{return i.option.api.update?(await i.option.api.update({[i.option.table?.rowKey]:p[i.option.table?.rowKey],[c]:p[c]===h.activeValue?h.inactiveValue:h.activeValue,final(f,a,s){o.table.loading=!1}}),o.table.loading=!1,y.success(k.tCurd("operationSuccess")),o.table.getList(),!0):void 0}catch(f){return console.error(f),!1}finally{o.table.loading=!1}}catch{return!1}}),l.type==="tree-select"&&(l.options.treeSelect.rowKey=i.option.table?.rowKey,l.options.treeSelect.nodeKey=i.option.table?.rowKey)};i.option.column.forEach(t),i.option.table?.column?.forEach(t)},getColumnSpan:(r,t)=>{if(r.item.form?.spanCol){const l=b.config.form.defaultSpan,p=t.filter(h=>!y.isFun(h.item.show?.form,o.update.form,o.update.type)).reduce((h,f)=>h+(f.item.form?.span||l),0);return(r.item?.form.span||l)+p}return r.item.form.span},initColumnForm:()=>{const r=i.option;o.update.formColumn=[],o.table.column.show={list:[],listSource:[]};const t=[],l=i.option.form?.maxSpan||12,c=i.option.form?.defaultSpan||l/2;let p=[];const h=s=>{if(s.children){o.table.column.show.list.push(s.key),s.children.forEach(g=>{h(g)});return}if(o.update.formDefault[s.key]=s.value,s.table.table&&(s.show.table&&o.table.column.show.list.push(s.key),s.table.table&&o.table.column.show.listSource.push(s.key)),!(s.isForm&&typeof s.show?.form=="boolean")||s.show?.form){s.form=s.form||{span:c},s.form.span=s.form.span??c;let g=s.form.span,w=p.reduce((V,S)=>V+S.span,g);const C=p.length;if(p.push({item:s,span:g}),(C===1&&p[0].span===0||w>=l||g===0&&C>1)&&(t.push(p),p=[]),s.rules){const V={input:k.tCurd("placeholderInput"),select:k.tCurd("placeholderSelect")},S=(V[s.type]||V.input)+s.label;o.update.rules[s.key]=typeof s.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:s.rules}}},f=(s,g)=>{s.isForm=g,Array.isArray(s.children)&&s.children.forEach(w=>f(w,g))};r.column.forEach(s=>{s.isForm=!0,f(s,!0),h(s)}),i.option.table?.column?.forEach(s=>{f(s,!1),h(s)}),o.search.column.list=r.column.concat(r.table?.column||[]),o.table.column.list=o.search.column.list.filter(s=>s.table?.table),o.search.column.list.sort((s,g)=>s.sort?.search-g.sort?.search),o.table.column.list.sort((s,g)=>s.sort?.table-g.sort?.table),p.length>0&&t.push(p),o.update.formColumn=t;const a=i.option.search?.formDefault;a&&Object.keys(a).forEach(s=>{o.search.formDefault[s]=a[s]}),r.column.forEach(s=>{s.show?.search||(o.search.formDefault[s.key]=void 0)}),o.search.form=JSONUtil.cp(o.search.formDefault)}});return o.init(),e.onMounted(()=>{i.option.init!==!1&&o.table.getList()}),{conf:o,switchConfirmRef:n,ruleFormRef:d}},R={class:"dialog-footer"},A=e.defineComponent({__name:"switchConfirm",setup(i,{expose:n}){const d=e.ref(!1),o=e.ref("确认修改"),r=e.ref("确认要修改状态吗?");let t=null,l=null;const c=f=>(f?.title&&(o.value=f.title),f?.content&&(r.value=f.content),d.value=!0,new Promise((a,s)=>{t=a,l=s})),p=()=>{d.value=!1,t?.(!0),t=null,l=null},h=()=>{d.value=!1,l?.(new Error("用户取消操作")),t=null,l=null};return n({open:c}),(f,a)=>(e.openBlock(),e.createBlock(e.unref(m.ElDialog),{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=s=>d.value=s),title:o.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createElementVNode("span",R,[e.createVNode(e.unref(m.ElButton),{onClick:h},{default:e.withCtx(()=>a[1]||(a[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:p},{default:e.withCtx(()=>a[2]||(a[2]=[e.createTextVNode("确认")])),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(r.value),1)]),_:1},8,["modelValue","title"]))}}),$=(i,n)=>{const d=i.__vccOpts||i;for(const[o,r]of n)d[o]=r;return d},H={},K={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function J(i,n){return e.openBlock(),e.createElementBlock("svg",K,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)]))}const W=$(H,[["render",J]]),q={},G={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(i,n){return e.openBlock(),e.createElementBlock("svg",G,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)]))}const Q=$(q,[["render",X]]),Y={class:"row flex-center table-header-label inline"},Z={class:"table-header-tooltip"},P=["onClick"],_=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(i){const n=y.isFun,d=e.getCurrentInstance().type;return(o,r)=>{const t=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[o.conf.table.column.show.list.includes(l.key)?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:0,prop:l.key,label:l.label,ref_for:!0},l.table),{header:e.withCtx(()=>[e.renderSlot(o.$slots,"table-header-"+l.key,{item:l},()=>[e.createElementVNode("div",Y,[l.table?.tooltip?(e.openBlock(),e.createBlock(t,{key:0,effect:"dark",content:l.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",Z,[e.createVNode(Q)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)])])]),default:e.withCtx(({row:c})=>[l.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r[0]||(r[0]=e.createTextVNode("   ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(d)),{conf:o.conf,columnList:l.children,option:o.option},e.createSlots({_:2},[e.renderList(o.$slots,(p,h)=>({name:h,fn:e.withCtx(f=>[e.renderSlot(o.$slots,h,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(n)(l.show?.form,o.conf.inlineEdit.form,e.unref(y).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.inlineEdit.row===c&&(l.type==="input"||l.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:o.conf.inlineEdit.form[l.key],"onUpdate:modelValue":p=>o.conf.inlineEdit.form[l.key]=p,ref_for:!0},l.options?.input,{size:"small",style:{width:"100%"},onKeyup:e.withKeys(o.conf.inlineEdit.submit,["enter"])}),null,16,["modelValue","onUpdate:modelValue","onKeyup"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:o.conf.inlineEdit.form[l.key],"onUpdate:modelValue":p=>o.conf.inlineEdit.form[l.key]=p,ref_for:!0},l.options?.select,{size:"small",style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.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"])):e.createCommentVNode("",!0)],64)):e.renderSlot(o.$slots,"table-"+l.key,{key:1,row:c,item:l},()=>[l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:0,modelValue:c[l.key],"onUpdate:modelValue":p=>c[l.key]=p,"before-change":()=>l.options?.switch?.tableBeforeChange?.(l.key,c),ref_for:!0},l.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({"--table-text-click-color":l.table?.click?.color}),class:e.normalizeClass({"table-text-click":l.table?.click?.callback}),onClick:p=>l.table?.click?.callback?.(c)},e.toDisplayString(l.table?.format?l.table?.format(c):c[l.key]),15,P))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),x=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(i){return(n,d)=>{const o=e.resolveComponent("el-radio"),r=e.resolveComponent("el-radio-group");return n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[0]||(d[0]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.input,e.toHandlers(n.item.item.options?.input?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[1]||(d[1]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.switch,{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[2]||(d[2]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.select,e.toHandlers(n.item.item.options?.select?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.item.item.options?.select?.data,t=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(r,e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[3]||(d[3]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.radio,e.toHandlers(n.item.item.options?.radio?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.item.item.options?.radio?.data,t=>(e.openBlock(),e.createBlock(o,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.item.item.options?.list,e.toHandlers(n.item.item.options?.list?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[4]||(d[4]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.treeSelect,e.toHandlers(n.item.item.options?.treeSelect?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[5]||(d[5]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.datetime,e.toHandlers(n.item.item.options?.datetime?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&e.unref(B).customComponent[n.item.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[6]||(d[6]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.[n.item.item.type],e.toHandlers(n.item.item.options?.[n.item.item.type]?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}}),v={class:"col relative cc1-form-box"},ee={class:"absolute row fit",style:{overflow:"hidden"}},te={class:"col column fit-width no-wrap"},oe={key:0,class:"relative curd-search fit-width"},le={class:"mb-10 flex justify-between items-center fit-width"},ne={class:"flex items-center",style:{gap:"10px"}},re={key:0},ae={key:1},ie={key:2},se={class:"export-btn"},de={class:"flex items-center",style:{gap:"10px"}},ce={class:"col fit-width relative form-box"},fe={class:"absolute column fit form-box-content"},pe={class:"row justify-end mt-10 mb-10"},me={class:"row form-item-content",style:{width:"100%"}},he={class:"col"},ge={key:0,class:"form-tip-text"},ke={class:"row form-item-content",style:{width:"100%"}},ye={class:"col"},be={class:"col"},ue={key:0,class:"form-tip-text"},we={class:"dialog-footer"},Ce={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(i,{expose:n}){const d=y.EDialog,o=i,r=y.isFun,{conf:t,switchConfirmRef:l,ruleFormRef:c}=z(o);return n({conf:t}),(p,h)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",ee,[e.renderSlot(p.$slots,"box-left"),e.createElementVNode("div",te,[i.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",oe,[e.createVNode(e.unref(m.ElForm),{model:e.unref(t).search.form,inline:""},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-start",{row:e.unref(t).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).search.column.list,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[(typeof a.show?.search=="function"?a.show?.search(e.unref(t).search.form):a.show?.search)?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0,label:typeof a.text?.search?.label=="string"?a.text?.search?.label:a.label,class:e.normalizeClass({"hide-label":typeof a.text?.search?.label=="boolean"?!a.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-"+a.key,{row:e.unref(t).search.form},()=>[a.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,placeholder:e.unref(t).search.getPlaceholder(a),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.input,e.toHandlers(a.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,placeholder:e.unref(t).search.getPlaceholder(a,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.switch,e.toHandlers(a.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.options?.switch?.activeValue,label:a.options?.switch?.activeLabel,value:a.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.options?.switch?.inactiveValue,label:a.options?.switch?.inactiveLabel,value:a.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,placeholder:e.unref(t).search.getPlaceholder(a,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.select,e.toHandlers(a.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,ref_for:!0},a.options?.datetime,e.toHandlers(a.options?.datetime?.on||{}),{disabled:a.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):a.type&&e.unref(B).customComponent[a.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[a.type]),e.mergeProps({key:4,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,ref_for:!0},a.options?.[a.type],e.toHandlers(a.options?.[a.type]?.on||{}),{disabled:a.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"search-"+a.key+"-right",{row:e.unref(t).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(p.$slots,"search-center",{row:e.unref(t).search.form}),i.option.tools?.search||i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0},{default:e.withCtx(()=>[i.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(t).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:e.unref(t).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-end",{row:e.unref(t).search.form})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createElementVNode("div",ne,[e.unref(r)(i.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:h[0]||(h[0]=a=>e.unref(t).update.open(e.unref(d).Insert))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.table?.selectable&&e.unref(r)(i.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:h[1]||(h[1]=a=>e.unref(t).remove.open(e.unref(t).table.selection.list))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(m.ElButton),{type:"warning",onClick:h[2]||(h[2]=a=>e.unref(t).table.expand.all())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("expandCollapse")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElDropdown),{key:3,onCommand:e.unref(t).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(m.ElDropdownMenu),null,{default:e.withCtx(()=>[i.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(m.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportAll")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(t).export.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"tools-left")]),e.createElementVNode("div",de,[e.renderSlot(p.$slots,"tools-right"),i.option.tools?.refresh===void 0||i.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:0,class:"refresh-btn",onClick:h[3]||(h[3]=(...a)=>e.unref(t).table.getList&&e.unref(t).table.getList(...a))},[e.createVNode(W)])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",ce,[e.createElementVNode("div",fe,[e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElTable),e.mergeProps({data:e.unref(t).table.data,border:i.option.table?.border===void 0?!0:i.option.table?.border,onSelectionChange:e.unref(t).table.selection.change,onSortChange:e.unref(t).table.sort.change,"expand-row-keys":e.unref(t).table.expand.rowKeys,onExpandChange:e.unref(t).table.expand.change},i.option.table,e.toHandlers(i.option.table?.on||{})),{default:e.withCtx(()=>[i.option.table?.selectable||e.unref(r)(i.option.tools?.delete)||i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,type:"selection",selectable:typeof i.option.table?.selectable=="function"?i.option.table?.selectable:void 0,width:"40",align:"center","show-overflow-tooltip":!1},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(_,{conf:e.unref(t),columnList:e.unref(t).table.column.list,option:i.option},e.createSlots({_:2},[e.renderList(p.$slots,(a,s)=>({name:s,fn:e.withCtx(g=>[e.renderSlot(p.$slots,s,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1032,["conf","columnList","option"]),e.unref(r)(i.option.table?.add)||e.unref(r)(i.option.table?.update)||e.unref(r)(i.option.table?.delete)||e.unref(r)(i.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(t).table.op.width(e.unref(r)(i.option.table?.add),e.unref(r)(i.option.table?.update),e.unref(r)(i.option.table?.delete),e.unref(r)(i.option.table?.view),p.$slots["table-op-left"],p.$slots["table-op-right"]),align:"center",fixed:"right"},i.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(p.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("operation")),1)])]),default:e.withCtx(({row:a})=>[e.renderSlot(p.$slots,"table-op-left",{row:a}),i.option.table?.inlineEdit&&e.unref(t).inlineEdit.row===a?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(m.ElButton),{link:"",type:"info",onClick:e.unref(t).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{link:"",type:"primary",onClick:e.unref(t).inlineEdit.submit,loading:e.unref(t).inlineEdit.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(p.$slots,"table-op-edit-right",{row:a})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(r)(i.option.table?.add,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,link:"",type:"primary",onClick:s=>e.unref(t).update.open(e.unref(d).Insert,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.view,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,link:"",type:"primary",onClick:s=>e.unref(t).update.open(e.unref(d).View,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.update,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,link:"",type:"warning",onClick:s=>e.unref(t).update.open(e.unref(d).Update,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.delete,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:3,link:"",type:"danger",onClick:s=>e.unref(t).remove.open([a])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"table-op-right",{row:a})],64))]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[f,e.unref(t).table.loading]])])]),e.createElementVNode("div",pe,[i.option.page?.show===void 0||i.option.page?.show?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),{key:0,"current-page":e.unref(t).page.num,"onUpdate:currentPage":h[4]||(h[4]=a=>e.unref(t).page.num=a),"page-size":e.unref(t).page.size,"onUpdate:pageSize":h[5]||(h[5]=a=>e.unref(t).page.size=a),background:"","page-sizes":e.unref(t).page.sizeList,"pager-count":7,layout:e.unref(t).page.layout,total:e.unref(t).page.total,onSizeChange:e.unref(t).table.getList,onCurrentChange:e.unref(t).table.getList},null,8,["current-page","page-size","page-sizes","layout","total","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])]),e.renderSlot(p.$slots,"box-right")]),e.createVNode(e.unref(m.ElDialog),e.mergeProps({modelValue:e.unref(t).update.show,"onUpdate:modelValue":h[6]||(h[6]=a=>e.unref(t).update.show=a),title:e.unref(t).update.title,"before-close":e.unref(t).update.close},i.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",we,[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(t).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(t).update.type!==e.unref(d).View?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(t).update.submit,loading:e.unref(t).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:c,model:e.unref(t).update.form,rules:e.unref(t).update.rules},{default:e.withCtx(()=>[e.unref(t).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t).update.formColumn,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)((()=>{const s=[],g=w=>{w?.item?.children?g(w.item.children):s.push(...w.map(C=>C.item?.show?.form))};return g(a),s})(),e.unref(t).update.form,e.unref(t).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(p.$slots,"form-start",{row:e.unref(t).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,s=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)(s.item.show?.form,e.unref(t).update.form,e.unref(t).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.item.form.span>0?`col-${e.unref(t).getColumnSpan(s,a)}`:"col",`form-item-col-${s.item.key}`])},[s.item.children?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.children,g=>(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof g.item.text?.form?.label=="boolean"?!g.item.text?.form?.label:!1}),label:typeof g.item.text?.form?.label=="string"?g.item.text?.form?.label:g.item.label,prop:g.item.key,"label-width":g.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",me,[e.renderSlot(p.$slots,"form-"+g.item.key+"-start",{row:e.unref(t).update.form,item:g.item}),e.createElementVNode("div",he,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"form-"+g.item.key,{row:e.unref(t).update.form,item:g.item},()=>[e.createVNode(x,{conf:e.unref(t),item:s},null,8,["conf","item"])]),e.renderSlot(p.$slots,"form-"+g.item.key+"-right",{row:e.unref(t).update.form,item:g.item})]),g.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",ge,e.toDisplayString(g.item.form?.tipText),1)):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"form-"+g.item.key+"-end",{row:e.unref(t).update.form,item:g.item})])]),_:2},1032,["class","label","prop","label-width"]))),256)):(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:1,class:e.normalizeClass({"hide-label":typeof s.item.text?.form?.label=="boolean"?!s.item.text?.form?.label:!1}),label:typeof s.item.text?.form?.label=="string"?s.item.text?.form?.label:s.item.label,prop:s.item.key,"label-width":s.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.renderSlot(p.$slots,"form-"+s.item.key+"-start",{row:e.unref(t).update.form,item:s.item}),e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.renderSlot(p.$slots,"form-"+s.item.key,{row:e.unref(t).update.form,item:s.item},()=>[e.createVNode(x,{conf:e.unref(t),item:s},null,8,["conf","item"])]),e.renderSlot(p.$slots,"form-"+s.item.key+"-right",{row:e.unref(t).update.form,item:s.item})]),s.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString(s.item.form?.tipText),1)):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"form-"+s.item.key+"-end",{row:e.unref(t).update.form,item:s.item})])]),_:2},1032,["class","label","prop","label-width"]))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(p.$slots,"form-end",{row:e.unref(t).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(m.ElDialog),{modelValue:e.unref(t).remove.show,"onUpdate:modelValue":h[7]||(h[7]=a=>e.unref(t).remove.show=a),title:e.unref(t).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Ce,[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(t).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:e.unref(t).remove.submit,loading:e.unref(t).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(k).tCurd("confirmDeleteMessage",e.unref(t).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(A,{ref_key:"switchConfirmRef",ref:l},null,512)])}}});class Ve{static async download(n,d="download.png"){const o=document.createElement("a");o.style.display="none",o.href=n,o.setAttribute("download",d),typeof o.download>"u"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,d)=>{const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=URL.createObjectURL(o),t=document.createElement("a");t.href=r,t.download=`${d||"config"}.json`,t.click()};static importFile=async n=>new Promise((d,o)=>{const r=document.createElement("input");r.type="file";const t=n?.accept||".json";r.accept=t,r.style.display="none",r.onchange=l=>{const c=l.target.files[0];if(!c){y.fail("未选择文件"),o("未选择文件");return}const p=new FileReader;p.onload=async h=>{const f=t==".json"?JSON.parse(h.target.result):h.target.result;d(f)},p.onerror=()=>{y.fail("文件读取失败"),o("文件读取失败")},p.readAsText(c),document.body.removeChild(r)},document.body.appendChild(r),r.click()})}const T=(i,n)=>{if(i.component("TCurd",O),i.component("TFormList",D),i.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const d in n.customComponent)i.component(d,n.customComponent[d])}},Be={install:T};u.ArrUtil=E,u.ExcelUtil=U,u.TColumn=F,u.TCurd=O,u.TFile=Ve,u.TForm=B,u.TFormConfig=b,u.TFormI18n=k,u.TFormList=D,u.TSys=y,u.default=Be,u.install=T,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -41,7 +41,7 @@ declare const conf: {
41
41
  data?: {
42
42
  [x: string]: any;
43
43
  label: string;
44
- value: string;
44
+ value: any;
45
45
  }[] | undefined;
46
46
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
47
47
  dataApiConfig?: {
@@ -61,13 +61,13 @@ declare const conf: {
61
61
  list?: {
62
62
  on?: Record<string, any> | undefined;
63
63
  label?: string | undefined;
64
- value?: string | undefined;
65
- itemFields?: ({
66
- [x: string]: string;
64
+ value?: any;
65
+ itemFields?: {
66
+ [x: string]: any;
67
67
  label: string;
68
- value: string;
69
- } | undefined)[] | undefined;
70
- inputWidth?: string | undefined;
68
+ value: any;
69
+ }[] | undefined;
70
+ inputWidth?: any;
71
71
  inputClass?: string | undefined;
72
72
  } | undefined;
73
73
  radio?: {
@@ -76,7 +76,7 @@ declare const conf: {
76
76
  data?: {
77
77
  [x: string]: any;
78
78
  label: string;
79
- value: string;
79
+ value: any;
80
80
  }[] | undefined;
81
81
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
82
82
  dataApiConfig?: {
@@ -90,12 +90,14 @@ declare const conf: {
90
90
  labelWidth?: string | undefined;
91
91
  width?: string | undefined;
92
92
  span?: number | undefined;
93
+ spanCol?: boolean | undefined;
94
+ tipText?: string | undefined;
93
95
  } | undefined;
94
96
  type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "tree-select" | "list" | undefined;
95
97
  table?: {
96
98
  table?: boolean | undefined;
97
- minWidth?: string | undefined;
98
- width?: string | undefined;
99
+ minWidth?: any;
100
+ width?: any;
99
101
  fixed?: "left" | "right" | undefined;
100
102
  align?: "center" | "left" | "right" | undefined;
101
103
  showOverflowTooltip?: boolean | undefined;
@@ -168,7 +170,7 @@ declare var __VLS_7: {
168
170
  data?: {
169
171
  [x: string]: any;
170
172
  label: string;
171
- value: string;
173
+ value: any;
172
174
  }[] | undefined;
173
175
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
174
176
  dataApiConfig?: {
@@ -188,13 +190,13 @@ declare var __VLS_7: {
188
190
  list?: {
189
191
  on?: Record<string, any> | undefined;
190
192
  label?: string | undefined;
191
- value?: string | undefined;
192
- itemFields?: ({
193
- [x: string]: string;
193
+ value?: any;
194
+ itemFields?: {
195
+ [x: string]: any;
194
196
  label: string;
195
- value: string;
196
- } | undefined)[] | undefined;
197
- inputWidth?: string | undefined;
197
+ value: any;
198
+ }[] | undefined;
199
+ inputWidth?: any;
198
200
  inputClass?: string | undefined;
199
201
  } | undefined;
200
202
  radio?: {
@@ -203,7 +205,7 @@ declare var __VLS_7: {
203
205
  data?: {
204
206
  [x: string]: any;
205
207
  label: string;
206
- value: string;
208
+ value: any;
207
209
  }[] | undefined;
208
210
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
209
211
  dataApiConfig?: {
@@ -217,12 +219,14 @@ declare var __VLS_7: {
217
219
  labelWidth?: string | undefined;
218
220
  width?: string | undefined;
219
221
  span?: number | undefined;
222
+ spanCol?: boolean | undefined;
223
+ tipText?: string | undefined;
220
224
  } | undefined;
221
225
  type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "tree-select" | "list" | undefined;
222
226
  table?: {
223
227
  table?: boolean | undefined;
224
- minWidth?: string | undefined;
225
- width?: string | undefined;
228
+ minWidth?: any;
229
+ width?: any;
226
230
  fixed?: "left" | "right" | undefined;
227
231
  align?: "center" | "left" | "right" | undefined;
228
232
  showOverflowTooltip?: boolean | undefined;
@@ -286,7 +290,7 @@ declare var __VLS_7: {
286
290
  data?: {
287
291
  [x: string]: any;
288
292
  label: string;
289
- value: string;
293
+ value: any;
290
294
  }[] | undefined;
291
295
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
292
296
  dataApiConfig?: {
@@ -306,13 +310,13 @@ declare var __VLS_7: {
306
310
  list?: {
307
311
  on?: Record<string, any> | undefined;
308
312
  label?: string | undefined;
309
- value?: string | undefined;
310
- itemFields?: ({
311
- [x: string]: string;
313
+ value?: any;
314
+ itemFields?: {
315
+ [x: string]: any;
312
316
  label: string;
313
- value: string;
314
- } | undefined)[] | undefined;
315
- inputWidth?: string | undefined;
317
+ value: any;
318
+ }[] | undefined;
319
+ inputWidth?: any;
316
320
  inputClass?: string | undefined;
317
321
  } | undefined;
318
322
  radio?: {
@@ -321,7 +325,7 @@ declare var __VLS_7: {
321
325
  data?: {
322
326
  [x: string]: any;
323
327
  label: string;
324
- value: string;
328
+ value: any;
325
329
  }[] | undefined;
326
330
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
327
331
  dataApiConfig?: {
@@ -335,12 +339,14 @@ declare var __VLS_7: {
335
339
  labelWidth?: string | undefined;
336
340
  width?: string | undefined;
337
341
  span?: number | undefined;
342
+ spanCol?: boolean | undefined;
343
+ tipText?: string | undefined;
338
344
  } | undefined;
339
345
  type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "tree-select" | "list" | undefined;
340
346
  table?: {
341
347
  table?: boolean | undefined;
342
- minWidth?: string | undefined;
343
- width?: string | undefined;
348
+ minWidth?: any;
349
+ width?: any;
344
350
  fixed?: "left" | "right" | undefined;
345
351
  align?: "center" | "left" | "right" | undefined;
346
352
  showOverflowTooltip?: boolean | undefined;
@@ -404,7 +410,7 @@ declare var __VLS_7: {
404
410
  data?: {
405
411
  [x: string]: any;
406
412
  label: string;
407
- value: string;
413
+ value: any;
408
414
  }[] | undefined;
409
415
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
410
416
  dataApiConfig?: {
@@ -424,13 +430,13 @@ declare var __VLS_7: {
424
430
  list?: {
425
431
  on?: Record<string, any> | undefined;
426
432
  label?: string | undefined;
427
- value?: string | undefined;
428
- itemFields?: ({
429
- [x: string]: string;
433
+ value?: any;
434
+ itemFields?: {
435
+ [x: string]: any;
430
436
  label: string;
431
- value: string;
432
- } | undefined)[] | undefined;
433
- inputWidth?: string | undefined;
437
+ value: any;
438
+ }[] | undefined;
439
+ inputWidth?: any;
434
440
  inputClass?: string | undefined;
435
441
  } | undefined;
436
442
  radio?: {
@@ -439,7 +445,7 @@ declare var __VLS_7: {
439
445
  data?: {
440
446
  [x: string]: any;
441
447
  label: string;
442
- value: string;
448
+ value: any;
443
449
  }[] | undefined;
444
450
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
445
451
  dataApiConfig?: {
@@ -453,12 +459,14 @@ declare var __VLS_7: {
453
459
  labelWidth?: string | undefined;
454
460
  width?: string | undefined;
455
461
  span?: number | undefined;
462
+ spanCol?: boolean | undefined;
463
+ tipText?: string | undefined;
456
464
  } | undefined;
457
465
  type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "tree-select" | "list" | undefined;
458
466
  table?: {
459
467
  table?: boolean | undefined;
460
- minWidth?: string | undefined;
461
- width?: string | undefined;
468
+ minWidth?: any;
469
+ width?: any;
462
470
  fixed?: "left" | "right" | undefined;
463
471
  align?: "center" | "left" | "right" | undefined;
464
472
  showOverflowTooltip?: boolean | undefined;
@@ -631,7 +639,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
631
639
  data?: {
632
640
  [x: string]: any;
633
641
  label: string;
634
- value: string;
642
+ value: any;
635
643
  }[] | undefined;
636
644
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
637
645
  dataApiConfig?: {
@@ -651,13 +659,13 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
651
659
  list?: {
652
660
  on?: Record<string, any> | undefined;
653
661
  label?: string | undefined;
654
- value?: string | undefined;
655
- itemFields?: ({
656
- [x: string]: string;
662
+ value?: any;
663
+ itemFields?: {
664
+ [x: string]: any;
657
665
  label: string;
658
- value: string;
659
- } | undefined)[] | undefined;
660
- inputWidth?: string | undefined;
666
+ value: any;
667
+ }[] | undefined;
668
+ inputWidth?: any;
661
669
  inputClass?: string | undefined;
662
670
  } | undefined;
663
671
  radio?: {
@@ -666,7 +674,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
666
674
  data?: {
667
675
  [x: string]: any;
668
676
  label: string;
669
- value: string;
677
+ value: any;
670
678
  }[] | undefined;
671
679
  dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
672
680
  dataApiConfig?: {
@@ -680,12 +688,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
680
688
  labelWidth?: string | undefined;
681
689
  width?: string | undefined;
682
690
  span?: number | undefined;
691
+ spanCol?: boolean | undefined;
692
+ tipText?: string | undefined;
683
693
  } | undefined;
684
694
  type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "tree-select" | "list" | undefined;
685
695
  table?: {
686
696
  table?: boolean | undefined;
687
- minWidth?: string | undefined;
688
- width?: string | undefined;
697
+ minWidth?: any;
698
+ width?: any;
689
699
  fixed?: "left" | "right" | undefined;
690
700
  align?: "center" | "left" | "right" | undefined;
691
701
  showOverflowTooltip?: boolean | undefined;