cc1-form 1.2.24 → 1.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc1-form.css +1 -1
- package/dist/cc1-form.js +1752 -1784
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +837 -2123
- package/dist/components/TCurd/com/form/field.vue.d.ts +62 -0
- package/dist/components/TCurd/com/form/layout.vue.d.ts +65 -0
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/com/form/shared.d.ts +77 -0
- package/dist/components/TCurd/core/boundForm.d.ts +13 -0
- package/dist/components/TCurd/core/export.d.ts +13 -0
- package/dist/components/TCurd/core/formRef.d.ts +7 -0
- package/dist/components/TCurd/core/init.d.ts +11 -0
- package/dist/components/TCurd/core/page.d.ts +16 -0
- package/dist/components/TCurd/core/remove.d.ts +12 -0
- package/dist/components/TCurd/core/search.d.ts +15 -0
- package/dist/components/TCurd/core/table.d.ts +45 -0
- package/dist/components/TCurd/core/types.d.ts +14 -0
- package/dist/components/TCurd/core/update.d.ts +49 -0
- package/dist/components/TCurd/index.d.ts +3 -2348
- package/dist/components/TCurd/index.vue.d.ts +28 -5120
- package/dist/components/TCurd/indexType.d.ts +23 -1
- package/package.json +3 -3
- package/dist/components/TCurd/formColumn.vue.d.ts +0 -2142
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"),require("cc1-vue3")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue","cc1-vue3"],h):(C=typeof globalThis<"u"?globalThis:C||self,h(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue,C.cc1Vue3))})(this,(function(C,h,ot,e,U){"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=(i,...d)=>Array.isArray(i)?i.some(s=>typeof s=="function"?s(...d):s):typeof i=="function"?i(...d):i;static getRouterParams=()=>{const i=this.router.currentRoute.value.query||{},d=this.router.currentRoute.value.params||{};return Object.keys(i).length?i:Object.keys(d).length?d:{}};static moduleObj={};static loadModule=async i=>{if(!u.moduleObj[i])throw new Error(`模块${i}未加载,请赋值如:TSys.moduleObj = { ${i}: ()=>import('${i}') }`);const d=await u.moduleObj[i]();return d.default??d};static tipMessages={};static tipMessagesGap=500;static showMessage(i,d,s={}){const n=Date.now();if(!this.tipMessages[i]||n-this.tipMessages[i]>this.tipMessagesGap){this.tipMessages[i]=n;const o=Object.assign({message:i,type:d},s);h.ElMessage(o),setTimeout(()=>{delete this.tipMessages[i]},this.tipMessagesGap)}}static fail=(i,d={})=>{this.showMessage(i,"error",d)};static success=(i,d={})=>{this.showMessage(i,"success",d)};static loadingObj=null;static loadingTimer=null;static loading=(i=!0,d="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{i?this.loadingObj=h.ElLoading.service({lock:!0,text:d,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(i,d=!0)=>{if(d){let s=screen.width/2-500,n=screen.height/2-800/2-30;window.open(i,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+n+", left="+s)}else window.open(i,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=i=>new Promise(async(d,s)=>{let n=document.getElementById(i.id);const o=await u.loadModule("html2canvas");try{o(n,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:i.windowWidth,height:i.windowHeight,windowWidth:i.windowWidth,windowHeight:i.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(l){let a=l.toDataURL("image/png");d(a)})}catch(l){s(l)}})}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=i=>{w.config=ObjectUtil.deepMerge(w.config,i)}}class V{static customComponent={};static findOptions=(i,d)=>{const s=i.column.find(o=>o.key===d),n=o=>o.replace(/-([a-z])/g,(l,a)=>a.toUpperCase());if(s)return s.options[n(s.type)]};static setOptionsData=(i,d,s)=>{const n=V.findOptions(i,d);n&&(n.data=s)};static form={openBefore:{parentId:(i,d,s,n)=>{const o=w.config.table.rowKey;i?d.type===u.EDialog.Add?(d.form.parentId=i[o],d.form.sort=i.children.length+1):d.form.parentId=i.parentId.substring(i.parentId.lastIndexOf(",")+1):(d.form.parentId="0",d.form.sort=s.length+1),V.setOptionsData(n,"parentId",[{[o]:"0",title:"根",children:s}])}}}}function nt(t){return t}const R={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 b{static t(i,...d){if(typeof i=="function")return i(...d);i=String(i);let s=0;return i.replace(/{([^}]+)}/g,(n,o)=>s<d.length?String(d[s++]):`{${o}}`)}static setI18n=i=>{b.curd=ObjectUtil.deepMerge(b.curd,i)};static tCurd(i,...d){return this.t(this.curd[i],...d)}static curd=R}class N{static getIdFun=()=>StrUtil.uuid();static setId=(i,d,s)=>{d[i]||(d[i]=[]);const n=w.config.table.rowKey;d[i].forEach(o=>{s.forEach(l=>{let a=l.default??"";l.type==="number"&&(a=l.default??0),l.type==="boolean"&&(a=l.default??!1),l.type==="time"&&(a=l.default??new Date),o[l.value]===void 0&&(o[l.value]=a)}),o[n]||(o[n]=N.getIdFun())})};static add=(i,d,s,n)=>{const o=JSONUtil.cp(s);N.setId(i,d,s);const l=w.config.table.rowKey;d[i].push(o.reduce((a,r)=>{let m=r.default??"";return r.type==="number"&&(m=r.default??0),r.type==="boolean"&&(m=r.default??!1),r.type==="time"&&(m=r.default??new Date),a[r.value]=m,a},{[l]:N.getIdFun()})),n?.(d)};static remove=(i,d,s,n)=>{const o=w.config.table.rowKey;d[i]=d[i].filter(l=>l[o]!==s[o]),n?.(d)};static getNoIdData=(i,d)=>{const s=JSONUtil.cp(i),n=w.config.table.rowKey;return s.forEach(o=>{o[n]&&delete o[n],d&&o[d]&&N.getNoIdData(o[d],d)}),s}}const I={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},K={key:0},W={class:"row items-center",style:{gap:"10px",width:"100%"}},q={key:1},O=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:i}){const d=t,s=e.reactive({show:!1,add:(o,l,a)=>{N.add(o,l,a,()=>{n("change")})},remove:(o,l,a)=>{N.remove(o,l,a,()=>{n("change")})}});e.onMounted(()=>{N.setId(d.field,d.row,d.itemFields),s.show=!0});const n=i;return(o,l)=>{const a=e.resolveComponent("el-button"),r=e.resolveComponent("el-input");return s.show?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(o.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(a,{link:"",type:"primary",onClick:l[0]||(l[0]=m=>s.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],m=>(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(o.$slots,"item-start",{item:m,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,c=>(e.openBlock(),e.createBlock(r,{modelValue:m[c.value],"onUpdate:modelValue":y=>m[c.value]=y,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:c[t.label]||c[t.value],onChange:l[1]||(l[1]=y=>n("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:t.row}),e.createVNode(a,{link:"",type:"danger",onClick:c=>s.remove(t.field,t.row,m)},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",q,[e.createVNode(a,{link:"",type:"primary",onClick:l[2]||(l[2]=m=>s.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),J={class:"row form-item-content",style:{width:"100%"}},G={class:"col"},Q={class:"col"},P=["innerHTML"],M=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""},form:{default:{}}},setup(t,{expose:i}){const d=u.isFun,s=u.EDialog,n=e.ref(),o=t,l=U.Scope.getConf();l?.formRef?.set("formRef-"+StrUtil.getId(),n);const a=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||l?.update?.type||s.Add,formColumn:[],getDisabled:r=>{if(a.type===s.View)return r.disabled?.view===void 0?!0:u.isFun(r.disabled?.view,a.form);const m=r.disabled?.[a.type===s.Add?"create":"update"];return u.isFun(m,a.form)},getBind:r=>r.options?.[a.type===s.Add?"formAdd":"formUpdate"]?.[r.type]||r.options?.[r.type]||{},getOn:r=>r.options?.[a.type===s.Add?"formAdd":"formUpdate"]?.[r.type]?.on||r.options?.[r.type]?.on||{},getColumnSpan:(r,m)=>{if(r.item.form?.spanCol){const c=o.option.form?.maxSpan||12,y=o.option.form?.defaultSpan||c/2,p=m.filter(g=>!u.isFun(g.item.show?.form,a.form,a.type)).reduce((g,k)=>g+(k.item.form?.span||y),0);return(r.item.form?.span||y)+p}return r.item.form?.span},initColumnForm:()=>{const r=o.option;a.formColumn=[],a.rules={},a.formDefault={};const m=[],c=o.option.form?.maxSpan||12,y=o.option.form?.defaultSpan||c/2;let f=[];const p=k=>{if(k.children){k.children.forEach(B=>{p(B)});return}if(a.formDefault[k.key]=k.value,k.isForm&&(typeof k.show?.form!="boolean"||k.show?.form)){k.form=k.form||{span:y},k.form.span=k.form.span??y;const B=k.form.span,x=f.reduce((S,z)=>S+z.span,B),E=f.length;if(f.push({item:k,span:B}),(E===1&&f[0].span===0||x>=c||B===0&&E>1)&&(m.push(f),f=[]),k.rules){const S={input:b.tCurd("placeholderInput"),select:b.tCurd("placeholderSelect")},z=(S[k.type]||S.input)+k.label;a.rules[k.key]=typeof k.rules=="boolean"?[{required:!0,message:z,trigger:"blur"}]:k.rules}}},g=(k,B)=>{k.isForm=B,Array.isArray(k.children)&&k.children.forEach(x=>g(x,B))};r.column.forEach(k=>{g(k,!0),p(k)}),f.length>0&&m.push(f),a.formColumn=m,a.type===s.Add?a.form=JSONUtil.cp(a.formDefault):a.form=JSONUtil.cp(o.form)}});return a.initColumnForm(),o.form&&e.watch(()=>a.form,r=>{Object.keys(a.form).forEach(m=>{o.form[m]=a.form[m]})},{deep:!0,immediate:!0}),i({ref:n,conf:a}),(r,m)=>(e.openBlock(),e.createBlock(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:n,model:a.form,rules:a.rules},{default:e.withCtx(()=>[a.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.formColumn,(c,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[e.unref(d)(c.map(f=>f.item?.show?.form),a.form,a.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:t.option.form?.stripe===void 0?!0:t.option.form?.stripe}])},[e.renderSlot(r.$slots,"form-start",{row:a.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.item.key},[e.unref(d)(f.item.show?.form,a.form,a.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([f.item.form.span>0?`col-${a.getColumnSpan(f,c)}`:"col",`form-item-col-${f.item.key}`])},[e.createVNode(e.unref(h.ElFormItem),{label:f.item.text?.form?.label??f.item.label,prop:f.item.key,"label-width":f.item.text?.form?.label==""?0:f.item.form?.labelWidth||t.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",J,[e.renderSlot(r.$slots,"form-"+f.item.key+"-start",{row:a.form,item:f.item}),e.createElementVNode("div",G,[e.createElementVNode("div",Q,[e.renderSlot(r.$slots,"form-"+f.item.key,{row:a.form,item:f.item},()=>[f.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.select?.data,p=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.radio?.data,p=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="list"?(e.openBlock(),e.createBlock(O,e.mergeProps({key:4,row:a.form,field:f.item.key},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):f.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type&&(e.unref(V).customComponent[f.item.type]||e.unref(V).customComponent[f.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[f.item.type]?.form||e.unref(V).customComponent[f.item.type]),e.mergeProps({key:7,modelValue:a.form[f.item.key],"onUpdate:modelValue":p=>a.form[f.item.key]=p},{ref_for:!0},a.getBind(f.item),e.toHandlers(a.getOn(f.item)),{disabled:a.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(r.$slots,"form-"+f.item.key+"-right",{row:a.form,item:f.item})]),e.renderSlot(r.$slots,"form-"+f.item.key+"-tip",{row:a.form,item:f.item},()=>[f.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof f.item.form?.tipText=="function"?f.item.form?.tipText(a.form,a.type):f.item.form?.tipText},null,8,P)):e.createCommentVNode("",!0)])]),e.renderSlot(r.$slots,"form-"+f.item.key+"-end",{row:a.form,item:f.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(r.$slots,"form-end",{row:a.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class L{static exportToExcel=async(i,d,s)=>{if(!i||i.length===0)return;const n=await u.loadModule("xlsx"),o=i.map(r=>{const m={};return d.forEach(c=>{m[c.label]=r[c.key]}),m}),l=n.utils.json_to_sheet(o),a=n.utils.book_new();n.utils.book_append_sheet(a,l,"Sheet1"),s?typeof s=="function"&&(s=s()):s=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,n.writeFile(a,`${s}.xlsx`)}}class ${static delAllKey=i=>{Object.keys(i).forEach(d=>{delete i[d]})};static setValue=(i,d,s=!1)=>{s&&$.delAllKey(i),Object.keys(d).forEach(n=>{i[n]!==d[n]&&(i[n]=d[n])})}}const D=u.EDialog,X=t=>{const i=e.ref(),d=e.ref(),s=e.ref(),n=e.reactive({formRef:{map:{},set(o,l){n.formRef.map[o]=l},validate:()=>new Promise(async(o,l)=>{try{const a=Object.keys(n.formRef.map);await Promise.all(a.map(r=>n.formRef.map[r]?.validate(async(m,c)=>new Promise((y,f)=>{m||f(!1),y(!0)})))),o(!0)}catch(a){l(a)}})},option:t.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,l=b.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${l}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};t.option.column.forEach(a=>{(typeof a.show?.search=="function"?a.show?.search(n.search.form):a.show?.search)&&(o[a.key]=n.search.form[a.key])});const l=t.option.search?.before?.(o);return l&&(o=l),o},reset:()=>{const o=n.search.formDefault;Object.keys(o).forEach(a=>{t.option.search?.resetMode==="none"?o[a]=void 0:o[a]=n.search.formDefault[a]});const l=ObjectUtil.deepMerge(o,{});$.setValue(n.search.form,l,!0),n.page.num=1,t.option.init!==!1&&n.table.getList()},submit:()=>{n.page.num=1,n.table.getList()}},page:{num:1,total:0,layout:t.option.page?.layout||w.config.pagination.layout,showTools:t.option.page?.showTools||w.config.pagination.showTools,size:t.option.page?.size||w.config.pagination.size,sizeList:t.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:t.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||n.page.size,[w.config.field.page.num]:o.num||n.page.num,...n.search.getFormData()})},table:{op:{width:(...o)=>o.filter(a=>a).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,l)=>{},all:()=>{if(n.table.expand.isExpand)n.table.expand.rowKeys=[];else{const o=l=>{let a=[];return l.forEach(r=>{a.push(r[t.option.table.rowKey]),r.children&&r.children.length>0&&(a=a.concat(o(r.children)))}),a};n.table.expand.rowKeys=o(n.table.data)}n.table.expand.isExpand=!n.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!n.table.header.group.expand;n.table.header.group.expand=o;const l=a=>{a.forEach(r=>{r.table?.header?.group!==void 0&&(r.table.header.group=!o),r.table?.header?.groupKey!==void 0&&(r.table.header.show=o),Array.isArray(r.children)&&r.children.length>0&&l(r.children)})};l(n.table.column.list)}}},getList:async()=>{n.table.loading=!0;const o=t.option.api.list,l=JSONUtil.cp(n.table.selection.list);try{await n.initApiData("init");let a={};if(n.table.sort.prop){const{props:k,order:B}=w.config.table.sort;a={[k.field]:n.table.sort.prop,[B.field]:n.table.sort.order}}const r=await o({...n.page.getQuery(),...a}),m=w.config.field.result,c=r.data||{[m.list]:r};let y=(Array.isArray(c[m.list]),c[m.list]);const f=n.update.formColumn.flat(),g=ObjectUtil.deepMerge({data:y},{}).data.map(k=>(Object.keys(k).forEach(x=>{const E=f.find(S=>S.item.key===x);E&&["select","radio"].includes(E.item.type)&&(E.item.table.format||(E.item.table.format=S=>E.item.options[E.item.type].data?.find(z=>z.value==S[x])?.label||S[x]))}),k));n.table.data=t.option.data?await t.option.data(g,y):g,n.page.total=c[m.total]||0,setTimeout(()=>{n.table.selection.setList(l)},20)}catch(a){console.error(a)}finally{n.table.loading=!1}},selection:{list:[],change:o=>{n.table.selection.list=o},setList:(o,l)=>{n.table.selection.list=[];const a=s.value;if(a?.clearSelection(),!a||!o?.length)return;const r=t.option.table?.rowKey,m=c=>{const y=f=>{for(const p of f){if(r!=null&&r!==""){if(p[r]===c[r])return p}else if(p===c)return p;if(Array.isArray(p.children)&&p.children.length){const g=y(p.children);if(g!==void 0)return g}}};return y(n.table.data)};o.forEach(c=>{const y=m(c);if(y)if(l){const f=()=>{a.toggleRowSelection(y,!0,!1)};l(c)!==!1&&f()}else a.toggleRowSelection(y,!0,!1)})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(n.page.num=1);const l=w.config.table.sort;if(l.change){l.change(o,n);return}n.table.sort.prop=o.prop,o.order===null?(n.table.sort.order="",n.table.sort.prop=""):n.table.sort.order=o.order==="ascending"?l.order.asc:l.order.desc,n.table.getList()}}},export:{run:{start:async o=>{let l=await n.export.run[o](),a=t.option.column;const r=ObjectUtil.deepMerge({data:l,columns:a},{}),m=t.option.tools?.export||{};m.before&&m.before(r),L.exportToExcel(r.data,r.columns,m.fileName)},select:async()=>{n.export.loading=!0;try{if(t.option.tools?.export?.select){await t.option.tools?.export?.select({...n.page.getQuery(),items:n.table.selection.list});return}if(n.table.selection.list.length===0)throw u.fail(b.tCurd("selectDataToExport")),new Error(b.tCurd("selectDataToExport"));return n.table.selection.list}catch(o){console.error(o)}finally{n.export.loading=!1}},page:async()=>{n.export.loading=!0;try{if(t.option.tools?.export?.page){await t.option.tools?.export?.page({...n.page.getQuery()});return}if(n.table.data.length===0)throw u.fail(b.tCurd("noData")),new Error(b.tCurd("noData"));return n.table.data}catch(o){console.error(o)}finally{n.export.loading=!1}},all:async()=>{n.export.loading=!0;try{if(t.option.tools?.export?.all){await t.option.tools?.export?.all({...n.page.getQuery()});return}const o=t.option.api.list,l=await o({...n.page.getQuery({size:999999,num:1})});return(l.data||{[w.config.field.result.list]:l})[w.config.field.result.list]}catch(o){console.error(o)}finally{n.export.loading=!1}}},loading:!1,click:o=>{n.export.loading||n.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,l=!1)=>{if(t.option.table?.editMode&&l)return o.disabled?.table===void 0?!1:u.isFun(o.disabled?.table,n.update.form);if(n.update.type===D.View)return o.disabled?.view===void 0?!0:u.isFun(o.disabled?.view,n.update.form);const a=o.disabled?.[n.update.type===D.Add?"create":"update"];return u.isFun(a,n.update.form)},getBind:o=>o.options?.[n.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,l)=>{const r=o.options?.[n.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(r).forEach(c=>{const y=r[c];typeof y=="function"?m[c]=function(...f){return y.apply(this,[...f,l||n.update.form,o])}:m[c]=y}),m},getOptions:o=>{try{const a=n.update.formColumn.flat().find(r=>r.item.key===o)?.item;return a?{options:a.options,bind:n.update.getBind(a)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(t.option.form?.editAll)return o;let l={[t.option.table?.rowKey]:n.update.edit.data[t.option.table?.rowKey]};return Object.keys(n.update.edit.data).forEach(a=>{o[a]!==n.update.edit.data[a]&&(l[a]=o[a])}),l}},view:{},open:(o,l)=>{n.update.showContent||FunUtil.throttle(async()=>{u.loading(!0);try{n.update.type=o;const a=o===D.Add;n.update.edit.data=l,n.update.title=b.tCurd(a?"add":o===D.View?"view":"edit");const r=ObjectUtil.deepMerge(a?n.update.formDefault:l,{});$.setValue(n.update.form,r,!0),await n.initApiData("update"),await t.option.form?.openBefore?.(n.update.form,n.update),(!t.option.table?.inlineEdit||a)&&(n.update.show=!0,n.update.showContent=!0),t.option.form?.openAfter?.(n.update.form,n.update)}catch(a){console.error(a)}finally{u.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{try{await Promise.all([d.value?.validate(async(r,m)=>new Promise((c,y)=>{r||y(!1),c()})),n.formRef.validate()])}catch{u.fail(b.tCurd("checkFormData"));return}t.form&&Object.keys(t.form).forEach(r=>{n.update.form[r]=t.form[r]}),n.update.loading=!0;const o=n.update.type===D.Add?t.option.api.create:t.option.api.update;try{await t.option.form?.submitBefore?.(n.update.form,n.update)}catch{n.update.loading=!1;return}let l=ObjectUtil.deepMerge(n.update.form,{});delete l.children;const a=new Set(t.option.column.filter(r=>r.type==="datetime").map(r=>r.key));Object.keys(l).forEach(r=>{if(a.has(r)&&l[r]!=null){const m=new Date(l[r]).getTime();isNaN(m)||(l[r]=m)}});try{if(!o)return;await o({...l}),n.update.close(),await n.table.getList(),t.option.form?.submitAfter?.(l,n.update)}catch(r){console.error(r)}finally{n.update.loading=!1}})},close:()=>{n.update.show=!1,t.option.table?.inlineEdit&&(n.update.form={}),setTimeout(()=>{n.update.showContent=!1},350)}},remove:{title:b.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{n.remove.show=!1},open:o=>{if(o.length===0){u.fail(b.tCurd("selectDataToDelete"));return}n.remove.items=o,n.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{n.remove.loading=!0;const o=t.option.api.delete;try{if(!o)return;await o({[t.option.table?.rowKey]:n.remove.items.map(l=>l[t.option.table?.rowKey]),items:n.remove.items}),u.success(b.tCurd("operationSuccess")),n.table.data.length<=1&&n.page.num>1&&(n.page.num-=1),n.remove.close(),await n.table.getList()}catch(l){console.error(l)}finally{n.remove.loading=!1}})}},init:()=>{n.initCurdConfig(),n.initColumnOptions(),n.initColumnForm()},apiDataMap:{},initApiData:async o=>{const l=[],a=r=>{if(r.children&&r.children.length){r.children.forEach(m=>a(m));return}if(r.options?.[r.type]?.dataApi&&r.options?.[r.type]?.dataApiConfig?.[o]){if(n.apiDataMap[r.key]&&r.options?.[r.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let c=await r.options?.[r.type]?.dataApi?.(n.update.form,n.update.type);if(c){const y=r.options?.[r.type]?.dataPath;!Array.isArray(c)&&y&&(c=ObjectUtil.getPathValue(c,y)),r.options[r.type].data=c,r.options.search[r.type].data=c,r.options.search[r.options.search.type??r.type]||(r.options.search[r.options.search.type??r.type]={}),r.options.search[r.options.search.type??r.type].data=c,r.options.formAdd[r.type].data=c,r.options.formUpdate[r.type].data=c,n.apiDataMap[r.key]=c}}catch{}})();l.push(m)}};return t.option.column.forEach(r=>{a(r)}),await Promise.all(l),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=b.tCurd("noData"),t.option.size=t.option.size||{},o.table.size=t.option.size.table||o.size.table,o.form.size=t.option.size.form||o.size.form,o.size.search=t.option.size.search||o.size.search;const l=ObjectUtil.deepMerge(o,t.option||{});Object.keys(l).forEach(a=>{t.option[a]=l[a]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:b.tCurd("switchOn"),inactiveText:b.tCurd("switchOff")}},o.options);const l=a=>{for(const r in o){if(r==="table"){if(a.table=ObjectUtil.deepMerge(o.table,a.table||{}),a.children){a.children.forEach(c=>{l(c)});return}}else r==="type"?a.type=a.type||o.type:a[r]=ObjectUtil.deepMerge(o[r],a[r]||{});a.options=a.options||{},a.options[a.type]=a.options[a.type]||{},a.options[a.type].size=t.option.size.form,["search","formAdd","formUpdate"].forEach(c=>{a.options[c]=a.options[c]||ObjectUtil.deepMerge(a.options,{}),a.options[c][a.type]=a.options[c][a.type]||{},a.options[c][a.type].size=c==="search"?t.option.size.search:t.option.size.form}),a.table=ObjectUtil.deepMerge(a.table,a.options[a.type].table||{})}a.type==="switch"&&(a.options.switch.tableBeforeChange=async(r,m)=>{const c=a.options?.switch;try{c.tableConfig?.confirm&&await i.value?.open({title:b.tCurd("confirmModify"),content:b.tCurd("confirmSwitchMessage")});try{if(!t.option.api.update&&!c.tableConfig?.api)return;const y=m[t.option.table?.rowKey];c.loadingMap||(c.loadingMap={}),c.loadingMap[y]||(c.loadingMap[y]={loading:!1}),c.loadingMap[y].loading=!0;const f=m[r]===c.activeValue?c.inactiveValue:c.activeValue,p=c.tableConfig?.api?c.tableConfig.api:t.option.api.update;if(!p)return;try{await p({...m,[r]:f},"switch")}catch{return!1}finally{c.loadingMap[y].loading=!1}return u.success(b.tCurd("operationSuccess")),c.tableConfig?.loadList&&(n.table.loading=!0,n.table.getList(),n.table.loading=!1),!0}catch(y){return console.error(y),!1}finally{n.table.loading=!1}}catch{return!1}}),a.type==="treeSelect"&&(a.options.treeSelect.rowKey=t.option.table?.rowKey,a.options.treeSelect.nodeKey=t.option.table?.rowKey)};t.option.column.forEach(l),t.option.table?.column?.forEach(l)},getColumnSpan:(o,l)=>{if(o.item.form?.spanCol){const a=w.config.form.defaultSpan,m=l.filter(c=>!u.isFun(c.item.show?.form,n.update.form,n.update.type)).reduce((c,y)=>c+(y.item.form?.span||a),0);return(o.item?.form.span||a)+m}return o.item.form.span},initColumnForm:()=>{const o=t.option;n.update.formColumn=[],n.table.column.show={list:[],listSource:[]};const l=[],a=t.option.form?.maxSpan||12,r=t.option.form?.defaultSpan||a/2;let m=[];const c=g=>{if(g.children){n.table.column.show.list.push(g.key),g.children.forEach(k=>{c(k)});return}if(n.update.formDefault[g.key]=g.value,g.table.table&&(g.show.table&&n.table.column.show.list.push(g.key),g.table.table&&n.table.column.show.listSource.push(g.key)),!(g.isForm&&typeof g.show?.form=="boolean")||g.show?.form){g.form=g.form||{span:r},g.form.span=g.form.span??r;let k=g.form.span,B=m.reduce((E,S)=>E+S.span,k);const x=m.length;if(m.push({item:g,span:k}),(x===1&&m[0].span===0||B>=a||k===0&&x>1)&&(l.push(m),m=[]),g.rules){const E={input:b.tCurd("placeholderInput"),select:b.tCurd("placeholderSelect")},S=(E[g.type]||E.input)+g.label,z=typeof g.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:g.rules;n.update.rules[g.key]=z.map(T=>{if(T.validator){const _e=T.validator;return{...T,validator:(ve,et,tt)=>_e(ve,et,tt,n.update.form)}}return T})}}},y=(g,k)=>{g.isForm=k,Array.isArray(g.children)&&g.children.forEach(B=>y(B,k))};o.column.forEach(g=>{g.isForm=!0,y(g,!0),c(g)}),t.option.table?.column?.forEach(g=>{y(g,!1),c(g)}),n.search.column.list=o.column.concat(o.table?.column||[]),n.table.column.list=n.search.column.list.filter(g=>g.table?.table),n.search.column.list.sort((g,k)=>g.sort?.search-k.sort?.search),n.table.column.list.sort((g,k)=>g.sort?.table-k.sort?.table),m.length>0&&l.push(m),n.update.formColumn=l;const f=t.option.search?.formDefault;f&&Object.keys(f).forEach(g=>{n.search.formDefault[g]=f[g]}),o.column.forEach(g=>{g.show?.search||(n.search.formDefault[g.key]=void 0)});const p=ObjectUtil.deepMerge(n.search.formDefault,{});$.setValue(n.search.form,p,!0)}});return n.init(),e.onMounted(()=>{t.option.init!==!1&&n.table.getList()}),t.form&&e.watch(()=>n.update.form,o=>{Object.keys(n.update.form).forEach(l=>{t.form[l]=n.update.form[l]})},{deep:!0,immediate:!0}),t.searchForm&&e.watch(()=>n.search.form,o=>{Object.keys(n.search.form).forEach(l=>{t.searchForm[l]=n.search.form[l]})},{deep:!0,immediate:!0}),U.Scope.setConf(n),{conf:n,switchConfirmRef:i,ruleFormRef:d,tableRef:s}},Y={class:"dialog-footer"},Z=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:i}){const d=e.ref(!1),s=e.ref("确认修改"),n=e.ref("确认要修改状态吗?");let o=null,l=null;const a=c=>(c?.title&&(s.value=c.title),c?.content&&(n.value=c.content),d.value=!0,new Promise((y,f)=>{o=y,l=f})),r=()=>{d.value=!1,o?.(!0),o=null,l=null},m=()=>{d.value=!1,l?.(new Error("用户取消操作")),o=null,l=null};return i({open:a}),(c,y)=>{const f=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(h.ElDialog),{modelValue:d.value,"onUpdate:modelValue":y[0]||(y[0]=p=>d.value=p),title:s.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(f,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",Y,[e.createVNode(e.unref(h.ElButton),{onClick:m},{default:e.withCtx(()=>[...y[1]||(y[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:r},{default:e.withCtx(()=>[...y[2]||(y[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(n.value),1)]),_:1},8,["modelValue","title"])}}}),F=(t,i)=>{const d=t.__vccOpts||t;for(const[s,n]of i)d[s]=n;return d},_={},v={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ee(t,i){return e.openBlock(),e.createElementBlock("svg",v,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const te=F(_,[["render",ee]]),oe=["innerHTML"],ne=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(t){const i=t,d=e.computed(()=>typeof i.content=="function"?i.content(i.value):i.content);return(s,n)=>typeof d.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:d.value},null,8,oe))}}),ae={},le={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function re(t,i){return e.openBlock(),e.createElementBlock("svg",le,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const ie=F(ae,[["render",re]]),de={},ce={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function se(t,i){return e.openBlock(),e.createElementBlock("svg",ce,[...i[0]||(i[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 fe=F(de,[["render",se]]),me={},pe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function he(t,i){return e.openBlock(),e.createElementBlock("svg",pe,[...i[0]||(i[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 ge=F(me,[["render",he]]),ye={class:"row flex-center table-header-label inline"},ke={class:"table-header-tooltip"},be=["innerHTML"],ue=["onClick"],we={key:1},Ce=["onClick","innerHTML"],Be=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const i=u.isFun,d=e.getCurrentInstance().type;return(s,n)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[t.conf.table.column.show.list.includes(l.key)&&(l.show?.table===void 0||e.unref(i)(l.show?.table,t.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.table?.header?.groupKey===void 0||l.table.header.show?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,prop:l.key,label:l.label},{ref_for:!0},l.table),{header:e.withCtx(()=>[e.renderSlot(s.$slots,"table-header-"+l.key,{item:l},()=>[e.createElementVNode("div",ye,[l.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:l.table?.header?.tooltip},null,8,be)]),default:e.withCtx(()=>[e.createElementVNode("span",ke,[e.createVNode(ie)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label)+" ",1),l.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{l.table.header.group=!l.table.header.group,t.columnList.forEach(a=>{a.table?.header?.groupKey===l.key&&(a.table.header.show=!l.table.header.group)})},["stop"])},[l.table.header.group?(e.openBlock(),e.createBlock(fe,{key:0})):(e.openBlock(),e.createBlock(ge,{key:1}))],8,ue)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:a})=>[l.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(d)),{conf:t.conf,columnList:l.children,option:t.option},e.createSlots({_:2},[e.renderList(s.$slots,(r,m)=>({name:m,fn:e.withCtx(c=>[e.renderSlot(s.$slots,m,e.mergeProps({ref_for:!0},c||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+l.key]]),style:{width:"100%"}},[e.renderSlot(s.$slots,"table-edit-left-"+l.key,{row:a,item:l}),l.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:a[l.key],"onUpdate:modelValue":r=>a[l.key]=r,disabled:t.conf.update.getDisabled(l,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(l),e.toHandlers(t.conf.update.getOn(l,a))),e.createSlots({_:2},[l.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof l.options?.input?.prepend=="function"?l.options?.input?.prepend(a):l.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:a[l.key],"onUpdate:modelValue":r=>a[l.key]=r,disabled:t.conf.update.getDisabled(l,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(l),e.toHandlers(t.conf.update.getOn(l,a))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.search?.select?.data||l.options?.select?.data,r=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:a[l.key],"onUpdate:modelValue":r=>a[l.key]=r,disabled:t.conf.update.getDisabled(l,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(l),e.toHandlers(t.conf.update.getOn(l,a))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"table-edit-right-"+l.key,{row:a,item:l})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(u).EDialog.Update&&e.unref(i)(l.show?.form,t.conf.update.form,e.unref(u).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===a[t.option.table?.rowKey]&&(l.type==="input"||l.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[l.key],"onUpdate:modelValue":r=>t.conf.update.form[l.key]=r,disabled:t.conf.update.getDisabled(l,!0)},{ref_for:!0},t.conf.update.getBind(l),e.toHandlers(t.conf.update.getOn(l,a)),{style:{width:"100%"}}),e.createSlots({_:2},[l.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof l.options?.input?.prepend=="function"?l.options?.input?.prepend(a):l.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[l.key],"onUpdate:modelValue":r=>t.conf.update.form[l.key]=r,disabled:t.conf.update.getDisabled(l,!0)},{ref_for:!0},t.conf.update.getBind(l),e.toHandlers(t.conf.update.getOn(l,a)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.search?.select?.data||l.options?.select?.data,r=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[l.key],"onUpdate:modelValue":r=>t.conf.update.form[l.key]=r},{ref_for:!0},t.conf.update.getBind(l),e.toHandlers(t.conf.update.getOn(l,a)),{disabled:t.conf.update.getDisabled(l,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(s.$slots,"table-"+l.key,{key:1,row:a,item:l},()=>[e.unref(V).customComponent[l.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[l.type??""]?.table),e.mergeProps({key:0,modelValue:a[l.key],"onUpdate:modelValue":r=>a[l.key]=r},{ref_for:!0},l.options?.[l.type??""],e.toHandlers(l.options?.[l.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):l.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:0,modelValue:a[l.key],"onUpdate:modelValue":r=>a[l.key]=r,loading:l.options?.switch?.loadingMap?.[a[t.option.table?.rowKey]]?.loading,"before-change":()=>l.options?.switch?.tableBeforeChange?.(l.key,a)},{ref_for:!0},l.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",we,e.toDisplayString(a[l.key]===l.options?.switch?.activeValue?l.options?.switch?.activeText:l.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":l.table?.click?.color}),class:e.normalizeClass({"table-text-click":l.table?.click?.callback}),onClick:r=>l.table?.click?.callback?.(a),innerHTML:l.table?.format?l.table?.format(a):a[l.key]},null,14,Ce))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),Ve={class:"row form-item-content",style:{width:"100%"}},Ee={class:"col column form-item-content-item"},xe={class:"col"},Se=["innerHTML"],Ne=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(t){return(i,d)=>(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{label:t.item.item.text?.form?.label??t.item.item.label,prop:t.item.item.key,"label-width":t.item.item.text?.form?.label==""?0:t.item.item.form?.labelWidth||t.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.renderSlot(i.$slots,"form-"+t.item.item.key+"-start",{row:t.conf.update.form,item:t.item.item}),e.createElementVNode("div",Ee,[e.createElementVNode("div",xe,[e.renderSlot(i.$slots,"form-"+t.item.item.key,{row:t.conf.update.form,item:t.item.item},()=>[t.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[0]||(d[0]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),e.createSlots({_:2},[t.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.item.item.options?.input?.prepend=="function"?t.item.item.options?.input?.prepend(t.conf.update.form):t.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):t.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[1]||(d[1]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):t.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[2]||(d[2]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.conf.update.getBind(t.item.item).data,s=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[3]||(d[3]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.conf.update.getBind(t.item.item).data,s=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),e.mergeProps({key:s.value},{ref_for:!0},s,e.toHandlers(s.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.item.type==="list"?(e.openBlock(),e.createBlock(O,e.mergeProps({key:4,row:t.conf.update.form,field:t.item.item.key},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[4]||(d[4]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[5]||(d[5]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):t.item.item.type&&(e.unref(V).customComponent[t.item.item.type]||e.unref(V).customComponent[t.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[t.item.item.type]?.form||e.unref(V).customComponent[t.item.item.type]),e.mergeProps({key:7,modelValue:t.conf.update.form[t.item.item.key],"onUpdate:modelValue":d[6]||(d[6]=s=>t.conf.update.form[t.item.item.key]=s)},t.conf.update.getBind(t.item.item),e.toHandlers(t.conf.update.getOn(t.item.item)),{disabled:t.conf.update.getDisabled(t.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+t.item.item.key+"-right",{row:t.conf.update.form,item:t.item.item})]),e.renderSlot(i.$slots,"form-"+t.item.item.key+"-tip",{row:t.conf.update.form,item:t.item.item},()=>[t.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.item.form?.tipText=="function"?t.item.item.form?.tipText(t.conf.update.form,t.conf.update.type):t.item.item.form?.tipText},null,8,Se)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+t.item.item.key+"-end",{row:t.conf.update.form,item:t.item.item})])]),_:3},8,["label","prop","label-width"]))}}),De={},ze={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Fe(t,i){return e.openBlock(),e.createElementBlock("svg",ze,[...i[0]||(i[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]]),Oe={},Te={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ue(t,i){return e.openBlock(),e.createElementBlock("svg",Te,[...i[0]||(i[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(Oe,[["render",Ue]]),H=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(t){const i=t,d=e.computed({get:()=>i.conf.search.form?.[i.item?.key],set:s=>{i.item?.key!==void 0&&(i.conf.search.form[i.item.key]=s)}});return(s,n)=>e.unref(V).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[t.type??""]?.search),e.mergeProps({key:0,modelValue:d.value,"onUpdate:modelValue":n[0]||(n[0]=o=>d.value=o)},t.item.options?.search?.[t.type??""],e.toHandlers(t.item.options?.search?.[t.type??""]?.on||{})),null,16,["modelValue"])):t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:1,modelValue:d.value,"onUpdate:modelValue":n[1]||(n[1]=o=>d.value=o),placeholder:t.conf.search.getPlaceholder(t.item),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.input||t.item.options?.input,e.toHandlers(t.item.options?.search?.input?.on||t.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:d.value,"onUpdate:modelValue":n[2]||(n[2]=o=>d.value=o),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(b).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.switch||t.item.options?.switch,e.toHandlers(t.item.options?.search?.switch?.on||t.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:t.item.options?.switch?.activeValue,label:t.item.options?.switch?.activeText,value:t.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:t.item.options?.switch?.inactiveValue,label:t.item.options?.switch?.inactiveText,value:t.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:3,modelValue:d.value,"onUpdate:modelValue":n[3]||(n[3]=o=>d.value=o),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(b).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.select||t.item.options?.select,e.toHandlers(t.item.options?.search?.select?.on||t.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.search?.select?.data||t.item.options?.select?.data||[],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"])):t.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:4,modelValue:d.value,"onUpdate:modelValue":n[4]||(n[4]=o=>d.value=o),disabled:t.item.disabled?.search},t.item.options?.search?.radio||t.item.options?.radio,e.toHandlers(t.item.options?.search?.radio?.on||t.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.radio?.data,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"])):t.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:5,modelValue:d.value,"onUpdate:modelValue":n[5]||(n[5]=o=>d.value=o),disabled:t.item.disabled?.search},t.item.options?.search?.datetime||t.item.options?.datetime,e.toHandlers(t.item.options?.search?.datetime?.on||t.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):t.type&&e.unref(V).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V).customComponent[t.type]),e.mergeProps({key:6,modelValue:d.value,"onUpdate:modelValue":n[6]||(n[6]=o=>d.value=o)},t.item.options?.search?.[t.type]||t.item.options?.[t.type],e.toHandlers(t.item.options?.search?.[t.type]?.on||t.item.options?.[t.type]?.on||{}),{disabled:t.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),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},Re={key:1},Ie={key:2},Ke={class:"export-btn"},We={key:1,class:"export-btn"},qe={class:"flex items-center table-tools-right",style:{gap:"10px"}},Je={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},Ge={class:"dialog-footer"},Qe={key:0},Pe={key:1},Xe={class:"dialog-footer"},A=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:{}},searchForm:{default:{}}},setup(t,{expose:i}){const d=u.EDialog,s=t,n=u.isFun,{conf:o,switchConfirmRef:l,ruleFormRef:a,tableRef:r}=X(s);return i({conf:o}),(m,c)=>{const y=e.resolveComponent("el-tooltip"),f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(e.unref(h.ElForm),{model:e.unref(o).search.form,inline:"",size:t.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,p=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p.key},[e.renderSlot(m.$slots,"search-"+p.key+"-start",{row:e.unref(o).search.form}),(typeof p.show?.search=="function"?p.show?.search(e.unref(o).search.form):p.show?.search)?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0,label:p.text?.search?.label??p.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+p.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+p.key,{row:e.unref(o).search.form},()=>[p.options?.search?.type?(e.openBlock(),e.createBlock(H,{key:0,item:p,conf:e.unref(o),type:p.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(H,{key:1,item:p,conf:e.unref(o),type:p.type},null,8,["item","conf","type"]))]),e.renderSlot(m.$slots,"search-"+p.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+p.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0},{default:e.withCtx(()=>[t.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(b).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.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(b).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(n)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:c[0]||(c[0]=p=>e.unref(o).update.open(e.unref(d).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(n)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:c[1]||(c[1]=p=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(e.unref(h.ElButton),{type:"warning",onClick:c[2]||(c[2]=p=>e.unref(o).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(h.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(h.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(n)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.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(b).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.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(b).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:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:t.option.size?.search,onClick:c[3]||(c[3]=p=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",qe,[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":c[4]||(c[4]=p=>e.unref(o).page.num=p),"page-size":e.unref(o).page.size,"onUpdate:pageSize":c[5]||(c[5]=p=>e.unref(o).page.size=p),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:t.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.expandColumn===void 0||t.option.tools?.expandColumn?(e.openBlock(),e.createBlock(y,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(b).tCurd("mergeColumn"):e.unref(b).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:c[6]||(c[6]=(...p)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...p))},[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),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:c[7]||(c[7]=(...p)=>e.unref(o).table.getList&&e.unref(o).table.getList(...p))},[e.createVNode(te)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":"",t.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(h.ElTable),e.mergeProps({ref_key:"tableRef",ref:r,data:e.unref(o).table.data,border:t.option.table?.border===void 0?!0:t.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},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(n)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.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 t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof t.option.table?.index=="object"?t.option.table?.index?.show:t.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(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 t.option.table?.index=="object"?t.option.table?.index:{},e.toHandlers(typeof t.option.table?.index=="object"?t.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(Be,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(m.$slots,(p,g)=>({name:g,fn:e.withCtx(k=>[e.renderSlot(m.$slots,g,e.normalizeProps(e.guardReactiveProps(k||{})))])}))]),1032,["conf","columnList","option"]),e.unref(n)(t.option.table?.add)||e.unref(n)(t.option.table?.update)||e.unref(n)(t.option.table?.delete)||e.unref(n)(t.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"},t.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("operation")),1)])]),default:e.withCtx(({row:p})=>[e.createVNode(e.unref(h.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:p}),e.unref(o).update.type===e.unref(d).Update&&t.option.table?.inlineEdit&&e.unref(o).update.form[s.option.table?.rowKey]===p[s.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(b).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(b).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:p})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(n)(t.option.table?.add,p)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,link:"",type:"primary",onClick:g=>e.unref(o).update.open(e.unref(d).Add,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(n)(t.option.table?.view,p)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,link:"",type:"primary",onClick:g=>e.unref(o).update.open(e.unref(d).View,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(n)(t.option.table?.update,p)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:2,link:"",type:"warning",onClick:g=>e.unref(o).update.open(e.unref(d).Update,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(n)(t.option.table?.delete,p)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:3,link:"",type:"danger",onClick:g=>e.unref(o).remove.open([p])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:p})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[f,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",Je,[(t.option.page?.show===void 0||t.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":c[8]||(c[8]=p=>e.unref(o).page.num=p),"page-size":e.unref(o).page.size,"onUpdate:pageSize":c[9]||(c[9]=p=>e.unref(o).page.size=p),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:t.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(m.$slots,"box-right")],2),e.createVNode(e.unref(h.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":c[10]||(c[10]=p=>e.unref(o).update.show=p),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",Ge,[e.createVNode(e.unref(h.ElForm),{size:t.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(b).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(d).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(b).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:a,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:t.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,p=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(n)((()=>{const g=[],k=B=>{B?.item?.children?k(B.item.children):g.push(...B.map(x=>x.item?.show?.form))};return k(p),g})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:t.option.form?.stripe===void 0?!0:t.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p,g=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(n)(g.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([g.item.form.span>0?`col-${e.unref(o).getColumnSpan(g,p)}`:"col",`form-item-col-${g.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.item.children?g.children:[g],k=>(e.openBlock(),e.createBlock(Ne,{key:k.item.key,conf:e.unref(o),item:k},e.createSlots({_:2},[e.renderList(m.$slots,(B,x)=>({name:x,fn:e.withCtx(E=>[e.renderSlot(m.$slots,x,e.mergeProps({ref_for:!0},E||{}))])}))]),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":c[11]||(c[11]=p=>e.unref(o).remove.show=p),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:t.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(b).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(b).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[t.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(ne,{content:t.option.dialog?.delete?.content,value:e.unref(o).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Pe,e.toDisplayString(e.unref(b).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Z,{ref_key:"switchConfirmRef",ref:l,size:t.option.size?.form},null,8,["size"])],2)}}});class Ye{static async download(i,d="download.png"){const s=document.createElement("a");s.style.display="none",s.href=i,s.setAttribute("download",d),typeof s.download>"u"&&s.setAttribute("target","_blank"),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(i)}static exportJSONFile=(i,d)=>{const s=new Blob([JSON.stringify(i)],{type:"application/json"}),n=URL.createObjectURL(s),o=document.createElement("a");o.href=n,o.download=`${d||"config"}.json`,o.click()};static importFile=async i=>new Promise((d,s)=>{const n=document.createElement("input");n.type="file";const o=i?.accept||".json";n.accept=o,n.style.display="none",n.onchange=l=>{const a=l.target.files[0];if(!a){u.fail("未选择文件"),s("未选择文件");return}const r=new FileReader;r.onload=async m=>{const c=o==".json"?JSON.parse(m.target.result):m.target.result;d(c)},r.onerror=()=>{u.fail("文件读取失败"),s("文件读取失败")},r.readAsText(a),document.body.removeChild(n)},document.body.appendChild(n),n.click()})}const j=(t,i)=>{if(t.component("TCurd",A),t.component("TFormList",O),t.component("TColumn",M),i?.customComponent){V.customComponent=i.customComponent;for(const d in i.customComponent)t.component(d,i.customComponent[d])}},Ze={install:j};C.ArrUtil=N,C.ExcelUtil=L,C.TColumn=M,C.TCurd=A,C.TFile=Ye,C.TForm=V,C.TFormConfig=w,C.TFormI18n=b,C.TFormList=O,C.TSys=u,C.default=Ze,C.install=j,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(B,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("element-plus"),require("vue-router"),require("vue"),require("cc1-vue3")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue","cc1-vue3"],g):(B=typeof globalThis<"u"?globalThis:B||self,g(B.cc1Form={},B.ElementPlus,B.VueRouter,B.Vue,B.cc1Vue3))})(this,(function(B,g,Ot,e,I){"use strict";class y{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(l,...r)=>Array.isArray(l)?l.some(n=>typeof n=="function"?n(...r):n):typeof l=="function"?l(...r):l;static getRouterParams=()=>{const l=this.router.currentRoute.value.query||{},r=this.router.currentRoute.value.params||{};return Object.keys(l).length?l:Object.keys(r).length?r:{}};static moduleObj={};static loadModule=async l=>{if(!y.moduleObj[l])throw new Error(`模块${l}未加载,请赋值如:TSys.moduleObj = { ${l}: ()=>import('${l}') }`);const r=await y.moduleObj[l]();return r.default??r};static tipMessages={};static tipMessagesGap=500;static showMessage(l,r,n={}){const i=Date.now();if(!this.tipMessages[l]||i-this.tipMessages[l]>this.tipMessagesGap){this.tipMessages[l]=i;const a=Object.assign({message:l,type:r},n);g.ElMessage(a),setTimeout(()=>{delete this.tipMessages[l]},this.tipMessagesGap)}}static fail=(l,r={})=>{this.showMessage(l,"error",r)};static success=(l,r={})=>{this.showMessage(l,"success",r)};static loadingObj=null;static loadingTimer=null;static loading=(l=!0,r="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{l?this.loadingObj=g.ElLoading.service({lock:!0,text:r,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(l,r=!0)=>{if(r){let n=screen.width/2-500,i=screen.height/2-800/2-30;window.open(l,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+i+", left="+n)}else window.open(l,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=l=>new Promise(async(r,n)=>{let i=document.getElementById(l.id);const a=await y.loadModule("html2canvas");try{a(i,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:l.windowWidth,height:l.windowHeight,windowWidth:l.windowWidth,windowHeight:l.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(o){let d=o.toDataURL("image/png");r(d)})}catch(o){n(o)}})}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=l=>{w.config=ObjectUtil.deepMerge(w.config,l)}}class N{static customComponent={};static findOptions=(l,r)=>{const n=l.column.find(a=>a.key===r),i=a=>a.replace(/-([a-z])/g,(o,d)=>d.toUpperCase());if(n)return n.options[i(n.type)]};static setOptionsData=(l,r,n)=>{const i=N.findOptions(l,r);i&&(i.data=n)};static form={openBefore:{parentId:(l,r,n,i)=>{const a=w.config.table.rowKey;l?r.type===y.EDialog.Add?(r.form.parentId=l[a],r.form.sort=l.children.length+1):r.form.parentId=l.parentId.substring(l.parentId.lastIndexOf(",")+1):(r.form.parentId="0",r.form.sort=n.length+1),N.setOptionsData(i,"parentId",[{[a]:"0",title:"根",children:n}])}}}}class F{static getIdFun=()=>StrUtil.uuid();static setId=(l,r,n)=>{r[l]||(r[l]=[]);const i=w.config.table.rowKey;r[l].forEach(a=>{n.forEach(o=>{let d=o.default??"";o.type==="number"&&(d=o.default??0),o.type==="boolean"&&(d=o.default??!1),o.type==="time"&&(d=o.default??new Date),a[o.value]===void 0&&(a[o.value]=d)}),a[i]||(a[i]=F.getIdFun())})};static add=(l,r,n,i)=>{const a=JSONUtil.cp(n);F.setId(l,r,n);const o=w.config.table.rowKey;r[l].push(a.reduce((d,s)=>{let c=s.default??"";return s.type==="number"&&(c=s.default??0),s.type==="boolean"&&(c=s.default??!1),s.type==="time"&&(c=s.default??new Date),d[s.value]=c,d},{[o]:F.getIdFun()})),i?.(r)};static remove=(l,r,n,i)=>{const a=w.config.table.rowKey;r[l]=r[l].filter(o=>o[a]!==n[a]),i?.(r)};static getNoIdData=(l,r)=>{const n=JSONUtil.cp(l),i=w.config.table.rowKey;return n.forEach(a=>{a[i]&&delete a[i],r&&a[r]&&F.getNoIdData(a[r],r)}),n}}const ae={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},le={key:0},re={class:"row items-center",style:{gap:"10px",width:"100%"}},ie={key:1},j=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:l}){const r=t,n=e.reactive({show:!1,add:(a,o,d)=>{F.add(a,o,d,()=>{i("change")})},remove:(a,o,d)=>{F.remove(a,o,d,()=>{i("change")})}});e.onMounted(()=>{F.setId(r.field,r.row,r.itemFields),n.show=!0});const i=l;return(a,o)=>{const d=e.resolveComponent("el-button"),s=e.resolveComponent("el-input");return n.show?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(a.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(d,{link:"",type:"primary",onClick:o[0]||(o[0]=c=>n.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],c=>(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(a.$slots,"item-start",{item:c,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,f=>(e.openBlock(),e.createBlock(s,{modelValue:c[f.value],"onUpdate:modelValue":u=>c[f.value]=u,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:f[t.label]||f[t.value],onChange:o[1]||(o[1]=u=>i("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(a.$slots,"item-end",{item:c,row:t.row}),e.createVNode(d,{link:"",type:"danger",onClick:f=>n.remove(t.field,t.row,c)},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(d,{link:"",type:"primary",onClick:o[2]||(o[2]=c=>n.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),de={class:"row form-item-content",style:{width:"100%"}},ce={class:"col column form-item-content-item"},se={class:"col"},fe=["innerHTML"],me=e.defineComponent({__name:"field",props:{item:{},form:{},type:{},labelWidth:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){return(l,r)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:t.item.text?.form?.label??t.item.label,prop:t.item.key,"label-width":t.item.text?.form?.label==""?0:t.item.form?.labelWidth||t.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",de,[e.renderSlot(l.$slots,"form-"+t.item.key+"-start",{row:t.form,item:t.item}),e.createElementVNode("div",ce,[e.createElementVNode("div",se,[e.renderSlot(l.$slots,"form-"+t.item.key,{row:t.form,item:t.item},()=>[t.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[0]||(r[0]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),e.createSlots({_:2},[t.getBind(t.item).prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.getBind(t.item).prepend=="function"?t.getBind(t.item).prepend(t.form):t.getBind(t.item).prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):t.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[1]||(r[1]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[2]||(r[2]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],n=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),e.mergeProps({key:n.value},{ref_for:!0},n,e.toHandlers(n.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[3]||(r[3]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],n=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),e.mergeProps({key:n.value},{ref_for:!0},n,e.toHandlers(n.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="list"?(e.openBlock(),e.createBlock(j,e.mergeProps({key:4,row:t.form,field:t.item.key},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[4]||(r[4]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[5]||(r[5]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&(e.unref(N).customComponent[t.item.type]||e.unref(N).customComponent[t.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.item.type]?.form||e.unref(N).customComponent[t.item.type]),e.mergeProps({key:7,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[6]||(r[6]=n=>t.form[t.item.key]=n)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(l.$slots,"form-"+t.item.key+"-right",{row:t.form,item:t.item})]),e.renderSlot(l.$slots,"form-"+t.item.key+"-tip",{row:t.form,item:t.item},()=>[t.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.form?.tipText=="function"?t.item.form?.tipText(t.form,t.type):t.item.form?.tipText},null,8,fe)):e.createCommentVNode("",!0)])]),e.renderSlot(l.$slots,"form-"+t.item.key+"-end",{row:t.form,item:t.item})])]),_:3},8,["label","prop","label-width"]))}});function Mt(t){return t}const pe={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 h{static t(l,...r){if(typeof l=="function")return l(...r);l=String(l);let n=0;return l.replace(/{([^}]+)}/g,(i,a)=>n<r.length?String(r[n++]):`{${a}}`)}static setI18n=l=>{h.curd=ObjectUtil.deepMerge(h.curd,l)};static tCurd(l,...r){return this.t(this.curd[l],...r)}static curd=pe}const D=12,U=(t,l)=>{t.isForm=l,Array.isArray(t.children)&&t.children.forEach(r=>U(r,l))},ge=t=>t.isForm===!1?!1:typeof t.show?.form=="boolean"?t.show.form:!0,he=(t,l,r)=>(t.form=t.form||{span:l},r==="column"?t.form.span=t.form.span??12:t.form.span=t.form.span??l,t.form.span),K=t=>{const l=t.form;return l?.row!=null&&l.row>0?l.row:D},L=t=>Math.floor((t.gridRow-1)/D),G=(t,l,r)=>{if(l===y.EDialog.View)return t.disabled?.view===void 0?!0:y.isFun(t.disabled?.view,r);const n=t.disabled?.[l===y.EDialog.Add?"create":"update"];return y.isFun(n,r)},W=(t,l)=>t.options?.[l===y.EDialog.Add?"formAdd":"formUpdate"]?.[t.type]||t.options?.[t.type]||{},J=(t,l,r=[])=>{const i=t.options?.[l===y.EDialog.Add?"formAdd":"formUpdate"]?.[t.type]?.on||t.options?.[t.type]?.on||{},a={};return Object.keys(i).forEach(o=>{const d=i[o];typeof d=="function"?a[o]=function(...s){return d.apply(this,[...s,...r])}:a[o]=d}),a},P=(t,l,r,n,i)=>{const a=t,o=a.colSpan??t.span;if(!t.item.form?.spanCol)return o;const d=i?.maxSpan||12,s=i?.defaultSpan||d/2,c=a.gridBand,u=l.filter(m=>c!=null?m.gridBand===c&&!y.isFun(m.item.show?.form,r,n):m.gridRow===a.gridRow&&!y.isFun(m.item.show?.form,r,n)).reduce((m,p)=>m+(p.colSpan??p.span??s),0);return o+u},q=t=>{const l=new Map;return t.forEach(r=>{const n=r.gridBand??L(r);l.has(n)||l.set(n,[]),l.get(n).push(r)}),Array.from(l.keys()).sort((r,n)=>r-n).map(r=>l.get(r))},Q=t=>t?.length?Array.isArray(t[0])?t.flat():t:[],ue=(t,l)=>{if(!ge(t)||!t.key)return null;const r=l.defaultSpan??(l.maxSpan||12)/2,n=he(t,r,l.layout);return{item:t,span:n}},ye=(t,l={})=>{const r=[],n=i=>{if(i.children?.length){i.children.forEach(o=>n(o));return}const a=ue(i,l);a&&r.push(a)};return t.forEach(i=>n(i)),r},X=(t,l={})=>{const r=l.maxSpan??12,n=l.defaultSpan??r/2,i=l.layout??"row",o=ye(t,{maxSpan:r,defaultSpan:n,layout:i});if(i==="column"){const b=[];let k=1;return o.forEach(C=>{const S=K(C.item),x=r;b.push({...C,span:x,colSpan:x,rowSpan:S,gridRow:k,gridColumn:1,gridBand:L({gridRow:k})}),k+=S}),{cells:b,maxSpan:r}}const d=new Set,s=[];let c=0,f=0;const u=b=>Math.floor(b/D)*D,m=(b,k)=>`${b},${k}`,p=(b,k,C,S)=>{if(k+C>r)return!1;for(let x=0;x<S;x++)for(let V=0;V<C;V++)if(d.has(m(b+x,k+V)))return!1;return!0},E=(b,k,C,S)=>{for(let x=0;x<S;x++)for(let V=0;V<C;V++)d.add(m(b+x,k+V))},z=(b,k,C,S)=>{for(let V=u(b);V<500*D;V+=D){const zt=V+D,Ft=V===u(b)?Math.max(V,b):V;for(let T=Ft;T<zt;T++){const $t=T===b?k:0;for(let H=$t;H<=r-C;H++)if(p(T,H,C,S))return{tr:T,tc:H}}}return{tr:b,tc:k}},M=(b,k,C,S)=>{const x=u(b);if(S<D&&b+S<x+D){c=b+S,f=k;return}const V=k+C;if(V<r){f=V,c=x;return}f=0,c=x+D};for(const b of o){const k=b.span===0?r:b.span,C=K(b.item);b.item.form?.rowBreak&&s.length&&(f=0,c=u(c)+D);let{tr:S,tc:x}=p(c,f,k,C)?{tr:c,tc:f}:z(c,f,k,C);p(S,x,k,C)||({tr:S,tc:x}=z(0,0,k,C)),E(S,x,k,C);const V=S+1;s.push({...b,span:k,colSpan:k,rowSpan:C,gridRow:V,gridColumn:x+1,gridBand:L({gridRow:V})}),M(S,x,k,C)}return{cells:s,maxSpan:r}},be=t=>t.map(l=>l.item?.show?.form),ke=(t,l,r)=>{if(!t.rules)return;const n=typeof t.rules=="boolean"?[{required:!0,message:l(t),trigger:"blur"}]:t.rules;return r?n.map(i=>r(i)):n},Y=t=>(l,r)=>ke(l,t,n=>{if(n.validator){const i=n.validator;return{...n,validator:(a,o,d)=>i(a,o,d,r)}}return n}),we=()=>Y(t=>{const l={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")};return(l[t.type||"input"]||l.input)+t.label}),Ce=(t,l,r)=>{const n={},i={},a=l?.maxSpan||12,o=l?.defaultSpan||a/2,d=we();t.forEach(f=>U(f,!0)),Z(t,n,i,f=>d(f,r));const{cells:s,maxSpan:c}=X(t,{maxSpan:a,defaultSpan:o,layout:l?.layout});return{formDefault:n,rules:i,formGrid:s,formMaxSpan:c,formColumn:q(s)}},Z=(t,l,r,n)=>{const i=a=>{if(a.children?.length){a.children.forEach(o=>i(o));return}if(a.key){l[a.key]=a.value;const o=n(a);o&&(r[a.key]=o)}};t.forEach(i)},Be={class:"curd-form-cell-inner"},_=e.defineComponent({__name:"layout",props:{formGrid:{},maxSpan:{},form:{},type:{},stripe:{type:Boolean},labelWidth:{},formOption:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const l=y.isFun,r=t,n=e.computed(()=>r.formGrid.filter(f=>l(f.item.show?.form,r.form,r.type))),i=e.computed(()=>({gridTemplateColumns:`repeat(${r.maxSpan}, minmax(0, 1fr))`})),a=e.computed(()=>{let f=0;return n.value.forEach(u=>{const m=u.gridRow+u.rowSpan-1;m>f&&(f=m)}),f}),o=f=>f.gridRow+f.rowSpan-1>=a.value,d=f=>f.rowSpan>=D,s=f=>P(f,r.formGrid,r.form,r.type,{maxSpan:r.maxSpan,defaultSpan:r.formOption?.defaultSpan}),c=f=>{const u=s(f)||f.colSpan;return{gridRow:`${f.gridRow} / span ${f.rowSpan}`,gridColumn:`${f.gridColumn} / span ${u}`}};return(f,u)=>e.unref(l)(e.unref(be)(t.formGrid),t.form,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(f.$slots,"form-start",{row:t.form}),e.createElementVNode("div",{class:e.normalizeClass(["curd-form-grid",{stripe:t.stripe!==!1}]),style:e.normalizeStyle(i.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.item.key,class:e.normalizeClass(["curd-form-grid-cell",[t.stripe!==!1&&e.unref(L)(m)%2===0?"stripe-band-odd":"",m.gridColumn>1?"has-col-border":"",t.stripe!==!1&&o(m)?"is-last-row":"",d(m)?"is-row-span":"",`form-item-col-${m.item.key}`]]),style:e.normalizeStyle(c(m))},[e.createElementVNode("div",Be,[e.unref(l)(m.item.show?.form,t.form,t.type)?(e.openBlock(),e.createBlock(me,{key:0,class:e.normalizeClass({"is-row-span-field":d(m)}),item:m.item,form:t.form,type:t.type,"label-width":t.labelWidth,"get-bind":t.getBind,"get-on":t.getOn,"get-disabled":t.getDisabled},e.createSlots({_:2},[e.renderList(f.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(f.$slots,E,e.mergeProps({ref_for:!0},z||{}))])}))]),1032,["class","item","form","type","label-width","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)])],6))),128))],6),e.renderSlot(f.$slots,"form-end",{row:t.form})],64)):e.createCommentVNode("",!0)}});class ${static delAllKey=l=>{Object.keys(l).forEach(r=>{delete l[r]})};static setValue=(l,r,n=!1)=>{n&&$.delAllKey(l),Object.keys(r).forEach(i=>{l[i]!==r[i]&&(l[i]=r[i])})}}const R=t=>{const l=e.reactive({}),r=()=>typeof t=="function"?t():t,n=()=>{const i=r();return i??l};return{internal:l,isExternal:()=>r()!=null,get(){return n()},set(i){$.setValue(n(),i,!0)},merge(i){$.setValue(n(),i,!1)},clear(){$.delAllKey(n())}}},v=e.defineComponent({__name:"column",props:{option:{default:()=>({form:{},column:[]})},type:{default:""},form:{default:void 0}},setup(t,{expose:l}){const r=y.EDialog,n=e.ref(),i=t;let a=R(i.form);const o=I.Scope.getConf();o?.formRef?.set("formRef-"+StrUtil.getId(),n);const d=e.reactive({rules:{},show:!0,formDefault:{},type:i.type||o?.update?.type||r.Add,formColumn:[],formGrid:[],formMaxSpan:12,get form(){return a.get()},set form(s){a.set(s)},getDisabled:s=>G(s,d.type,d.form),getBind:s=>W(s,d.type),getOn:s=>J(s,d.type,[d.form,s]),initColumnForm:()=>{const s=a,c=Ce(i.option.column,i.option.form,s.get());d.formDefault=c.formDefault,d.rules=c.rules,d.formGrid=c.formGrid,d.formMaxSpan=c.formMaxSpan,d.formColumn=c.formColumn,d.type===r.Add?s.isExternal()?s.merge(JSONUtil.cp(d.formDefault)):s.set(JSONUtil.cp(d.formDefault)):!s.isExternal()&&i.form&&s.set(JSONUtil.cp(i.form))}});return d.initColumnForm(),e.watch(()=>i.form,s=>{a=R(s),d.initColumnForm()}),l({ref:n,conf:d}),(s,c)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:n,model:d.form,rules:d.rules},{default:e.withCtx(()=>[d.show?(e.openBlock(),e.createBlock(_,{key:0,"form-grid":d.formGrid,"max-span":d.formMaxSpan,form:d.form,type:d.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth||"100px","form-option":t.option.form,"get-bind":d.getBind,"get-on":d.getOn,"get-disabled":d.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(f,u)=>({name:u,fn:e.withCtx(m=>[e.renderSlot(s.$slots,u,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}}),xe=()=>({formRef:{map:{},set(t,l){this.map[t]=l},validate(){return new Promise(async(t,l)=>{try{const r=Object.keys(this.map);await Promise.all(r.map(n=>this.map[n]?.validate(async i=>new Promise((a,o)=>{i||o(!1),a(!0)})))),t(!0)}catch(r){l(r)}})}}}),Ve=(t,l)=>{const r=R(()=>l.searchForm);return{search:{column:{list:[]},get form(){return r.get()},set form(n){r.set(n)},formDefault:{},getPlaceholder:(n,i=h.tCurd("placeholderInput"))=>n.text?.search?.placeholder===void 0?`${i}${n.label}`:n.text?.search?.placeholder,getFormData:()=>{const n=t();let i={};l.option.column.forEach(o=>{(typeof o.show?.search=="function"?o.show?.search(n.search.form):o.show?.search)&&(i[o.key]=n.search.form[o.key])});const a=l.option.search?.before?.(i);return a&&(i=a),i},reset:()=>{const n=t(),i=n.search.formDefault;Object.keys(i).forEach(o=>{l.option.search?.resetMode==="none"?i[o]=void 0:i[o]=n.search.formDefault[o]});const a=ObjectUtil.deepMerge(i,{});$.setValue(n.search.form,a,!0),n.page.num=1,l.option.init!==!1&&n.table.getList()},submit:()=>{const n=t();n.page.num=1,n.table.getList()}}}},Ee=(t,l)=>({page:{num:1,total:0,layout:l.option.page?.layout||w.config.pagination.layout,showTools:l.option.page?.showTools||w.config.pagination.showTools,size:l.option.page?.size||w.config.pagination.size,sizeList:l.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:l.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(r={})=>{const n=t();return{[w.config.field.page.size]:r.size||n.page.size,[w.config.field.page.num]:r.num||n.page.num,...n.search.getFormData()}}}}),Se=(t,l,r)=>({table:{op:{width:(...n)=>n.filter(a=>a).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(n,i)=>{},all:()=>{const n=t();if(n.table.expand.isExpand)n.table.expand.rowKeys=[];else{const i=a=>{let o=[];return a.forEach(d=>{o.push(d[l.option.table.rowKey]),d.children?.length&&(o=o.concat(i(d.children)))}),o};n.table.expand.rowKeys=i(n.table.data)}n.table.expand.isExpand=!n.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const n=t(),i=!n.table.header.group.expand;n.table.header.group.expand=i;const a=o=>{o.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!i),d.table?.header?.groupKey!==void 0&&(d.table.header.show=i),Array.isArray(d.children)&&d.children.length&&a(d.children)})};a(n.table.column.list)}}},getList:async()=>{const n=t();n.table.loading=!0;const i=l.option.api.list,a=JSONUtil.cp(n.table.selection.list);try{await n.initApiData("init");let o={};if(n.table.sort.prop){const{props:E,order:z}=w.config.table.sort;o={[E.field]:n.table.sort.prop,[z.field]:n.table.sort.order}}const d=await i({...n.page.getQuery(),...o}),s=w.config.field.result,c=d.data||{[s.list]:d},f=(Array.isArray(c[s.list]),c[s.list]),u=Q(n.update.formGrid?.length?n.update.formGrid:n.update.formColumn),p=ObjectUtil.deepMerge({data:f},{}).data.map(E=>(Object.keys(E).forEach(M=>{const b=u.find(k=>k.item.key===M);b&&["select","radio"].includes(b.item.type)&&(b.item.table.format||(b.item.table.format=k=>b.item.options[b.item.type].data?.find(C=>C.value==k[M])?.label||k[M]))}),E));n.table.data=l.option.data?await l.option.data(p,f):p,n.page.total=c[s.total]||0,setTimeout(()=>{n.table.selection.setList(a)},20)}catch(o){console.error(o)}finally{n.table.loading=!1}},selection:{list:[],change:n=>{t().table.selection.list=n},setList:(n,i)=>{const a=t();a.table.selection.list=[];const o=r.tableRef.value;if(o?.clearSelection(),!o||!n?.length)return;const d=l.option.table?.rowKey,s=c=>{const f=u=>{for(const m of u){if(d!=null&&d!==""){if(m[d]===c[d])return m}else if(m===c)return m;if(Array.isArray(m.children)&&m.children.length){const p=f(m.children);if(p!==void 0)return p}}};return f(a.table.data)};n.forEach(c=>{const f=s(c);if(f)if(i){const u=()=>o.toggleRowSelection(f,!0,!1);i(c)!==!1&&u()}else o.toggleRowSelection(f,!0,!1)})}},sort:{prop:"",order:"",change:n=>{const i=t();w.config.table.sort.resetPage&&(i.page.num=1);const a=w.config.table.sort;if(a.change){a.change(n,i);return}i.table.sort.prop=n.prop,n.order===null?(i.table.sort.order="",i.table.sort.prop=""):i.table.sort.order=n.order==="ascending"?a.order.asc:a.order.desc,i.table.getList()}}}});class ee{static exportToExcel=async(l,r,n)=>{if(!l||l.length===0)return;const i=await y.loadModule("xlsx"),a=l.map(s=>{const c={};return r.forEach(f=>{c[f.label]=s[f.key]}),c}),o=i.utils.json_to_sheet(a),d=i.utils.book_new();i.utils.book_append_sheet(d,o,"Sheet1"),n?typeof n=="function"&&(n=n()):n=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,i.writeFile(d,`${n}.xlsx`)}}const Ne=(t,l)=>({export:{run:{start:async r=>{let i=await t().export.run[r]();const a=l.option.column,o=ObjectUtil.deepMerge({data:i,columns:a},{}),d=l.option.tools?.export||{};d.before?.(o),ee.exportToExcel(o.data,o.columns,d.fileName)},select:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.select){await l.option.tools.export.select({...r.page.getQuery(),items:r.table.selection.list});return}if(r.table.selection.list.length===0)throw y.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return r.table.selection.list}catch(n){console.error(n)}finally{r.export.loading=!1}},page:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.page){await l.option.tools.export.page({...r.page.getQuery()});return}if(r.table.data.length===0)throw y.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return r.table.data}catch(n){console.error(n)}finally{r.export.loading=!1}},all:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.all){await l.option.tools.export.all({...r.page.getQuery()});return}const n=l.option.api.list,i=await n({...r.page.getQuery({size:999999,num:1})});return(i.data||{[w.config.field.result.list]:i})[w.config.field.result.list]}catch(n){console.error(n)}finally{r.export.loading=!1}}},loading:!1,click:r=>{const n=t();n.export.loading||n.export.run.start(r)}}}),A=y.EDialog,De=(t,l,r)=>{const n=R(()=>l.form);return{update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:A.Update,get form(){return n.get()},set form(i){n.set(i)},formDefault:{},formColumn:[],formGrid:[],formMaxSpan:12,getDisabled:(i,a=!1)=>{const o=t();return l.option.table?.editMode&&a?i.disabled?.table===void 0?!1:y.isFun(i.disabled?.table,o.update.form):G(i,o.update.type,o.update.form)},getBind:i=>{const a=t();return W(i,a.update.type)},getOn:(i,a)=>{const o=t();return J(i,o.update.type,[a||o.update.form,i])},getOptions:i=>{const a=t();try{const d=Q(a.update.formGrid?.length?a.update.formGrid:a.update.formColumn).find(s=>s.item.key===i)?.item;return d?{options:d.options,bind:a.update.getBind(d)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:i=>{const a=t();if(l.option.form?.editAll)return i;const o={[l.option.table?.rowKey]:a.update.edit.data[l.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(d=>{i[d]!==a.update.edit.data[d]&&(o[d]=i[d])}),o}},view:{},open:(i,a)=>{const o=t();o.update.showContent||FunUtil.throttle(async()=>{y.loading(!0);try{o.update.type=i;const d=i===A.Add;o.update.edit.data=d?void 0:JSONUtil.cp(a),o.update.title=h.tCurd(d?"add":i===A.View?"view":"edit");const s=d?ObjectUtil.deepMerge(JSONUtil.cp(o.update.formDefault),a?JSONUtil.cp(a):{}):JSONUtil.cp(a);$.setValue(o.update.form,s,!0),await o.initApiData("update"),await l.option.form?.openBefore?.(o.update.form,o.update),(!l.option.table?.inlineEdit||d)&&(o.update.show=!0,o.update.showContent=!0),l.option.form?.openAfter?.(o.update.form,o.update)}catch(d){console.error(d)}finally{y.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{const i=t();try{await Promise.all([r.ruleFormRef.value?.validate(async s=>new Promise((c,f)=>{s||f(!1),c(void 0)})),i.formRef.validate()])}catch{y.fail(h.tCurd("checkFormData"));return}i.update.loading=!0;const a=i.update.type===A.Add?l.option.api.create:l.option.api.update;try{await l.option.form?.submitBefore?.(i.update.form,i.update)}catch{i.update.loading=!1;return}let o=ObjectUtil.deepMerge(i.update.form,{});delete o.children;const d=new Set(l.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(o).forEach(s=>{if(d.has(s)&&o[s]!=null){const c=new Date(o[s]).getTime();isNaN(c)||(o[s]=c)}});try{if(!a)return;await a({...o}),i.update.close(),await i.table.getList(),l.option.form?.submitAfter?.(o,i.update)}catch(s){console.error(s)}finally{i.update.loading=!1}})},close:()=>{const i=t();i.update.show=!1,i.update.edit.data=void 0,setTimeout(()=>{i.update.showContent=!1,r.ruleFormRef.value?.resetFields?.(),n.clear()},350)}}}},ze=(t,l)=>({remove:{title:h.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{t().remove.show=!1},open:r=>{if(r.length===0){y.fail(h.tCurd("selectDataToDelete"));return}const n=t();n.remove.items=r,n.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{const r=t();r.remove.loading=!0;const n=l.option.api.delete;try{if(!n)return;await n({[l.option.table?.rowKey]:r.remove.items.map(i=>i[l.option.table?.rowKey]),items:r.remove.items}),y.success(h.tCurd("operationSuccess")),r.table.data.length<=1&&r.page.num>1&&(r.page.num-=1),r.remove.close(),await r.table.getList()}catch(i){console.error(i)}finally{r.remove.loading=!1}})}}}),Fe=(t,l,r)=>({apiDataMap:{},getColumnSpan:(n,i)=>{const a=t(),o=a.update.formGrid?.length?a.update.formGrid:i||[];return P(n,o,a.update.form,a.update.type,{maxSpan:a.update.formMaxSpan||l.option.form?.maxSpan,defaultSpan:l.option.form?.defaultSpan||w.config.form.defaultSpan})},init:()=>{const n=t();n.initCurdConfig(),n.initColumnOptions(),n.initColumnForm()},initApiData:async n=>{const i=t(),a=[],o=d=>{if(d.children?.length){d.children.forEach(s=>o(s));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[n]){if(i.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const s=(async()=>{try{let c=await d.options?.[d.type]?.dataApi?.(i.update.form,i.update.type);if(c){const f=d.options?.[d.type]?.dataPath;!Array.isArray(c)&&f&&(c=ObjectUtil.getPathValue(c,f)),d.options[d.type].data=c,d.options.search[d.type].data=c,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=c,d.options.formAdd[d.type].data=c,d.options.formUpdate[d.type].data=c,i.apiDataMap[d.key]=c}}catch{}})();a.push(s)}};return l.option.column.forEach(d=>o(d)),await Promise.all(a),!0},initCurdConfig:()=>{const n=ObjectUtil.deepMerge(w.config,{});n.table.emptyText=h.tCurd("noData"),l.option.size=l.option.size||{},n.table.size=l.option.size.table||n.size.table,n.form.size=l.option.size.form||n.size.form,n.size.search=l.option.size.search||n.size.search;const i=ObjectUtil.deepMerge(n,l.option||{});Object.keys(i).forEach(a=>{l.option[a]=i[a]})},initColumnOptions:()=>{const n=t();let i=JSONUtil.cp(w.config.columnConfig);i.options=ObjectUtil.deepMerge({switch:{activeText:h.tCurd("switchOn"),inactiveText:h.tCurd("switchOff")}},i.options);const a=o=>{for(const d in i){if(d==="table"){if(o.table=ObjectUtil.deepMerge(i.table,o.table||{}),o.children){o.children.forEach(c=>a(c));return}}else d==="type"?o.type=o.type||i.type:o[d]=ObjectUtil.deepMerge(i[d],o[d]||{});o.options=o.options||{},o.options[o.type]=o.options[o.type]||{},o.options[o.type].size=l.option.size.form,["search","formAdd","formUpdate"].forEach(c=>{o.options[c]=o.options[c]||ObjectUtil.deepMerge(o.options,{}),o.options[c][o.type]=o.options[c][o.type]||{},o.options[c][o.type].size=c==="search"?l.option.size.search:l.option.size.form}),o.table=ObjectUtil.deepMerge(o.table,o.options[o.type].table||{})}o.type==="switch"&&(o.options.switch.tableBeforeChange=async(d,s)=>{const c=o.options?.switch;try{c.tableConfig?.confirm&&await r.switchConfirmRef.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")});try{if(!l.option.api.update&&!c.tableConfig?.api)return;const f=s[l.option.table?.rowKey];c.loadingMap||(c.loadingMap={}),c.loadingMap[f]||(c.loadingMap[f]={loading:!1}),c.loadingMap[f].loading=!0;const u=s[d]===c.activeValue?c.inactiveValue:c.activeValue,m=c.tableConfig?.api?c.tableConfig.api:l.option.api.update;if(!m)return;try{await m({...s,[d]:u},"switch")}catch{return!1}finally{c.loadingMap[f].loading=!1}return y.success(h.tCurd("operationSuccess")),c.tableConfig?.loadList&&(n.table.loading=!0,n.table.getList(),n.table.loading=!1),!0}catch(f){return console.error(f),!1}finally{n.table.loading=!1}}catch{return!1}}),o.type==="treeSelect"&&(o.options.treeSelect.rowKey=l.option.table?.rowKey,o.options.treeSelect.nodeKey=l.option.table?.rowKey)};l.option.column.forEach(a),l.option.table?.column?.forEach(a)},initColumnForm:()=>{const n=t(),i=l.option;n.update.formColumn=[],n.update.formGrid=[],n.update.formMaxSpan=12,n.table.column.show={list:[],listSource:[]};const a=l.option.form?.maxSpan||12,o=l.option.form?.defaultSpan||a/2,d=Y(m=>{const p={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")};return(p[m.type||"input"]||p.input)+m.label}),s=m=>{if(m.children){n.table.column.show.list.push(m.key),m.children.forEach(p=>s(p));return}n.update.formDefault[m.key]=m.value,m.table?.table&&(m.show?.table&&n.table.column.show.list.push(m.key),n.table.column.show.listSource.push(m.key))};i.column.forEach(m=>{U(m,!0),s(m)}),l.option.table?.column?.forEach(m=>{U(m,!1),s(m)}),n.search.column.list=i.column.concat(i.table?.column||[]),n.table.column.list=n.search.column.list.filter(m=>m.table?.table),n.search.column.list.sort((m,p)=>m.sort?.search-p.sort?.search),n.table.column.list.sort((m,p)=>m.sort?.table-p.sort?.table),n.update.rules={},Z(i.column,n.update.formDefault,n.update.rules,m=>d(m,n.update.form));const c=X(i.column,{maxSpan:a,defaultSpan:o,layout:l.option.form?.layout});n.update.formGrid=c.cells,n.update.formMaxSpan=c.maxSpan,n.update.formColumn=q(c.cells);const f=l.option.search?.formDefault;f&&Object.keys(f).forEach(m=>{n.search.formDefault[m]=f[m]}),i.column.forEach(m=>{m.show?.search||(n.search.formDefault[m.key]=void 0)});const u=ObjectUtil.deepMerge(n.search.formDefault,{});$.setValue(n.search.form,u,!0)}}),$e=t=>{const l=e.ref(),r=e.ref(),n=e.ref(),i={switchConfirmRef:l,ruleFormRef:r,tableRef:n};let a;const o=()=>a;return a=e.reactive({...xe(),option:t.option,...Ve(o,t),...Ee(o,t),...Se(o,t,i),...Ne(o,t),...De(o,t,i),...ze(o,t),...Fe(o,t,i)}),a.init(),e.onMounted(()=>{t.option.init!==!1&&a.table.getList()}),I.Scope.setConf(a),{conf:a,switchConfirmRef:l,ruleFormRef:r,tableRef:n}},Oe={class:"dialog-footer"},Me=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:l}){const r=e.ref(!1),n=e.ref("确认修改"),i=e.ref("确认要修改状态吗?");let a=null,o=null;const d=f=>(f?.title&&(n.value=f.title),f?.content&&(i.value=f.content),r.value=!0,new Promise((u,m)=>{a=u,o=m})),s=()=>{r.value=!1,a?.(!0),a=null,o=null},c=()=>{r.value=!1,o?.(new Error("用户取消操作")),a=null,o=null};return l({open:d}),(f,u)=>{const m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=p=>r.value=p),title:n.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(m,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",Oe,[e.createVNode(e.unref(g.ElButton),{onClick:c},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(i.value),1)]),_:1},8,["modelValue","title"])}}}),O=(t,l)=>{const r=t.__vccOpts||t;for(const[n,i]of l)r[n]=i;return r},Te={},Ue={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Le(t,l){return e.openBlock(),e.createElementBlock("svg",Ue,[...l[0]||(l[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 Re=O(Te,[["render",Le]]),Ae=["innerHTML"],He=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(t){const l=t,r=e.computed(()=>typeof l.content=="function"?l.content(l.value):l.content);return(n,i)=>typeof r.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:r.value},null,8,Ae))}}),je={},Ie={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Ke(t,l){return e.openBlock(),e.createElementBlock("svg",Ie,[...l[0]||(l[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 Ge=O(je,[["render",Ke]]),We={},Je={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Pe(t,l){return e.openBlock(),e.createElementBlock("svg",Je,[...l[0]||(l[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 qe=O(We,[["render",Pe]]),Qe={},Xe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Ye(t,l){return e.openBlock(),e.createElementBlock("svg",Xe,[...l[0]||(l[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 Ze=O(Qe,[["render",Ye]]),_e={class:"row flex-center table-header-label inline"},ve={class:"table-header-tooltip"},et=["innerHTML"],tt=["onClick"],ot={key:1},nt=["onClick","innerHTML"],at=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const l=y.isFun,r=e.getCurrentInstance().type;return(n,i)=>{const a=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.key},[t.conf.table.column.show.list.includes(o.key)&&(o.show?.table===void 0||e.unref(l)(o.show?.table,t.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.table?.header?.groupKey===void 0||o.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:o.key,label:o.label},{ref_for:!0},o.table),{header:e.withCtx(()=>[e.renderSlot(n.$slots,"table-header-"+o.key,{item:o},()=>[e.createElementVNode("div",_e,[o.table?.header?.tooltip?(e.openBlock(),e.createBlock(a,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:o.table?.header?.tooltip},null,8,et)]),default:e.withCtx(()=>[e.createElementVNode("span",ve,[e.createVNode(Ge)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{o.table.header.group=!o.table.header.group,t.columnList.forEach(d=>{d.table?.header?.groupKey===o.key&&(d.table.header.show=!o.table.header.group)})},["stop"])},[o.table.header.group?(e.openBlock(),e.createBlock(qe,{key:0})):(e.openBlock(),e.createBlock(Ze,{key:1}))],8,tt)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:d})=>[o.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i[0]||(i[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{conf:t.conf,columnList:o.children,option:t.option},e.createSlots({_:2},[e.renderList(n.$slots,(s,c)=>({name:c,fn:e.withCtx(f=>[e.renderSlot(n.$slots,c,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+o.key]]),style:{width:"100%"}},[e.renderSlot(n.$slots,"table-edit-left-"+o.key,{row:d,item:o}),o.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":s=>d[o.key]=s,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),e.createSlots({_:2},[o.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.options?.input?.prepend=="function"?o.options?.input?.prepend(d):o.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d[o.key],"onUpdate:modelValue":s=>d[o.key]=s,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d[o.key],"onUpdate:modelValue":s=>d[o.key]=s,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"table-edit-right-"+o.key,{row:d,item:o})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(y).EDialog.Update&&e.unref(l)(o.show?.form,t.conf.update.form,e.unref(y).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===d[t.option.table?.rowKey]&&(o.type==="input"||o.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":s=>t.conf.update.form[o.key]=s,disabled:t.conf.update.getDisabled(o,!0)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{style:{width:"100%"}}),e.createSlots({_:2},[o.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.options?.input?.prepend=="function"?o.options?.input?.prepend(d):o.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":s=>t.conf.update.form[o.key]=s,disabled:t.conf.update.getDisabled(o,!0)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":s=>t.conf.update.form[o.key]=s},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{disabled:t.conf.update.getDisabled(o,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(n.$slots,"table-"+o.key,{key:1,row:d,item:o},()=>[e.unref(N).customComponent[o.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[o.type??""]?.table),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":s=>d[o.key]=s},{ref_for:!0},o.options?.[o.type??""],e.toHandlers(o.options?.[o.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):o.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":s=>d[o.key]=s,loading:o.options?.switch?.loadingMap?.[d[t.option.table?.rowKey]]?.loading,"before-change":()=>o.options?.switch?.tableBeforeChange?.(o.key,d)},{ref_for:!0},o.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ot,e.toDisplayString(d[o.key]===o.options?.switch?.activeValue?o.options?.switch?.activeText:o.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":o.table?.click?.color}),class:e.normalizeClass({"table-text-click":o.table?.click?.callback}),onClick:s=>o.table?.click?.callback?.(d),innerHTML:o.table?.format?o.table?.format(d):d[o.key]},null,14,nt))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),lt={},rt={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function it(t,l){return e.openBlock(),e.createElementBlock("svg",rt,[...l[0]||(l[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 dt=O(lt,[["render",it]]),ct={},st={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function ft(t,l){return e.openBlock(),e.createElementBlock("svg",st,[...l[0]||(l[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 mt=O(ct,[["render",ft]]),te=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(t){const l=t,r=e.computed({get:()=>l.conf.search.form?.[l.item?.key],set:n=>{l.item?.key!==void 0&&(l.conf.search.form[l.item.key]=n)}});return(n,i)=>e.unref(N).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.type??""]?.search),e.mergeProps({key:0,modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a)},t.item.options?.search?.[t.type??""],e.toHandlers(t.item.options?.search?.[t.type??""]?.on||{})),null,16,["modelValue"])):t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=a=>r.value=a),placeholder:t.conf.search.getPlaceholder(t.item),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.input||t.item.options?.input,e.toHandlers(t.item.options?.search?.input?.on||t.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:r.value,"onUpdate:modelValue":i[2]||(i[2]=a=>r.value=a),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.switch||t.item.options?.switch,e.toHandlers(t.item.options?.search?.switch?.on||t.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:t.item.options?.switch?.activeValue,label:t.item.options?.switch?.activeText,value:t.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:t.item.options?.switch?.inactiveValue,label:t.item.options?.switch?.inactiveText,value:t.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:3,modelValue:r.value,"onUpdate:modelValue":i[3]||(i[3]=a=>r.value=a),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.select||t.item.options?.select,e.toHandlers(t.item.options?.search?.select?.on||t.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.search?.select?.data||t.item.options?.select?.data||[],a=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:4,modelValue:r.value,"onUpdate:modelValue":i[4]||(i[4]=a=>r.value=a),disabled:t.item.disabled?.search},t.item.options?.search?.radio||t.item.options?.radio,e.toHandlers(t.item.options?.search?.radio?.on||t.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.radio?.data,a=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:5,modelValue:r.value,"onUpdate:modelValue":i[5]||(i[5]=a=>r.value=a),disabled:t.item.disabled?.search},t.item.options?.search?.datetime||t.item.options?.datetime,e.toHandlers(t.item.options?.search?.datetime?.on||t.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):t.type&&e.unref(N).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.type]),e.mergeProps({key:6,modelValue:r.value,"onUpdate:modelValue":i[6]||(i[6]=a=>r.value=a)},t.item.options?.search?.[t.type]||t.item.options?.[t.type],e.toHandlers(t.item.options?.search?.[t.type]?.on||t.item.options?.[t.type]?.on||{}),{disabled:t.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),pt={key:0,class:"relative curd-search fit-width"},gt={class:"mb-10 flex justify-between items-center fit-width"},ht={class:"flex items-center",style:{gap:"10px"}},ut={key:0},yt={key:1},bt={key:2},kt={class:"export-btn"},wt={key:1,class:"export-btn"},Ct={class:"flex items-center table-tools-right",style:{gap:"10px"}},Bt={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},xt={class:"dialog-footer"},Vt={key:0},Et={key:1},St={class:"dialog-footer"},oe=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:void 0},searchForm:{default:void 0}},setup(t,{expose:l}){const r=y.EDialog,n=t,i=y.isFun,{conf:a,switchConfirmRef:o,ruleFormRef:d,tableRef:s}=$e(n);return l({conf:a}),(c,f)=>{const u=e.resolveComponent("el-tooltip"),m=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(c.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(e.unref(g.ElForm),{model:e.unref(a).search.form,inline:"",size:t.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search-start",{row:e.unref(a).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).search.column.list,p=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p.key},[e.renderSlot(c.$slots,"search-"+p.key+"-start",{row:e.unref(a).search.form}),(typeof p.show?.search=="function"?p.show?.search(e.unref(a).search.form):p.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:p.text?.search?.label??p.label},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search-"+p.key+"-left",{row:e.unref(a).search.form}),e.renderSlot(c.$slots,"search-"+p.key,{row:e.unref(a).search.form},()=>[p.options?.search?.type?(e.openBlock(),e.createBlock(te,{key:0,item:p,conf:e.unref(a),type:p.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(te,{key:1,item:p,conf:e.unref(a),type:p.type},null,8,["item","conf","type"]))]),e.renderSlot(c.$slots,"search-"+p.key+"-right",{row:e.unref(a).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"search-"+p.key+"-end",{row:e.unref(a).search.form})],64))),128)),e.renderSlot(c.$slots,"search-center",{row:e.unref(a).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[t.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(a).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(a).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"search-end",{row:e.unref(a).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",gt,[e.createElementVNode("div",ht,[e.unref(i)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:f[0]||(f[0]=p=>e.unref(a).update.open(e.unref(r).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(i)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",yt,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:f[1]||(f[1]=p=>e.unref(a).remove.open(e.unref(a).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",bt,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:f[2]||(f[2]=p=>e.unref(a).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(a).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(i)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",kt,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:t.option.size?.search,onClick:f[3]||(f[3]=p=>e.unref(a).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"tools-left")]),e.createElementVNode("div",Ct,[e.renderSlot(c.$slots,"tools-right"),e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":f[4]||(f[4]=p=>e.unref(a).page.num=p),"page-size":e.unref(a).page.size,"onUpdate:pageSize":f[5]||(f[5]=p=>e.unref(a).page.size=p),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:t.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.expandColumn===void 0||t.option.tools?.expandColumn?(e.openBlock(),e.createBlock(u,{key:1,effect:"dark",content:e.unref(a).table.header.group.expand?e.unref(h).tCurd("mergeColumn"):e.unref(h).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:f[6]||(f[6]=(...p)=>e.unref(a).table.header.group.toggleExpandAll&&e.unref(a).table.header.group.toggleExpandAll(...p))},[e.unref(a).table.header.group.expand?(e.openBlock(),e.createBlock(dt,{key:0})):(e.openBlock(),e.createBlock(mt,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:f[7]||(f[7]=(...p)=>e.unref(a).table.getList&&e.unref(a).table.getList(...p))},[e.createVNode(Re)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":"",t.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:s,data:e.unref(a).table.data,border:t.option.table?.border===void 0?!0:t.option.table?.border,onSelectionChange:e.unref(a).table.selection.change,onSortChange:e.unref(a).table.sort.change,"expand-row-keys":e.unref(a).table.expand.rowKeys,onExpandChange:e.unref(a).table.expand.change},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(i)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof t.option.table?.index=="object"?t.option.table?.index?.show:t.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof t.option.table?.index=="object"?t.option.table?.index:{},e.toHandlers(typeof t.option.table?.index=="object"?t.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(at,{conf:e.unref(a),columnList:e.unref(a).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(c.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(c.$slots,E,e.normalizeProps(e.guardReactiveProps(z||{})))])}))]),1032,["conf","columnList","option"]),e.unref(i)(t.option.table?.add)||e.unref(i)(t.option.table?.update)||e.unref(i)(t.option.table?.delete)||e.unref(i)(t.option.table?.view)||c.$slots["table-op-left"]||c.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:2,width:"auto","max-width":"200",align:"center",fixed:"right"},t.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(c.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:p})=>[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"table-op-left",{row:p}),e.unref(a).update.type===e.unref(r).Update&&t.option.table?.inlineEdit&&e.unref(a).update.form[n.option.table?.rowKey]===p[n.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{link:"",type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(c.$slots,"table-op-edit-right",{row:p})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(t.option.table?.add,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:E=>e.unref(a).update.open(e.unref(r).Add,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.view,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:E=>e.unref(a).update.open(e.unref(r).View,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.update,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:E=>e.unref(a).update.open(e.unref(r).Update,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.delete,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:E=>e.unref(a).remove.open([p])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"table-op-right",{row:p})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[m,e.unref(a).table.loading]])],2)],2),e.createElementVNode("div",Bt,[(t.option.page?.show===void 0||t.option.page?.show)&&!e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":f[8]||(f[8]=p=>e.unref(a).page.num=p),"page-size":e.unref(a).page.size,"onUpdate:pageSize":f[9]||(f[9]=p=>e.unref(a).page.size=p),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:t.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(c.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(a).update.show,"onUpdate:modelValue":f[10]||(f[10]=p=>e.unref(a).update.show=p),title:e.unref(a).update.title,"before-close":e.unref(a).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",xt,[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(a).update.type!==e.unref(r).View?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:d,model:e.unref(a).update.form,rules:e.unref(a).update.rules,size:t.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(a).update.showContent?(e.openBlock(),e.createBlock(_,{key:0,"form-grid":e.unref(a).update.formGrid,"max-span":e.unref(a).update.formMaxSpan,form:e.unref(a).update.form,type:e.unref(a).update.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth,"form-option":t.option.form,"get-bind":e.unref(a).update.getBind,"get-on":e.unref(a).update.getOn,"get-disabled":e.unref(a).update.getDisabled},e.createSlots({_:2},[e.renderList(c.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(c.$slots,E,e.normalizeProps(e.guardReactiveProps(z||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(a).remove.show,"onUpdate:modelValue":f[11]||(f[11]=p=>e.unref(a).remove.show=p),title:e.unref(a).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",St,[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(a).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(a).remove.submit,loading:e.unref(a).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[t.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(He,{content:t.option.dialog?.delete?.content,value:e.unref(a).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Et,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(a).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Me,{ref_key:"switchConfirmRef",ref:o,size:t.option.size?.form},null,8,["size"])],2)}}});class Nt{static async download(l,r="download.png"){const n=document.createElement("a");n.style.display="none",n.href=l,n.setAttribute("download",r),typeof n.download>"u"&&n.setAttribute("target","_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(l)}static exportJSONFile=(l,r)=>{const n=new Blob([JSON.stringify(l)],{type:"application/json"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=`${r||"config"}.json`,a.click()};static importFile=async l=>new Promise((r,n)=>{const i=document.createElement("input");i.type="file";const a=l?.accept||".json";i.accept=a,i.style.display="none",i.onchange=o=>{const d=o.target.files[0];if(!d){y.fail("未选择文件"),n("未选择文件");return}const s=new FileReader;s.onload=async c=>{const f=a==".json"?JSON.parse(c.target.result):c.target.result;r(f)},s.onerror=()=>{y.fail("文件读取失败"),n("文件读取失败")},s.readAsText(d),document.body.removeChild(i)},document.body.appendChild(i),i.click()})}const ne=(t,l)=>{if(t.component("TCurd",oe),t.component("TFormList",j),t.component("TColumn",v),l?.customComponent){N.customComponent=l.customComponent;for(const r in l.customComponent)t.component(r,l.customComponent[r])}},Dt={install:ne};B.ArrUtil=F,B.ExcelUtil=ee,B.TColumn=v,B.TCurd=oe,B.TFile=Nt,B.TForm=N,B.TFormConfig=w,B.TFormI18n=h,B.TFormList=j,B.TSys=y,B.default=Dt,B.install=ne,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|