cc1-form 1.2.20 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc1-form.js +436 -424
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +37 -37
- package/dist/components/TCurd/formColumn.vue.d.ts +25 -25
- package/dist/components/TCurd/index.d.ts +26 -26
- package/dist/components/TCurd/index.vue.d.ts +57 -57
- package/dist/components/TCurd/indexType.d.ts +5 -5
- package/package.json +1 -1
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],h):(C=typeof globalThis<"u"?globalThis:C||self,h(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,h,tt,e){"use strict";class u{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...c)=>Array.isArray(n)?n.some(l=>typeof l=="function"?l(...c):l):typeof n=="function"?n(...c):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},c=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(c).length?c:{}};static moduleObj={};static loadModule=async n=>{if(!u.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const c=await u.moduleObj[n]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(n,c,l={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:c},l);h.ElMessage(o),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,c={})=>{this.showMessage(n,"error",c)};static success=(n,c={})=>{this.showMessage(n,"success",c)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,c="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=h.ElLoading.service({lock:!0,text:c,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,c=!0)=>{if(c){let l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}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(c,l)=>{let a=document.getElementById(n.id);const o=await u.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");c(i)})}catch(t){l(t)}})}class w{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,c)=>{const l=n.column.find(o=>o.key===c),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(n,c,l)=>{const a=B.findOptions(n,c);a&&(a.data=l)};static form={openBefore:{parentId:(n,c,l,a)=>{const o=w.config.table.rowKey;n?c.type===u.EDialog.Add?(c.form.parentId=n[o],c.form.sort=n.children.length+1):c.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=l.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:l}])}}}}function ot(r){return r}const I={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...c){if(typeof n=="function")return n(...c);n=String(n);let l=0;return n.replace(/{([^}]+)}/g,(a,o)=>l<c.length?String(c[l++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...c){return this.t(this.curd[n],...c)}static curd=I}class D{static getIdFun=()=>StrUtil.uuid();static setId=(n,c,l)=>{c[n]||(c[n]=[]);const a=w.config.table.rowKey;c[n].forEach(o=>{l.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=D.getIdFun())})};static add=(n,c,l,a)=>{const o=JSONUtil.cp(l);D.setId(n,c,l);const t=w.config.table.rowKey;c[n].push(o.reduce((i,d)=>{let m=d.default??"";return d.type==="number"&&(m=d.default??0),d.type==="boolean"&&(m=d.default??!1),d.type==="time"&&(m=d.default??new Date),i[d.value]=m,i},{[t]:D.getIdFun()})),a?.(c)};static remove=(n,c,l,a)=>{const o=w.config.table.rowKey;c[n]=c[n].filter(t=>t[o]!==l[o]),a?.(c)};static getNoIdData=(n,c)=>{const l=JSONUtil.cp(n),a=w.config.table.rowKey;return l.forEach(o=>{o[a]&&delete o[a],c&&o[c]&&D.getNoIdData(o[c],c)}),l}}const R={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},K={key:0},x={class:"row items-center",style:{gap:"10px",width:"100%"}},W={key:1},T=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(r,{emit:n}){const c=r,l=e.reactive({show:!1,add:(o,t,i)=>{D.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{D.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{D.setId(c.field,c.row,c.itemFields),l.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),d=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,f=>(e.openBlock(),e.createBlock(d,{modelValue:m[f.value],"onUpdate:modelValue":s=>m[f.value]=s,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:f[r.label]||f[r.value],onChange:t[1]||(t[1]=s=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:f=>l.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),q={class:"row form-item-content",style:{width:"100%"}},J={class:"col"},G={class:"col"},Q=["innerHTML"],M=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const c=u.isFun,l=u.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||l.Add,formColumn:[],getDisabled:i=>t.type===l.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[t.type===l.Add?"create":"update"],getBind:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,d)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,f=o.option.form?.defaultSpan||m/2,k=d.filter(g=>!u.isFun(g.item.show?.form,t.form,t.type)).reduce((g,p)=>g+(p.item.form?.span||f),0);return(i.item.form?.span||f)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const d=[],m=o.option.form?.maxSpan||12,f=o.option.form?.defaultSpan||m/2;let s=[];const k=p=>{if(p.children){p.children.forEach(b=>{k(b)});return}if(t.formDefault[p.key]=p.value,p.isForm&&(typeof p.show?.form!="boolean"||p.show?.form)){p.form=p.form||{span:f},p.form.span=p.form.span??f;const b=p.form.span,E=s.reduce((V,N)=>V+N.span,b),S=s.length;if(s.push({item:p,span:b}),(S===1&&s[0].span===0||E>=m||b===0&&S>1)&&(d.push(s),s=[]),p.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},N=(V[p.type]||V.input)+p.label;t.rules[p.key]=typeof p.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:p.rules}}},g=(p,b)=>{p.isForm=b,Array.isArray(p.children)&&p.children.forEach(E=>g(E,b))};i.column.forEach(p=>{g(p,!0),k(p)}),s.length>0&&d.push(s),t.formColumn=d,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f},[e.unref(c)(m.map(s=>s.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.item.key},[e.unref(c)(s.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.item.form.span>0?`col-${t.getColumnSpan(s,m)}`:"col",`form-item-col-${s.item.key}`])},[e.createVNode(e.unref(h.ElFormItem),{label:s.item.text?.form?.label??s.item.label,prop:s.item.key,"label-width":s.item.text?.form?.label==""?0:s.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.renderSlot(i.$slots,"form-"+s.item.key+"-start",{row:t.form,item:s.item}),e.createElementVNode("div",J,[e.createElementVNode("div",G,[e.renderSlot(i.$slots,"form-"+s.item.key,{row:t.form,item:s.item},()=>[s.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="list"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:4,row:t.form,field:s.item.key,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):s.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type&&(e.unref(B).customComponent[s.item.type]||e.unref(B).customComponent[s.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[s.item.type]?.form||e.unref(B).customComponent[s.item.type]),e.mergeProps({key:7,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+s.item.key+"-right",{row:t.form,item:s.item})]),e.renderSlot(i.$slots,"form-"+s.item.key+"-tip",{row:t.form,item:s.item},()=>[s.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof s.item.form?.tipText=="function"?s.item.form?.tipText(t.form,t.type):s.item.form?.tipText},null,8,Q)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+s.item.key+"-end",{row:t.form,item:s.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class L{static exportToExcel=async(n,c,l)=>{if(!n||n.length===0)return;const a=await u.loadModule("xlsx"),o=n.map(d=>{const m={};return c.forEach(f=>{m[f.label]=d[f.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${l}.xlsx`)}}class F{static delAllKey=n=>{Object.keys(n).forEach(c=>{delete n[c]})};static setValue=(n,c,l=!1)=>{l&&F.delAllKey(n),Object.keys(c).forEach(a=>{n[a]!==c[a]&&(n[a]=c[a])})}}const z=u.EDialog,X=r=>{const n=e.ref(),c=e.ref(),l=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(i=>{r.option.search?.resetMode==="none"?o[i]=void 0:o[i]=a.search.formDefault[i]});const t=ObjectUtil.deepMerge(o,{});F.setValue(a.search.form,t,!0),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(d=>{i.push(d[r.option.table.rowKey]),d.children&&d.children.length>0&&(i=i.concat(o(d.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!o),d.table?.header?.groupKey!==void 0&&(d.table.header.show=o),Array.isArray(d.children)&&d.children.length>0&&t(d.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list,t=JSONUtil.cp(a.table.selection.list);try{await a.initApiData("init");let i={};if(a.table.sort.prop){const{props:b,order:E}=w.config.table.sort;i={[b.field]:a.table.sort.prop,[E.field]:a.table.sort.order}}const d=await o({...a.page.getQuery(),...i}),m=w.config.field.result,f=d.data||{[m.list]:d};let s=(Array.isArray(f[m.list]),f[m.list]);const k=a.update.formColumn.flat(),p=ObjectUtil.deepMerge({data:s},{}).data.map(b=>(Object.keys(b).forEach(S=>{const V=k.find(N=>N.item.key===S);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=N=>V.item.options[V.item.type].data?.find(U=>U.value==N[S])?.label||N[S]))}),b));a.table.data=r.option.data?await r.option.data(p,s):p,a.page.total=f[m.total]||0,setTimeout(()=>{a.table.selection.setList(t)},20)}catch(i){console.error(i)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=l.value;if(i?.clearSelection(),!i||!o?.length)return;const d=r.option.table?.rowKey,m=f=>{const s=k=>{for(const g of k){if(d!=null&&d!==""){if(g[d]===f[d])return g}else if(g===f)return g;if(Array.isArray(g.children)&&g.children.length){const p=s(g.children);if(p!==void 0)return p}}};return s(a.table.data)};o.forEach(f=>{const s=m(f);if(s)if(t){const k=()=>{i.toggleRowSelection(s,!0,!1)};t(f)!==!1&&k()}else i.toggleRowSelection(s,!0,!1)})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?(a.table.sort.order="",a.table.sort.prop=""):a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const d=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(d),L.exportToExcel(d.data,d.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw u.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw u.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:z.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>r.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===z.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===z.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===z.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const d=o.options?.[a.update.type===z.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(d).forEach(f=>{const s=d[f];typeof s=="function"?m[f]=function(...k){return s.apply(this,[...k,t||a.update.form,o])}:m[f]=s}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(d=>d.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{u.loading(!0);try{a.update.type=o;const i=o===z.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===z.View?"view":"edit");const d=ObjectUtil.deepMerge(i?a.update.formDefault:t,{});F.setValue(a.update.form,d,!0),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{u.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(d,m)=>new Promise((f,s)=>{d||(u.fail(y.tCurd("checkFormData")),s(!1)),f()})),a.update.loading=!0;const o=a.update.type===z.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(t).forEach(d=>{if(i.has(d)&&t[d]!=null){const m=new Date(t[d]).getTime();isNaN(m)||(t[d]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(d){console.error(d)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){u.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),u.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=d=>{if(d.children&&d.children.length){d.children.forEach(m=>i(m));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[o]){if(a.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let f=await d.options?.[d.type]?.dataApi?.(a.update.form,a.update.type);if(f){const s=d.options?.[d.type]?.dataPath;!Array.isArray(f)&&s&&(f=ObjectUtil.getPathValue(f,s)),d.options[d.type].data=f,d.options.search[d.type].data=f,d.options.search[d.options.search.type??d.type]||(d.options.search[d.options.search.type??d.type]={}),d.options.search[d.options.search.type??d.type].data=f,d.options.formAdd[d.type].data=f,d.options.formUpdate[d.type].data=f,a.apiDataMap[d.key]=f}}catch{}})();t.push(m)}};return r.option.column.forEach(d=>{i(d)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const d in o){if(d==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){console.log("column.children",i.children),i.children.forEach(f=>{t(f)});return}}else d==="type"?i.type=i.type||o.type:i[d]=ObjectUtil.deepMerge(o[d],i[d]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(f=>{i.options[f]=i.options[f]||ObjectUtil.deepMerge(i.options,{}),i.options[f][i.type]=i.options[f][i.type]||{},i.options[f][i.type].size=f==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(d,m)=>{const f=i.options?.switch;try{f.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!f.tableConfig?.api)return;const s=m[r.option.table?.rowKey];f.loadingMap||(f.loadingMap={}),f.loadingMap[s]||(f.loadingMap[s]={loading:!1}),f.loadingMap[s].loading=!0;const k=m[d]===f.activeValue?f.inactiveValue:f.activeValue,g=f.tableConfig?.api?f.tableConfig.api:r.option.api.update;if(!g)return;try{await g({...m,[d]:k},"switch")}catch{return!1}finally{f.loadingMap[s].loading=!1}return u.success(y.tCurd("operationSuccess")),f.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(s){return console.error(s),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(f=>!u.isFun(f.item.show?.form,a.update.form,a.update.type)).reduce((f,s)=>f+(s.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,d=r.option.form?.defaultSpan||i/2;let m=[];const f=p=>{if(p.children){a.table.column.show.list.push(p.key),p.children.forEach(b=>{f(b)});return}if(a.update.formDefault[p.key]=p.value,p.table.table&&(p.show.table&&a.table.column.show.list.push(p.key),p.table.table&&a.table.column.show.listSource.push(p.key)),!(p.isForm&&typeof p.show?.form=="boolean")||p.show?.form){p.form=p.form||{span:d},p.form.span=p.form.span??d;let b=p.form.span,E=m.reduce((V,N)=>V+N.span,b);const S=m.length;if(m.push({item:p,span:b}),(S===1&&m[0].span===0||E>=i||b===0&&S>1)&&(t.push(m),m=[]),p.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},N=(V[p.type]||V.input)+p.label,U=typeof p.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:p.rules;a.update.rules[p.key]=U.map(O=>{if(O.validator){const Ze=O.validator;return{...O,validator:(_e,ve,et)=>Ze(_e,ve,et,a.update.form)}}return O})}}},s=(p,b)=>{p.isForm=b,Array.isArray(p.children)&&p.children.forEach(E=>s(E,b))};o.column.forEach(p=>{p.isForm=!0,s(p,!0),f(p)}),r.option.table?.column?.forEach(p=>{s(p,!1),f(p)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(p=>p.table?.table),a.search.column.list.sort((p,b)=>p.sort?.search-b.sort?.search),a.table.column.list.sort((p,b)=>p.sort?.table-b.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(p=>{a.search.formDefault[p]=k[p]}),o.column.forEach(p=>{p.show?.search||(a.search.formDefault[p.key]=void 0)});const g=ObjectUtil.deepMerge(a.search.formDefault,{});F.setValue(a.search.form,g,!0)}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),r.form&&e.watch(()=>a.update.form,o=>{Object.keys(a.update.form).forEach(t=>{r.form[t]=a.update.form[t]})},{deep:!0,immediate:!0}),r.searchForm&&e.watch(()=>a.search.form,o=>{Object.keys(a.search.form).forEach(t=>{r.searchForm[t]=a.search.form[t]})},{deep:!0,immediate:!0}),{conf:a,switchConfirmRef:n,ruleFormRef:c,tableRef:l}},P={class:"dialog-footer"},Y=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const c=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=f=>(f?.title&&(l.value=f.title),f?.content&&(a.value=f.content),c.value=!0,new Promise((s,k)=>{o=s,t=k})),d=()=>{c.value=!1,o?.(!0),o=null,t=null},m=()=>{c.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(f,s)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(h.ElDialog),{modelValue:c.value,"onUpdate:modelValue":s[0]||(s[0]=g=>c.value=g),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:f.size},{default:e.withCtx(()=>[e.createElementVNode("span",P,[e.createVNode(e.unref(h.ElButton),{onClick:m},{default:e.withCtx(()=>s[1]||(s[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:d},{default:e.withCtx(()=>s[2]||(s[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),$=(r,n)=>{const c=r.__vccOpts||r;for(const[l,a]of n)c[l]=a;return c},Z={},_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(r,n){return e.openBlock(),e.createElementBlock("svg",_,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"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 ee=$(Z,[["render",v]]),te=["innerHTML"],oe=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(r){const n=r,c=e.computed(()=>typeof n.content=="function"?n.content(n.value):n.content);return(l,a)=>typeof c.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:c.value},null,8,te))}}),ne={},ae={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function le(r,n){return e.openBlock(),e.createElementBlock("svg",ae,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 re=$(ne,[["render",le]]),ie={},de={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function se(r,n){return e.openBlock(),e.createElementBlock("svg",de,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)]))}const ce=$(ie,[["render",se]]),fe={},pe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function me(r,n){return e.openBlock(),e.createElementBlock("svg",pe,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)]))}const he=$(fe,[["render",me]]),ge={class:"row flex-center table-header-label inline"},ye={class:"table-header-tooltip"},ke=["innerHTML"],be=["onClick"],ue={key:1},we=["onClick","innerHTML"],Ce=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=u.isFun,c=e.getCurrentInstance().type;return(l,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[l.conf.table.column.show.list.includes(t.key)&&(t.show?.table===void 0||e.unref(n)(t.show?.table,l.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(l.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",ge,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:t.table?.header?.tooltip},null,8,ke)]),default:e.withCtx(()=>[e.createElementVNode("span",ye,[e.createVNode(re)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,l.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ce,{key:0})):(e.openBlock(),e.createBlock(he,{key:1}))],8,be)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:l.conf,columnList:t.children,option:l.option},e.createSlots({_:2},[e.renderList(l.$slots,(d,m)=>({name:m,fn:e.withCtx(f=>[e.renderSlot(l.$slots,m,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(l.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.conf.update.type===e.unref(u).EDialog.Update&&e.unref(n)(t.show?.form,l.conf.update.form,e.unref(u).EDialog.Update)&&l.option.table?.inlineEdit&&l.conf.update.form[l.option.table?.rowKey]===i[l.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{disabled:l.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(l.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,loading:t.options?.switch?.loadingMap?.[i[l.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:d=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,we))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),Be={class:"row form-item-content",style:{width:"100%"}},Ve={class:"col column form-item-content-item"},Ee={class:"col"},Se=["innerHTML"],Ne=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,c)=>(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",Be,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",Ve,[e.createElementVNode("div",Ee,[e.renderSlot(n.$slots,"form-"+n.item.item.key,{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),e.mergeProps({key:l.value,ref_for:!0},l,e.toHandlers(l.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),e.mergeProps({key:l.value,ref_for:!0},l,e.toHandlers(l.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&(e.unref(B).customComponent[n.item.item.type]||e.unref(B).customComponent[n.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]?.form||e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[6]||(c[6]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,Se)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),De={},ze={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function $e(r,n){return e.openBlock(),e.createElementBlock("svg",ze,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)]))}const Fe=$(De,[["render",$e]]),Te={},Oe={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ue(r,n){return e.openBlock(),e.createElementBlock("svg",Oe,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)]))}const Me=$(Te,[["render",Ue]]),H=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(r){const n=r,c=e.computed({get:()=>n.conf.search.form?.[n.item?.key],set:l=>{n.item?.key!==void 0&&(n.conf.search.form[n.item.key]=l)}});return(l,a)=>e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=o=>c.value=o)},l.item.options?.search?.[l.type??""],e.toHandlers(l.item.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:1,modelValue:c.value,"onUpdate:modelValue":a[1]||(a[1]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.input||l.item.options?.input,e.toHandlers(l.item.options?.search?.input?.on||l.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.switch||l.item.options?.switch,e.toHandlers(l.item.options?.search?.switch?.on||l.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.activeValue,label:l.item.options?.switch?.activeText,value:l.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.inactiveValue,label:l.item.options?.switch?.inactiveText,value:l.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:3,modelValue:c.value,"onUpdate:modelValue":a[3]||(a[3]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.select||l.item.options?.select,e.toHandlers(l.item.options?.search?.select?.on||l.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.search?.select?.data||l.item.options?.select?.data||[],o=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:4,modelValue:c.value,"onUpdate:modelValue":a[4]||(a[4]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.radio||l.item.options?.radio,e.toHandlers(l.item.options?.search?.radio?.on||l.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,o=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:5,modelValue:c.value,"onUpdate:modelValue":a[5]||(a[5]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.datetime||l.item.options?.datetime,e.toHandlers(l.item.options?.search?.datetime?.on||l.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:c.value,"onUpdate:modelValue":a[6]||(a[6]=o=>c.value=o)},l.item.options?.search?.[l.type]||l.item.options?.[l.type],e.toHandlers(l.item.options?.search?.[l.type]?.on||l.item.options?.[l.type]?.on||{}),{disabled:l.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),Le={key:0,class:"relative curd-search fit-width"},He={class:"mb-10 flex justify-between items-center fit-width"},Ae={class:"flex items-center",style:{gap:"10px"}},je={key:0},Ie={key:1},Re={key:2},Ke={class:"export-btn"},xe={key:1,class:"export-btn"},We={class:"flex items-center table-tools-right",style:{gap:"10px"}},qe={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Je={class:"dialog-footer"},Ge={key:0},Qe={key:1},Xe={class:"dialog-footer"},A=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:{}},searchForm:{default:{}}},setup(r,{expose:n}){const c=u.EDialog,l=r,a=u.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:d}=X(l);return n({conf:o}),(m,f)=>{const s=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(e.unref(h.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.key},[e.renderSlot(m.$slots,"search-"+g.key+"-start",{row:e.unref(o).search.form}),(typeof g.show?.search=="function"?g.show?.search(e.unref(o).search.form):g.show?.search)?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0,label:g.text?.search?.label??g.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+g.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+g.key,{row:e.unref(o).search.form},()=>[g.options?.search?.type?(e.openBlock(),e.createBlock(H,{key:0,item:g,conf:e.unref(o),type:g.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(H,{key:1,item:g,conf:e.unref(o),type:g.type},null,8,["item","conf","type"]))]),e.renderSlot(m.$slots,"search-"+g.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+g.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.createElementVNode("div",Ae,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:f[0]||(f[0]=g=>e.unref(o).update.open(e.unref(c).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:f[1]||(f[1]=g=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(e.unref(h.ElButton),{type:"warning",onClick:f[2]||(f[2]=g=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(h.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(h.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Ke,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:f[3]||(f[3]=g=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",We,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":f[4]||(f[4]=g=>e.unref(o).page.num=g),"page-size":e.unref(o).page.size,"onUpdate:pageSize":f[5]||(f[5]=g=>e.unref(o).page.size=g),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(s,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:f[6]||(f[6]=(...g)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...g))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(Fe,{key:0})):(e.openBlock(),e.createBlock(Me,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:f[7]||(f[7]=(...g)=>e.unref(o).table.getList&&e.unref(o).table.getList(...g))},[e.createVNode(ee)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(h.ElTable),e.mergeProps({ref_key:"tableRef",ref:d,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof r.option.table?.index=="object"?r.option.table?.index?.show:r.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof r.option.table?.index=="object"?r.option.table?.index:{},e.toHandlers(typeof r.option.table?.index=="object"?r.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(Ce,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(g,p)=>({name:p,fn:e.withCtx(b=>[e.renderSlot(m.$slots,p,e.normalizeProps(e.guardReactiveProps(b||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:2,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:g})=>[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:g}),e.unref(o).update.type===e.unref(c).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[l.option.table?.rowKey]===g[l.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(h.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:g})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,link:"",type:"primary",onClick:p=>e.unref(o).update.open(e.unref(c).Add,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,link:"",type:"primary",onClick:p=>e.unref(o).update.open(e.unref(c).View,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:2,link:"",type:"warning",onClick:p=>e.unref(o).update.open(e.unref(c).Update,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:3,link:"",type:"danger",onClick:p=>e.unref(o).remove.open([g])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:g})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",qe,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":f[8]||(f[8]=g=>e.unref(o).page.num=g),"page-size":e.unref(o).page.size,"onUpdate:pageSize":f[9]||(f[9]=g=>e.unref(o).page.size=g),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(m.$slots,"box-right")],2),e.createVNode(e.unref(h.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":f[10]||(f[10]=g=>e.unref(o).update.show=g),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Je,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,g=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const p=[],b=E=>{E?.item?.children?b(E.item.children):p.push(...E.map(S=>S.item?.show?.form))};return b(g),p})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,p=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(p.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([p.item.form.span>0?`col-${e.unref(o).getColumnSpan(p,g)}`:"col",`form-item-col-${p.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.item.children?p.children:[p],b=>(e.openBlock(),e.createBlock(Ne,{key:b.item.key,conf:e.unref(o),item:b},e.createSlots({_:2},[e.renderList(m.$slots,(E,S)=>({name:S,fn:e.withCtx(V=>[e.renderSlot(m.$slots,S,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(h.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":f[11]||(f[11]=g=>e.unref(o).remove.show=g),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Xe,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[r.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(oe,{content:r.option.dialog?.delete?.content,value:e.unref(o).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Qe,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Y,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Pe{static async download(n,c="download.png"){const l=document.createElement("a");l.style.display="none",l.href=n,l.setAttribute("download",c),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,c)=>{const l=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(l),o=document.createElement("a");o.href=a,o.download=`${c||"config"}.json`,o.click()};static importFile=async n=>new Promise((c,l)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){u.fail("未选择文件"),l("未选择文件");return}const d=new FileReader;d.onload=async m=>{const f=o==".json"?JSON.parse(m.target.result):m.target.result;c(f)},d.onerror=()=>{u.fail("文件读取失败"),l("文件读取失败")},d.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const j=(r,n)=>{if(r.component("TCurd",A),r.component("TFormList",T),r.component("TColumn",M),n?.customComponent){B.customComponent=n.customComponent;for(const c in n.customComponent)r.component(c,n.customComponent[c])}},Ye={install:j};C.ArrUtil=D,C.ExcelUtil=L,C.TColumn=M,C.TCurd=A,C.TFile=Pe,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=T,C.TSys=u,C.default=Ye,C.install=j,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(C,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],h):(C=typeof globalThis<"u"?globalThis:C||self,h(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,h,tt,e){"use strict";class u{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...c)=>Array.isArray(n)?n.some(l=>typeof l=="function"?l(...c):l):typeof n=="function"?n(...c):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},c=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(c).length?c:{}};static moduleObj={};static loadModule=async n=>{if(!u.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const c=await u.moduleObj[n]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(n,c,l={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:c},l);h.ElMessage(o),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,c={})=>{this.showMessage(n,"error",c)};static success=(n,c={})=>{this.showMessage(n,"success",c)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,c="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=h.ElLoading.service({lock:!0,text:c,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,c=!0)=>{if(c){let l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}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(c,l)=>{let a=document.getElementById(n.id);const o=await u.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");c(i)})}catch(t){l(t)}})}class w{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,c)=>{const l=n.column.find(o=>o.key===c),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(n,c,l)=>{const a=B.findOptions(n,c);a&&(a.data=l)};static form={openBefore:{parentId:(n,c,l,a)=>{const o=w.config.table.rowKey;n?c.type===u.EDialog.Add?(c.form.parentId=n[o],c.form.sort=n.children.length+1):c.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=l.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:l}])}}}}function ot(r){return r}const I={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...c){if(typeof n=="function")return n(...c);n=String(n);let l=0;return n.replace(/{([^}]+)}/g,(a,o)=>l<c.length?String(c[l++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...c){return this.t(this.curd[n],...c)}static curd=I}class D{static getIdFun=()=>StrUtil.uuid();static setId=(n,c,l)=>{c[n]||(c[n]=[]);const a=w.config.table.rowKey;c[n].forEach(o=>{l.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=D.getIdFun())})};static add=(n,c,l,a)=>{const o=JSONUtil.cp(l);D.setId(n,c,l);const t=w.config.table.rowKey;c[n].push(o.reduce((i,d)=>{let m=d.default??"";return d.type==="number"&&(m=d.default??0),d.type==="boolean"&&(m=d.default??!1),d.type==="time"&&(m=d.default??new Date),i[d.value]=m,i},{[t]:D.getIdFun()})),a?.(c)};static remove=(n,c,l,a)=>{const o=w.config.table.rowKey;c[n]=c[n].filter(t=>t[o]!==l[o]),a?.(c)};static getNoIdData=(n,c)=>{const l=JSONUtil.cp(n),a=w.config.table.rowKey;return l.forEach(o=>{o[a]&&delete o[a],c&&o[c]&&D.getNoIdData(o[c],c)}),l}}const R={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},K={key:0},x={class:"row items-center",style:{gap:"10px",width:"100%"}},W={key:1},T=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(r,{emit:n}){const c=r,l=e.reactive({show:!1,add:(o,t,i)=>{D.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{D.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{D.setId(c.field,c.row,c.itemFields),l.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),d=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,f=>(e.openBlock(),e.createBlock(d,{modelValue:m[f.value],"onUpdate:modelValue":s=>m[f.value]=s,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:f[r.label]||f[r.value],onChange:t[1]||(t[1]=s=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:f=>l.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),q={class:"row form-item-content",style:{width:"100%"}},J={class:"col"},G={class:"col"},Q=["innerHTML"],M=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const c=u.isFun,l=u.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||l.Add,formColumn:[],getDisabled:i=>{if(t.type===l.View)return i.disabled?.view===void 0?!0:u.isFun(i.disabled?.view,t.form);const d=i.disabled?.[t.type===l.Add?"create":"update"];return u.isFun(d,t.form)},getBind:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,d)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,f=o.option.form?.defaultSpan||m/2,k=d.filter(g=>!u.isFun(g.item.show?.form,t.form,t.type)).reduce((g,p)=>g+(p.item.form?.span||f),0);return(i.item.form?.span||f)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const d=[],m=o.option.form?.maxSpan||12,f=o.option.form?.defaultSpan||m/2;let s=[];const k=p=>{if(p.children){p.children.forEach(b=>{k(b)});return}if(t.formDefault[p.key]=p.value,p.isForm&&(typeof p.show?.form!="boolean"||p.show?.form)){p.form=p.form||{span:f},p.form.span=p.form.span??f;const b=p.form.span,E=s.reduce((V,N)=>V+N.span,b),S=s.length;if(s.push({item:p,span:b}),(S===1&&s[0].span===0||E>=m||b===0&&S>1)&&(d.push(s),s=[]),p.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},N=(V[p.type]||V.input)+p.label;t.rules[p.key]=typeof p.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:p.rules}}},g=(p,b)=>{p.isForm=b,Array.isArray(p.children)&&p.children.forEach(E=>g(E,b))};i.column.forEach(p=>{g(p,!0),k(p)}),s.length>0&&d.push(s),t.formColumn=d,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f},[e.unref(c)(m.map(s=>s.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.item.key},[e.unref(c)(s.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.item.form.span>0?`col-${t.getColumnSpan(s,m)}`:"col",`form-item-col-${s.item.key}`])},[e.createVNode(e.unref(h.ElFormItem),{label:s.item.text?.form?.label??s.item.label,prop:s.item.key,"label-width":s.item.text?.form?.label==""?0:s.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.renderSlot(i.$slots,"form-"+s.item.key+"-start",{row:t.form,item:s.item}),e.createElementVNode("div",J,[e.createElementVNode("div",G,[e.renderSlot(i.$slots,"form-"+s.item.key,{row:t.form,item:s.item},()=>[s.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="list"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:4,row:t.form,field:s.item.key,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):s.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type&&(e.unref(B).customComponent[s.item.type]||e.unref(B).customComponent[s.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[s.item.type]?.form||e.unref(B).customComponent[s.item.type]),e.mergeProps({key:7,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+s.item.key+"-right",{row:t.form,item:s.item})]),e.renderSlot(i.$slots,"form-"+s.item.key+"-tip",{row:t.form,item:s.item},()=>[s.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof s.item.form?.tipText=="function"?s.item.form?.tipText(t.form,t.type):s.item.form?.tipText},null,8,Q)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+s.item.key+"-end",{row:t.form,item:s.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class L{static exportToExcel=async(n,c,l)=>{if(!n||n.length===0)return;const a=await u.loadModule("xlsx"),o=n.map(d=>{const m={};return c.forEach(f=>{m[f.label]=d[f.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${l}.xlsx`)}}class ${static delAllKey=n=>{Object.keys(n).forEach(c=>{delete n[c]})};static setValue=(n,c,l=!1)=>{l&&$.delAllKey(n),Object.keys(c).forEach(a=>{n[a]!==c[a]&&(n[a]=c[a])})}}const z=u.EDialog,X=r=>{const n=e.ref(),c=e.ref(),l=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(i=>{r.option.search?.resetMode==="none"?o[i]=void 0:o[i]=a.search.formDefault[i]});const t=ObjectUtil.deepMerge(o,{});$.setValue(a.search.form,t,!0),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(d=>{i.push(d[r.option.table.rowKey]),d.children&&d.children.length>0&&(i=i.concat(o(d.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!o),d.table?.header?.groupKey!==void 0&&(d.table.header.show=o),Array.isArray(d.children)&&d.children.length>0&&t(d.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list,t=JSONUtil.cp(a.table.selection.list);try{await a.initApiData("init");let i={};if(a.table.sort.prop){const{props:b,order:E}=w.config.table.sort;i={[b.field]:a.table.sort.prop,[E.field]:a.table.sort.order}}const d=await o({...a.page.getQuery(),...i}),m=w.config.field.result,f=d.data||{[m.list]:d};let s=(Array.isArray(f[m.list]),f[m.list]);const k=a.update.formColumn.flat(),p=ObjectUtil.deepMerge({data:s},{}).data.map(b=>(Object.keys(b).forEach(S=>{const V=k.find(N=>N.item.key===S);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=N=>V.item.options[V.item.type].data?.find(U=>U.value==N[S])?.label||N[S]))}),b));a.table.data=r.option.data?await r.option.data(p,s):p,a.page.total=f[m.total]||0,setTimeout(()=>{a.table.selection.setList(t)},20)}catch(i){console.error(i)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=l.value;if(i?.clearSelection(),!i||!o?.length)return;const d=r.option.table?.rowKey,m=f=>{const s=k=>{for(const g of k){if(d!=null&&d!==""){if(g[d]===f[d])return g}else if(g===f)return g;if(Array.isArray(g.children)&&g.children.length){const p=s(g.children);if(p!==void 0)return p}}};return s(a.table.data)};o.forEach(f=>{const s=m(f);if(s)if(t){const k=()=>{i.toggleRowSelection(s,!0,!1)};t(f)!==!1&&k()}else i.toggleRowSelection(s,!0,!1)})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?(a.table.sort.order="",a.table.sort.prop=""):a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const d=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(d),L.exportToExcel(d.data,d.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw u.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw u.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:z.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>{if(r.option.table?.editMode&&t)return o.disabled?.table===void 0?!1:u.isFun(o.disabled?.table,a.update.form);if(a.update.type===z.View)return o.disabled?.view===void 0?!0:u.isFun(o.disabled?.view,a.update.form);const i=o.disabled?.[a.update.type===z.Add?"create":"update"];return u.isFun(i,a.update.form)},getBind:o=>o.options?.[a.update.type===z.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const d=o.options?.[a.update.type===z.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(d).forEach(f=>{const s=d[f];typeof s=="function"?m[f]=function(...k){return s.apply(this,[...k,t||a.update.form,o])}:m[f]=s}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(d=>d.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{u.loading(!0);try{a.update.type=o;const i=o===z.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===z.View?"view":"edit");const d=ObjectUtil.deepMerge(i?a.update.formDefault:t,{});$.setValue(a.update.form,d,!0),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{u.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(d,m)=>new Promise((f,s)=>{d||(u.fail(y.tCurd("checkFormData")),s(!1)),f()})),a.update.loading=!0;const o=a.update.type===z.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(t).forEach(d=>{if(i.has(d)&&t[d]!=null){const m=new Date(t[d]).getTime();isNaN(m)||(t[d]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(d){console.error(d)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){u.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),u.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=d=>{if(d.children&&d.children.length){d.children.forEach(m=>i(m));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[o]){if(a.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let f=await d.options?.[d.type]?.dataApi?.(a.update.form,a.update.type);if(f){const s=d.options?.[d.type]?.dataPath;!Array.isArray(f)&&s&&(f=ObjectUtil.getPathValue(f,s)),d.options[d.type].data=f,d.options.search[d.type].data=f,d.options.search[d.options.search.type??d.type]||(d.options.search[d.options.search.type??d.type]={}),d.options.search[d.options.search.type??d.type].data=f,d.options.formAdd[d.type].data=f,d.options.formUpdate[d.type].data=f,a.apiDataMap[d.key]=f}}catch{}})();t.push(m)}};return r.option.column.forEach(d=>{i(d)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const d in o){if(d==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){i.children.forEach(f=>{t(f)});return}}else d==="type"?i.type=i.type||o.type:i[d]=ObjectUtil.deepMerge(o[d],i[d]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(f=>{i.options[f]=i.options[f]||ObjectUtil.deepMerge(i.options,{}),i.options[f][i.type]=i.options[f][i.type]||{},i.options[f][i.type].size=f==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(d,m)=>{const f=i.options?.switch;try{f.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!f.tableConfig?.api)return;const s=m[r.option.table?.rowKey];f.loadingMap||(f.loadingMap={}),f.loadingMap[s]||(f.loadingMap[s]={loading:!1}),f.loadingMap[s].loading=!0;const k=m[d]===f.activeValue?f.inactiveValue:f.activeValue,g=f.tableConfig?.api?f.tableConfig.api:r.option.api.update;if(!g)return;try{await g({...m,[d]:k},"switch")}catch{return!1}finally{f.loadingMap[s].loading=!1}return u.success(y.tCurd("operationSuccess")),f.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(s){return console.error(s),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(f=>!u.isFun(f.item.show?.form,a.update.form,a.update.type)).reduce((f,s)=>f+(s.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,d=r.option.form?.defaultSpan||i/2;let m=[];const f=p=>{if(p.children){a.table.column.show.list.push(p.key),p.children.forEach(b=>{f(b)});return}if(a.update.formDefault[p.key]=p.value,p.table.table&&(p.show.table&&a.table.column.show.list.push(p.key),p.table.table&&a.table.column.show.listSource.push(p.key)),!(p.isForm&&typeof p.show?.form=="boolean")||p.show?.form){p.form=p.form||{span:d},p.form.span=p.form.span??d;let b=p.form.span,E=m.reduce((V,N)=>V+N.span,b);const S=m.length;if(m.push({item:p,span:b}),(S===1&&m[0].span===0||E>=i||b===0&&S>1)&&(t.push(m),m=[]),p.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},N=(V[p.type]||V.input)+p.label,U=typeof p.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:p.rules;a.update.rules[p.key]=U.map(O=>{if(O.validator){const Ze=O.validator;return{...O,validator:(_e,ve,et)=>Ze(_e,ve,et,a.update.form)}}return O})}}},s=(p,b)=>{p.isForm=b,Array.isArray(p.children)&&p.children.forEach(E=>s(E,b))};o.column.forEach(p=>{p.isForm=!0,s(p,!0),f(p)}),r.option.table?.column?.forEach(p=>{s(p,!1),f(p)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(p=>p.table?.table),a.search.column.list.sort((p,b)=>p.sort?.search-b.sort?.search),a.table.column.list.sort((p,b)=>p.sort?.table-b.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(p=>{a.search.formDefault[p]=k[p]}),o.column.forEach(p=>{p.show?.search||(a.search.formDefault[p.key]=void 0)});const g=ObjectUtil.deepMerge(a.search.formDefault,{});$.setValue(a.search.form,g,!0)}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),r.form&&e.watch(()=>a.update.form,o=>{Object.keys(a.update.form).forEach(t=>{r.form[t]=a.update.form[t]})},{deep:!0,immediate:!0}),r.searchForm&&e.watch(()=>a.search.form,o=>{Object.keys(a.search.form).forEach(t=>{r.searchForm[t]=a.search.form[t]})},{deep:!0,immediate:!0}),{conf:a,switchConfirmRef:n,ruleFormRef:c,tableRef:l}},P={class:"dialog-footer"},Y=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const c=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=f=>(f?.title&&(l.value=f.title),f?.content&&(a.value=f.content),c.value=!0,new Promise((s,k)=>{o=s,t=k})),d=()=>{c.value=!1,o?.(!0),o=null,t=null},m=()=>{c.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(f,s)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(h.ElDialog),{modelValue:c.value,"onUpdate:modelValue":s[0]||(s[0]=g=>c.value=g),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:f.size},{default:e.withCtx(()=>[e.createElementVNode("span",P,[e.createVNode(e.unref(h.ElButton),{onClick:m},{default:e.withCtx(()=>s[1]||(s[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:d},{default:e.withCtx(()=>s[2]||(s[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),F=(r,n)=>{const c=r.__vccOpts||r;for(const[l,a]of n)c[l]=a;return c},Z={},_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(r,n){return e.openBlock(),e.createElementBlock("svg",_,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"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 ee=F(Z,[["render",v]]),te=["innerHTML"],oe=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(r){const n=r,c=e.computed(()=>typeof n.content=="function"?n.content(n.value):n.content);return(l,a)=>typeof c.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:c.value},null,8,te))}}),ne={},ae={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function le(r,n){return e.openBlock(),e.createElementBlock("svg",ae,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 re=F(ne,[["render",le]]),ie={},de={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function se(r,n){return e.openBlock(),e.createElementBlock("svg",de,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)]))}const ce=F(ie,[["render",se]]),fe={},pe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function me(r,n){return e.openBlock(),e.createElementBlock("svg",pe,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)]))}const he=F(fe,[["render",me]]),ge={class:"row flex-center table-header-label inline"},ye={class:"table-header-tooltip"},ke=["innerHTML"],be=["onClick"],ue={key:1},we=["onClick","innerHTML"],Ce=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=u.isFun,c=e.getCurrentInstance().type;return(l,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[l.conf.table.column.show.list.includes(t.key)&&(t.show?.table===void 0||e.unref(n)(t.show?.table,l.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(l.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",ge,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:t.table?.header?.tooltip},null,8,ke)]),default:e.withCtx(()=>[e.createElementVNode("span",ye,[e.createVNode(re)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,l.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ce,{key:0})):(e.openBlock(),e.createBlock(he,{key:1}))],8,be)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:l.conf,columnList:t.children,option:l.option},e.createSlots({_:2},[e.renderList(l.$slots,(d,m)=>({name:m,fn:e.withCtx(f=>[e.renderSlot(l.$slots,m,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(l.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.conf.update.type===e.unref(u).EDialog.Update&&e.unref(n)(t.show?.form,l.conf.update.form,e.unref(u).EDialog.Update)&&l.option.table?.inlineEdit&&l.conf.update.form[l.option.table?.rowKey]===i[l.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{disabled:l.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(l.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,loading:t.options?.switch?.loadingMap?.[i[l.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:d=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,we))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),Be={class:"row form-item-content",style:{width:"100%"}},Ve={class:"col column form-item-content-item"},Ee={class:"col"},Se=["innerHTML"],Ne=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,c)=>(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",Be,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",Ve,[e.createElementVNode("div",Ee,[e.renderSlot(n.$slots,"form-"+n.item.item.key,{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),e.mergeProps({key:l.value,ref_for:!0},l,e.toHandlers(l.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),e.mergeProps({key:l.value,ref_for:!0},l,e.toHandlers(l.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&(e.unref(B).customComponent[n.item.item.type]||e.unref(B).customComponent[n.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]?.form||e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[6]||(c[6]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,Se)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),De={},ze={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Fe(r,n){return e.openBlock(),e.createElementBlock("svg",ze,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)]))}const $e=F(De,[["render",Fe]]),Te={},Oe={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ue(r,n){return e.openBlock(),e.createElementBlock("svg",Oe,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)]))}const Me=F(Te,[["render",Ue]]),H=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(r){const n=r,c=e.computed({get:()=>n.conf.search.form?.[n.item?.key],set:l=>{n.item?.key!==void 0&&(n.conf.search.form[n.item.key]=l)}});return(l,a)=>e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=o=>c.value=o)},l.item.options?.search?.[l.type??""],e.toHandlers(l.item.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:1,modelValue:c.value,"onUpdate:modelValue":a[1]||(a[1]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.input||l.item.options?.input,e.toHandlers(l.item.options?.search?.input?.on||l.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.switch||l.item.options?.switch,e.toHandlers(l.item.options?.search?.switch?.on||l.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.activeValue,label:l.item.options?.switch?.activeText,value:l.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.inactiveValue,label:l.item.options?.switch?.inactiveText,value:l.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:3,modelValue:c.value,"onUpdate:modelValue":a[3]||(a[3]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.select||l.item.options?.select,e.toHandlers(l.item.options?.search?.select?.on||l.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.search?.select?.data||l.item.options?.select?.data||[],o=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:4,modelValue:c.value,"onUpdate:modelValue":a[4]||(a[4]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.radio||l.item.options?.radio,e.toHandlers(l.item.options?.search?.radio?.on||l.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,o=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:5,modelValue:c.value,"onUpdate:modelValue":a[5]||(a[5]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.datetime||l.item.options?.datetime,e.toHandlers(l.item.options?.search?.datetime?.on||l.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:c.value,"onUpdate:modelValue":a[6]||(a[6]=o=>c.value=o)},l.item.options?.search?.[l.type]||l.item.options?.[l.type],e.toHandlers(l.item.options?.search?.[l.type]?.on||l.item.options?.[l.type]?.on||{}),{disabled:l.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),Le={key:0,class:"relative curd-search fit-width"},He={class:"mb-10 flex justify-between items-center fit-width"},Ae={class:"flex items-center",style:{gap:"10px"}},je={key:0},Ie={key:1},Re={key:2},Ke={class:"export-btn"},xe={key:1,class:"export-btn"},We={class:"flex items-center table-tools-right",style:{gap:"10px"}},qe={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Je={class:"dialog-footer"},Ge={key:0},Qe={key:1},Xe={class:"dialog-footer"},A=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:{}},searchForm:{default:{}}},setup(r,{expose:n}){const c=u.EDialog,l=r,a=u.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:d}=X(l);return n({conf:o}),(m,f)=>{const s=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(e.unref(h.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.key},[e.renderSlot(m.$slots,"search-"+g.key+"-start",{row:e.unref(o).search.form}),(typeof g.show?.search=="function"?g.show?.search(e.unref(o).search.form):g.show?.search)?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0,label:g.text?.search?.label??g.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+g.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+g.key,{row:e.unref(o).search.form},()=>[g.options?.search?.type?(e.openBlock(),e.createBlock(H,{key:0,item:g,conf:e.unref(o),type:g.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(H,{key:1,item:g,conf:e.unref(o),type:g.type},null,8,["item","conf","type"]))]),e.renderSlot(m.$slots,"search-"+g.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+g.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.createElementVNode("div",Ae,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:f[0]||(f[0]=g=>e.unref(o).update.open(e.unref(c).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:f[1]||(f[1]=g=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(e.unref(h.ElButton),{type:"warning",onClick:f[2]||(f[2]=g=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(h.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(h.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Ke,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:f[3]||(f[3]=g=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",We,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":f[4]||(f[4]=g=>e.unref(o).page.num=g),"page-size":e.unref(o).page.size,"onUpdate:pageSize":f[5]||(f[5]=g=>e.unref(o).page.size=g),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(s,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:f[6]||(f[6]=(...g)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...g))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock($e,{key:0})):(e.openBlock(),e.createBlock(Me,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:f[7]||(f[7]=(...g)=>e.unref(o).table.getList&&e.unref(o).table.getList(...g))},[e.createVNode(ee)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(h.ElTable),e.mergeProps({ref_key:"tableRef",ref:d,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof r.option.table?.index=="object"?r.option.table?.index?.show:r.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof r.option.table?.index=="object"?r.option.table?.index:{},e.toHandlers(typeof r.option.table?.index=="object"?r.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(Ce,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(g,p)=>({name:p,fn:e.withCtx(b=>[e.renderSlot(m.$slots,p,e.normalizeProps(e.guardReactiveProps(b||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:2,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:g})=>[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:g}),e.unref(o).update.type===e.unref(c).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[l.option.table?.rowKey]===g[l.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(h.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:g})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,link:"",type:"primary",onClick:p=>e.unref(o).update.open(e.unref(c).Add,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,link:"",type:"primary",onClick:p=>e.unref(o).update.open(e.unref(c).View,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:2,link:"",type:"warning",onClick:p=>e.unref(o).update.open(e.unref(c).Update,g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,g)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:3,link:"",type:"danger",onClick:p=>e.unref(o).remove.open([g])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:g})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",qe,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":f[8]||(f[8]=g=>e.unref(o).page.num=g),"page-size":e.unref(o).page.size,"onUpdate:pageSize":f[9]||(f[9]=g=>e.unref(o).page.size=g),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(m.$slots,"box-right")],2),e.createVNode(e.unref(h.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":f[10]||(f[10]=g=>e.unref(o).update.show=g),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Je,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,g=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const p=[],b=E=>{E?.item?.children?b(E.item.children):p.push(...E.map(S=>S.item?.show?.form))};return b(g),p})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,p=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(p.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([p.item.form.span>0?`col-${e.unref(o).getColumnSpan(p,g)}`:"col",`form-item-col-${p.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.item.children?p.children:[p],b=>(e.openBlock(),e.createBlock(Ne,{key:b.item.key,conf:e.unref(o),item:b},e.createSlots({_:2},[e.renderList(m.$slots,(E,S)=>({name:S,fn:e.withCtx(V=>[e.renderSlot(m.$slots,S,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(h.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":f[11]||(f[11]=g=>e.unref(o).remove.show=g),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Xe,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[r.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(oe,{content:r.option.dialog?.delete?.content,value:e.unref(o).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Qe,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Y,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Pe{static async download(n,c="download.png"){const l=document.createElement("a");l.style.display="none",l.href=n,l.setAttribute("download",c),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,c)=>{const l=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(l),o=document.createElement("a");o.href=a,o.download=`${c||"config"}.json`,o.click()};static importFile=async n=>new Promise((c,l)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){u.fail("未选择文件"),l("未选择文件");return}const d=new FileReader;d.onload=async m=>{const f=o==".json"?JSON.parse(m.target.result):m.target.result;c(f)},d.onerror=()=>{u.fail("文件读取失败"),l("文件读取失败")},d.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const j=(r,n)=>{if(r.component("TCurd",A),r.component("TFormList",T),r.component("TColumn",M),n?.customComponent){B.customComponent=n.customComponent;for(const c in n.customComponent)r.component(c,n.customComponent[c])}},Ye={install:j};C.ArrUtil=D,C.ExcelUtil=L,C.TColumn=M,C.TCurd=A,C.TFile=Pe,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=T,C.TSys=u,C.default=Ye,C.install=j,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -24,11 +24,11 @@ declare const conf: {
|
|
|
24
24
|
value?: any;
|
|
25
25
|
children?: /*elided*/ any[] | undefined;
|
|
26
26
|
disabled?: {
|
|
27
|
-
table?: boolean | undefined;
|
|
28
|
-
create?: boolean | undefined;
|
|
29
|
-
update?: boolean | undefined;
|
|
30
|
-
search?: boolean | undefined;
|
|
31
|
-
view?: boolean | undefined;
|
|
27
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
28
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
29
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
30
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
31
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
32
32
|
} | undefined;
|
|
33
33
|
options?: {
|
|
34
34
|
[x: string]: {
|
|
@@ -439,7 +439,7 @@ declare const conf: {
|
|
|
439
439
|
span: number;
|
|
440
440
|
children?: /*elided*/ any[] | undefined;
|
|
441
441
|
}[][];
|
|
442
|
-
getDisabled: (item: CurdConfigColumn) =>
|
|
442
|
+
getDisabled: (item: CurdConfigColumn) => any;
|
|
443
443
|
getBind: (item: CurdConfigColumn) => Partial<{
|
|
444
444
|
on: Record<string, any>;
|
|
445
445
|
label: string;
|
|
@@ -466,11 +466,11 @@ declare var __VLS_7: {
|
|
|
466
466
|
value?: any;
|
|
467
467
|
children?: /*elided*/ any[] | undefined;
|
|
468
468
|
disabled?: {
|
|
469
|
-
table?: boolean | undefined;
|
|
470
|
-
create?: boolean | undefined;
|
|
471
|
-
update?: boolean | undefined;
|
|
472
|
-
search?: boolean | undefined;
|
|
473
|
-
view?: boolean | undefined;
|
|
469
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
470
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
471
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
472
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
473
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
474
474
|
} | undefined;
|
|
475
475
|
options?: {
|
|
476
476
|
[x: string]: {
|
|
@@ -886,11 +886,11 @@ declare var __VLS_7: {
|
|
|
886
886
|
value?: any;
|
|
887
887
|
children?: /*elided*/ any[] | undefined;
|
|
888
888
|
disabled?: {
|
|
889
|
-
table?: boolean | undefined;
|
|
890
|
-
create?: boolean | undefined;
|
|
891
|
-
update?: boolean | undefined;
|
|
892
|
-
search?: boolean | undefined;
|
|
893
|
-
view?: boolean | undefined;
|
|
889
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
890
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
891
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
892
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
893
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
894
894
|
} | undefined;
|
|
895
895
|
options?: {
|
|
896
896
|
[x: string]: {
|
|
@@ -1306,11 +1306,11 @@ declare var __VLS_7: {
|
|
|
1306
1306
|
value?: any;
|
|
1307
1307
|
children?: /*elided*/ any[] | undefined;
|
|
1308
1308
|
disabled?: {
|
|
1309
|
-
table?: boolean | undefined;
|
|
1310
|
-
create?: boolean | undefined;
|
|
1311
|
-
update?: boolean | undefined;
|
|
1312
|
-
search?: boolean | undefined;
|
|
1313
|
-
view?: boolean | undefined;
|
|
1309
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
1310
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
1311
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
1312
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
1313
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
1314
1314
|
} | undefined;
|
|
1315
1315
|
options?: {
|
|
1316
1316
|
[x: string]: {
|
|
@@ -1726,11 +1726,11 @@ declare var __VLS_7: {
|
|
|
1726
1726
|
value?: any;
|
|
1727
1727
|
children?: /*elided*/ any[] | undefined;
|
|
1728
1728
|
disabled?: {
|
|
1729
|
-
table?: boolean | undefined;
|
|
1730
|
-
create?: boolean | undefined;
|
|
1731
|
-
update?: boolean | undefined;
|
|
1732
|
-
search?: boolean | undefined;
|
|
1733
|
-
view?: boolean | undefined;
|
|
1729
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
1730
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
1731
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
1732
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
1733
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
1734
1734
|
} | undefined;
|
|
1735
1735
|
options?: {
|
|
1736
1736
|
[x: string]: {
|
|
@@ -2146,11 +2146,11 @@ declare var __VLS_7: {
|
|
|
2146
2146
|
value?: any;
|
|
2147
2147
|
children?: /*elided*/ any[] | undefined;
|
|
2148
2148
|
disabled?: {
|
|
2149
|
-
table?: boolean | undefined;
|
|
2150
|
-
create?: boolean | undefined;
|
|
2151
|
-
update?: boolean | undefined;
|
|
2152
|
-
search?: boolean | undefined;
|
|
2153
|
-
view?: boolean | undefined;
|
|
2149
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
2150
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
2151
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
2152
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
2153
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
2154
2154
|
} | undefined;
|
|
2155
2155
|
options?: {
|
|
2156
2156
|
[x: string]: {
|
|
@@ -2682,11 +2682,11 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
2682
2682
|
value?: any;
|
|
2683
2683
|
children?: /*elided*/ any[] | undefined;
|
|
2684
2684
|
disabled?: {
|
|
2685
|
-
table?: boolean | undefined;
|
|
2686
|
-
create?: boolean | undefined;
|
|
2687
|
-
update?: boolean | undefined;
|
|
2688
|
-
search?: boolean | undefined;
|
|
2689
|
-
view?: boolean | undefined;
|
|
2685
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
2686
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
2687
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
2688
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
2689
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
2690
2690
|
} | undefined;
|
|
2691
2691
|
options?: {
|
|
2692
2692
|
[x: string]: {
|
|
@@ -3097,7 +3097,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
3097
3097
|
span: number;
|
|
3098
3098
|
children?: /*elided*/ any[] | undefined;
|
|
3099
3099
|
}[][];
|
|
3100
|
-
getDisabled: (item: CurdConfigColumn) =>
|
|
3100
|
+
getDisabled: (item: CurdConfigColumn) => any;
|
|
3101
3101
|
getBind: (item: CurdConfigColumn) => Partial<{
|
|
3102
3102
|
on: Record<string, any>;
|
|
3103
3103
|
label: string;
|
|
@@ -15,11 +15,11 @@ declare var __VLS_7: string, __VLS_8: {
|
|
|
15
15
|
value?: any;
|
|
16
16
|
children?: /*elided*/ any[] | undefined;
|
|
17
17
|
disabled?: {
|
|
18
|
-
table?: boolean | undefined;
|
|
19
|
-
create?: boolean | undefined;
|
|
20
|
-
update?: boolean | undefined;
|
|
21
|
-
search?: boolean | undefined;
|
|
22
|
-
view?: boolean | undefined;
|
|
18
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
19
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
20
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
21
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
22
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
23
23
|
} | undefined;
|
|
24
24
|
options?: {
|
|
25
25
|
[x: string]: {
|
|
@@ -435,11 +435,11 @@ declare var __VLS_7: string, __VLS_8: {
|
|
|
435
435
|
value?: any;
|
|
436
436
|
children?: /*elided*/ any[] | undefined;
|
|
437
437
|
disabled?: {
|
|
438
|
-
table?: boolean | undefined;
|
|
439
|
-
create?: boolean | undefined;
|
|
440
|
-
update?: boolean | undefined;
|
|
441
|
-
search?: boolean | undefined;
|
|
442
|
-
view?: boolean | undefined;
|
|
438
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
439
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
440
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
441
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
442
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
443
443
|
} | undefined;
|
|
444
444
|
options?: {
|
|
445
445
|
[x: string]: {
|
|
@@ -855,11 +855,11 @@ declare var __VLS_7: string, __VLS_8: {
|
|
|
855
855
|
value?: any;
|
|
856
856
|
children?: /*elided*/ any[] | undefined;
|
|
857
857
|
disabled?: {
|
|
858
|
-
table?: boolean | undefined;
|
|
859
|
-
create?: boolean | undefined;
|
|
860
|
-
update?: boolean | undefined;
|
|
861
|
-
search?: boolean | undefined;
|
|
862
|
-
view?: boolean | undefined;
|
|
858
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
859
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
860
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
861
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
862
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
863
863
|
} | undefined;
|
|
864
864
|
options?: {
|
|
865
865
|
[x: string]: {
|
|
@@ -1275,11 +1275,11 @@ declare var __VLS_7: string, __VLS_8: {
|
|
|
1275
1275
|
value?: any;
|
|
1276
1276
|
children?: /*elided*/ any[] | undefined;
|
|
1277
1277
|
disabled?: {
|
|
1278
|
-
table?: boolean | undefined;
|
|
1279
|
-
create?: boolean | undefined;
|
|
1280
|
-
update?: boolean | undefined;
|
|
1281
|
-
search?: boolean | undefined;
|
|
1282
|
-
view?: boolean | undefined;
|
|
1278
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
1279
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
1280
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
1281
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
1282
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
1283
1283
|
} | undefined;
|
|
1284
1284
|
options?: {
|
|
1285
1285
|
[x: string]: {
|
|
@@ -1695,11 +1695,11 @@ declare var __VLS_7: string, __VLS_8: {
|
|
|
1695
1695
|
value?: any;
|
|
1696
1696
|
children?: /*elided*/ any[] | undefined;
|
|
1697
1697
|
disabled?: {
|
|
1698
|
-
table?: boolean | undefined;
|
|
1699
|
-
create?: boolean | undefined;
|
|
1700
|
-
update?: boolean | undefined;
|
|
1701
|
-
search?: boolean | undefined;
|
|
1702
|
-
view?: boolean | undefined;
|
|
1698
|
+
table?: boolean | ((data: any) => boolean) | undefined;
|
|
1699
|
+
create?: boolean | ((data: any) => boolean) | undefined;
|
|
1700
|
+
update?: boolean | ((data: any) => boolean) | undefined;
|
|
1701
|
+
search?: boolean | ((data: any) => boolean) | undefined;
|
|
1702
|
+
view?: boolean | ((data: any) => boolean) | undefined;
|
|
1703
1703
|
} | undefined;
|
|
1704
1704
|
options?: {
|
|
1705
1705
|
[x: string]: {
|