cc1-form 1.1.22 → 1.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc1-form.js +1000 -898
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +92 -11
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/index.d.ts +61 -7
- package/dist/components/TCurd/index.vue.d.ts +280 -54
- package/dist/components/TCurd/indexType.d.ts +70 -40
- package/dist/components/TCurd/tableColumn.vue.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/utils/TFormConfig.d.ts +10 -0
- package/dist/utils/TFormI18n.d.ts +2 -0
- package/dist/utils/TSys.d.ts +2 -1
- package/package.json +1 -1
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u.cc1Form={},u.Vue,u.ElementPlus))})(this,(function(u,e,p){"use strict";class b{static config={page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"},dialog:{width:"980px",closeOnClickModal:!1},tools:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,fileName:"Export Data "}},form:{stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0},columnConfig:{type:"input",form:{labelWidth:"100px",width:"100%"},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},options:{switch:{activeValue:!0,inactiveValue:!1},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=i=>{b.config=ObjectUtil.deepMerge(b.config,i)}}class k{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Insert:"Insert",Update:"Update",Remove:"Remove"};static isFun=(i,s)=>Array.isArray(i)?i.some(l=>typeof l=="function"?l(s):l):typeof i=="function"?i(s):i;static getRouterParams=()=>{const i=this.router.currentRoute.value.query||{},s=this.router.currentRoute.value.params||{};return Object.keys(i).length?i:Object.keys(s).length?s:{}};static moduleObj={};static loadModule=async i=>{if(!k.moduleObj[i])throw new Error(`模块${i}未加载,请赋值如:TSys.moduleObj = { ${i}: ()=>import('${i}') }`);const s=await k.moduleObj[i]();return s.default??s};static tipMessages={};static tipMessagesGap=500;static showMessage(i,s,l={}){const a=Date.now();if(!this.tipMessages[i]||a-this.tipMessages[i]>this.tipMessagesGap){this.tipMessages[i]=a;const t=Object.assign({message:i,type:s},l);p.ElMessage(t),setTimeout(()=>{delete this.tipMessages[i]},this.tipMessagesGap)}}static fail=(i,s={})=>{this.showMessage(i,"error",s)};static success=(i,s={})=>{this.showMessage(i,"success",s)};static loadingObj=null;static loadingTimer=null;static loading=(i=!0,s="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{i?this.loadingObj=p.ElLoading.service({lock:!0,text:s,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(i,s=!0)=>{if(s){let l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(i,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}else window.open(i,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=i=>new Promise(async(s,l)=>{let a=document.getElementById(i.id);const t=await k.loadModule("html2canvas");try{t(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:i.windowWidth,height:i.windowHeight,windowWidth:i.windowWidth,windowHeight:i.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(n){let c=n.toDataURL("image/png");s(c)})}catch(n){l(n)}})}class C{static customComponent={};static findOptions=(i,s)=>{const l=i.column.find(t=>t.key===s),a=t=>t.replace(/-([a-z])/g,(n,c)=>c.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(i,s,l)=>{const a=C.findOptions(i,s);a&&(a.data=l)};static form={openBefore:{parentId:(i,s,l,a)=>{const t=b.config.table.rowKey;i?s.type===k.EDialog.Insert?(s.form.parentId=i[t],s.form.sort=i.children.length+1):s.form.parentId=i.parentId.substring(i.parentId.lastIndexOf(",")+1):(s.form.parentId="0",s.form.sort=l.length+1),C.setOptionsData(a,"parentId",[{[t]:"0",title:"根",children:l}])}}}}class E{static getIdFun=()=>StrUtil.uuid();static setId=(i,s,l)=>{s[i]||(s[i]=[]);const a=b.config.table.rowKey;s[i].forEach(t=>{l.forEach(n=>{let c=n.default??"";n.type==="number"&&(c=n.default??0),n.type==="boolean"&&(c=n.default??!1),n.type==="time"&&(c=n.default??new Date),t[n.value]===void 0&&(t[n.value]=c)}),t[a]||(t[a]=E.getIdFun())})};static add=(i,s,l,a)=>{const t=JSONUtil.cp(l);E.setId(i,s,l);const n=b.config.table.rowKey;s[i].push(t.reduce((c,m)=>{let h=m.default??"";return m.type==="number"&&(h=m.default??0),m.type==="boolean"&&(h=m.default??!1),m.type==="time"&&(h=m.default??new Date),c[m.value]=h,c},{[n]:E.getIdFun()})),a?.(s)};static remove=(i,s,l,a)=>{const t=b.config.table.rowKey;s[i]=s[i].filter(n=>n[t]!==l[t]),a?.(s)};static getNoIdData=(i,s)=>{const l=JSONUtil.cp(i),a=b.config.table.rowKey;return l.forEach(t=>{t[a]&&delete t[a],s&&t[s]&&E.getNoIdData(t[s],s)}),l}}const I={key:0,class:"column",style:{width:"100%",gap:"10px"}},L={class:"row items-center",style:{gap:"10px",width:"100%"}},S=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""}},emits:["change"],setup(o,{emit:i}){const s=o,l=e.reactive({show:!1,add:(t,n,c)=>{E.add(t,n,c,()=>{a("change")})},remove:(t,n,c)=>{E.remove(t,n,c,()=>{a("change")})}});e.onMounted(()=>{E.setId(s.field,s.row,s.itemFields),l.show=!0});const a=i;return(t,n)=>{const c=e.resolveComponent("el-button"),m=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"list-start",{row:o.row}),e.createElementVNode("div",null,[e.createVNode(c,{link:"",type:"primary",onClick:n[0]||(n[0]=h=>l.add(o.field,o.row,o.itemFields))},{default:e.withCtx(()=>[...n[2]||(n[2]=[e.createTextVNode("添加",-1)])]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.row[o.field],h=>(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(t.$slots,"item-start",{item:h,row:o.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.itemFields,f=>(e.openBlock(),e.createBlock(m,{modelValue:h[f.value],"onUpdate:modelValue":r=>h[f.value]=r,style:e.normalizeStyle({width:o.inputWidth}),class:e.normalizeClass(o.inputClass),placeholder:f[o.label]||f[o.value],onChange:n[1]||(n[1]=r=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(t.$slots,"item-end",{item:h,row:o.row}),e.createVNode(c,{link:"",type:"danger",onClick:f=>l.remove(o.field,o.row,h)},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),e.renderSlot(t.$slots,"list-end",{row:o.row})])):e.createCommentVNode("",!0)}}}),M={class:"row curd-row"},D=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(o,{expose:i}){const s=k.isFun,l=k.EDialog,a=e.ref(),t=o,n=e.reactive({rules:{},show:!0,form:{},formDefault:{},formColumn:[],getDisabled:c=>c.disabled?.[(t.type||l.Insert)===l.Insert?"create":"update"],initColumnForm:async()=>{const c=t.option;n.formColumn=[];const m=[],h=t.option.form?.maxSpan||12,f=t.option.form?.defaultSpan||h;let r=[];const d=g=>{if(n.formDefault[g.key]=g.value,g.isForm){g.form=g.form||{span:f},g.form.span=g.form.span??f;let w=g.form.span,V=r.reduce((x,Ce)=>x+Ce.span,w);const B=r.length;r.push({item:g,span:w}),(B===1&&r[0].span===0||V>=h||w===0&&B>1)&&(m.push(r),r=[]),g.rules&&(n.rules[g.key]=g.rules)}};c.column.forEach(g=>{g.isForm=!0,d(g)}),r.length>0&&m.push(r),n.formColumn=m,n.form=JSONUtil.cp(n.formDefault)},init:async()=>{n.show=!1,await e.nextTick(),n.initColumnForm()}});return n.initColumnForm(),i({ref:a,conf:n}),(c,m)=>(e.openBlock(),e.createBlock(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:a,model:n.form,rules:n.rules},{default:e.withCtx(()=>[n.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.formColumn,h=>(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(c.$slots,"form-start",{row:n.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s)(f.item.show?.form,n.form)??!0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.item.form.span>0?`col-${f.item.form.span}`:"col")},[e.createVNode(e.unref(p.ElFormItem),{label:f.item.label,prop:f.item.key,"label-width":f.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"form-"+f.item.key+"-start",{row:n.form,item:f.item}),e.renderSlot(c.$slots,"form-"+f.item.key,{row:n.form,item:f.item},()=>[f.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.input,e.toHandlers(f.item.options?.input?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.switch,e.toHandlers(f.item.options?.switch?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.select,e.toHandlers(f.item.options?.select?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.select?.data,r=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="list"?(e.openBlock(),e.createBlock(S,e.mergeProps({key:3,row:n.form,field:f.item.key},{ref_for:!0},f.item.options?.list,e.toHandlers(f.item.options?.list?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):f.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:4,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.treeSelect,e.toHandlers(f.item.options?.treeSelect?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:5,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.datetime,e.toHandlers(f.item.options?.datetime?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type&&e.unref(C).customComponent[f.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C).customComponent[f.item.type]),e.mergeProps({key:6,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.[f.item.type],e.toHandlers(f.item.options?.[f.item.type]?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(c.$slots,"form-"+f.item.key+"-end",{row:n.form,item:f.item})]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(c.$slots,"form-end",{row:n.form})]))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});function Ve(o){return o}const j={search:"搜索",add:"新增",edit:"编辑",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?"};class y{static t(i,...s){if(typeof i=="function")return i(...s);i=String(i);let l=0;return i.replace(/{([^}]+)}/g,(a,t)=>l<s.length?String(s[l++]):`{${t}}`)}static setI18n=i=>{y.curd=ObjectUtil.deepMerge(y.curd,i)};static tCurd(i,...s){return this.t(this.curd[i],...s)}static curd=j}class F{static exportToExcel=async(i,s,l)=>{if(!i||i.length===0)return;const a=await k.loadModule("xlsx"),t=i.map(m=>{const h={};return s.forEach(f=>{h[f.label]=m[f.key]}),h}),n=a.utils.json_to_sheet(t),c=a.utils.book_new();a.utils.book_append_sheet(c,n,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(c,`${l}.xlsx`)}}const N=k.EDialog,z=o=>{const i=e.ref(),s=e.ref(),l=e.reactive({search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(a,t=y.tCurd("placeholderInput"))=>a.text?.search?.placeholder===void 0?`${t}${a.label}`:a.text?.search?.placeholder,getFormData:()=>{let a={};o.option.column.forEach(n=>{(typeof n.show?.search=="function"?n.show?.search(l.search.form):n.show?.search)&&(a[n.key]=l.search.form[n.key])});const t=o.option.search?.before?.(a);return t&&(a=t),a},reset:()=>{const a=l.search.formDefault;Object.keys(a).forEach(t=>{o.option.search?.resetMode==="none"?a[t]=void 0:a[t]=l.search.formDefault[t]}),l.search.form=JSONUtil.cp(a),l.page.num=1,o.option.init!==!1&&l.table.getList()},submit:()=>{l.page.num=1,l.table.getList()}},page:{size:o.option.page?.size||10,sizeList:o.option.page?.sizeList||[10,20,50,100],num:1,total:0,layout:o.option.page?.layout||"total, sizes, prev, pager, next, jumper"},table:{op:{width:(...a)=>a.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(a,t)=>{},all:()=>{if(l.table.expand.isExpand)l.table.expand.rowKeys=[];else{const a=t=>{let n=[];return t.forEach(c=>{n.push(c[o.option.table.rowKey]),c.children&&c.children.length>0&&(n=n.concat(a(c.children)))}),n};l.table.expand.rowKeys=a(l.table.data)}l.table.expand.isExpand=!l.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{l.table.loading=!0;const a=o.option.api.list;try{await l.initApiData("init");const t=await a({[b.config.page.size]:l.page.size,[b.config.page.num]:l.page.num,...l.search.getFormData()}),n=b.config.result,c=t.data||{[n.list]:t};let m=(Array.isArray(c[n.list]),c[n.list]);const h=l.update.formColumn.flat(),f=JSONUtil.cp(m).map(r=>(Object.keys(r).forEach(g=>{const w=h.find(V=>V.item.key===g);if(w&&w.item.type==="select"){const V=w.item.options?.select?.data?.find(B=>B.value==r[g])?.label;V&&(r[g]=V)}}),r));l.table.data=o.option.data?await o.option.data(f,m):f,l.page.total=c[n.total]||0}catch(t){console.error(t)}finally{l.table.loading=!1}},selection:{list:[],change:a=>{l.table.selection.list=a}}},export:{run:{start:async a=>{let t=await l.export.run[a](),n=o.option.column;const c=JSONUtil.cp({data:t,columns:n}),m=o.option.tools?.export||{};m.before&&m.before(c),F.exportToExcel(c.data,c.columns,m.fileName)},select:()=>{if(l.table.selection.list.length===0)throw k.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return l.table.selection.list},page:()=>{if(l.table.data.length===0)throw k.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return l.table.data},all:async()=>{l.export.loading=!0;try{if(o.option.tools?.export?.all){await o.option.tools?.export?.all({[b.config.page.size]:l.page.size,[b.config.page.num]:l.page.num,...l.search.getFormData()});return}const a=o.option.api.list,t=await a({[b.config.page.size]:999999,[b.config.page.num]:1});return(t.data||{[b.config.result.list]:t})[b.config.result.list]}catch(a){console.error(a)}finally{l.export.loading=!1}}},loading:!1,click:a=>{l.export.loading||l.export.run.start(a)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:N.Insert,form:{},formDefault:{},formColumn:[],getDisabled:a=>a.disabled?.[l.update.type===N.Insert?"create":"update"],edit:{data:{},getApiData:a=>{if(o.option.form?.editAll)return a;let t={[o.option.table?.rowKey]:l.update.edit.data[o.option.table?.rowKey]};return Object.keys(l.update.edit.data).forEach(n=>{a[n]!==l.update.edit.data[n]&&(t[n]=a[n])}),t}},open:(a,t)=>{l.update.showContent||FunUtil.throttle(async()=>{k.loading(!0);try{await l.initApiData("update");const n=a===N.Insert;if(!n&&o.option.table?.inlineEdit){l.inlineEdit.open(t);return}l.update.type=a,l.update.edit.data=t,l.update.title=n?y.tCurd("add"):y.tCurd("edit"),l.update.form=JSONUtil.cp(n?l.update.formDefault:t),await o.option.form?.openBefore?.(t,l.update),l.update.show=!0,l.update.showContent=!0,o.option.form?.openAfter?.(t,l.update)}catch(n){console.error(n)}finally{k.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await s.value?.validate(async(c,m)=>new Promise((h,f)=>{c||(k.fail(y.tCurd("checkFormData")),f(!1)),h()})),l.update.loading=!0;const a=l.update.type===N.Insert?o.option.api.create:o.option.api.update;let t=JSONUtil.cp(l.update.form);delete t.children,await o.option.form?.submitBefore?.(t,l.update);const n=new Set(o.option.column.filter(c=>c.type==="datetime").map(c=>c.key));Object.keys(t).forEach(c=>{if(n.has(c)&&t[c]!=null){const m=new Date(t[c]).getTime();isNaN(m)||(t[c]=m)}});try{if(!a)return;await a({...t}),l.update.close(),await l.table.getList(),o.option.form?.submitAfter?.(t,l.update)}catch(c){console.error(c)}finally{l.update.loading=!1}})},close:()=>{l.update.show=!1,setTimeout(()=>{l.update.showContent=!1},350)}},inlineEdit:{row:null,form:{},loading:!1,open:a=>{l.inlineEdit.row=a,l.inlineEdit.form=JSONUtil.cp(a)},close:()=>{l.inlineEdit.row=null,l.inlineEdit.form={}},submit:()=>{FunUtil.throttle(async()=>{l.inlineEdit.loading=!0;const a=o.option.api.update;let t=JSONUtil.cp(l.inlineEdit.form);delete t.children;try{if(!a)return;await a({...t}),l.inlineEdit.close(),await l.table.getList(),k.success(y.tCurd("operationSuccess"))}catch(n){console.error(n)}finally{l.inlineEdit.loading=!1}})}},remove:{title:y.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{l.remove.show=!1},open:a=>{if(a.length===0){k.fail(y.tCurd("selectDataToDelete"));return}l.remove.items=a,l.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{l.remove.loading=!0;const a=o.option.api.delete;try{if(!a)return;await a({[o.option.table?.rowKey]:l.remove.items.map(t=>t[o.option.table?.rowKey]),items:l.remove.items}),k.success(y.tCurd("operationSuccess")),l.table.data.length<=1&&l.page.num>1&&(l.page.num-=1),l.remove.close(),await l.table.getList()}catch(t){console.error(t)}finally{l.remove.loading=!1}})}},init:()=>{l.initCurdConfig(),l.initColumnOptions(),l.initColumnForm()},apiDataMap:{},initApiData:async a=>{const t=[],n=c=>{if(c.children&&c.children.length){c.children.forEach(m=>n(m));return}if(c.type==="select"&&c.options?.select?.dataApi&&c.options?.select?.dataApiConfig?.[a]){if(l.apiDataMap[c.key]&&c.options?.select?.dataApiConfig?.once)return;const m=(async()=>{try{let h=await c.options?.select?.dataApi?.();if(h){const f=c.options?.select?.dataPath;f&&(h=ObjectUtil.getPathValue(h,f)),c.options.select.data=h,l.apiDataMap[c.key]=h}}catch{}})();t.push(m)}};return o.option.column.forEach(c=>{n(c)}),await Promise.all(t),!0},initCurdConfig:()=>{const a=JSONUtil.cp(b.config);a.table.emptyText=y.tCurd("noData");const t=ObjectUtil.deepMerge(a,o.option||{});Object.keys(t).forEach(n=>{o.option[n]=t[n]})},initColumnOptions:()=>{let a=JSONUtil.cp(b.config.columnConfig);a.options=ObjectUtil.deepMerge(a.options,{switch:{activeLabel:y.tCurd("switchOn"),inactiveLabel:y.tCurd("switchOff")}});const t=n=>{if(n.table=ObjectUtil.deepMerge(a.table,n.table||{}),n.children){n.children.forEach(c=>{t(c)});return}n.options=ObjectUtil.deepMerge(a.options,n.options||{}),n.form=ObjectUtil.deepMerge(a.form,n.form||{}),n.show=ObjectUtil.deepMerge(a.show,n.show||{}),n.sort=ObjectUtil.deepMerge(a.sort,n.sort||{}),n.type=n.type||a.type,n.type==="switch"&&(n.options.switch.tableBeforeChange=async(c,m)=>{const h=n.options?.switch;try{await i.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")}),l.table.loading=!0;try{return o.option.api.update?(await o.option.api.update({[o.option.table?.rowKey]:m[o.option.table?.rowKey],[c]:m[c]===h.activeValue?h.inactiveValue:h.activeValue,final(f,r,d){l.table.loading=!1}}),l.table.loading=!1,k.success(y.tCurd("operationSuccess")),l.table.getList(),!0):void 0}catch(f){return console.error(f),!1}finally{l.table.loading=!1}}catch{return!1}}),n.type==="tree-select"&&(n.options.treeSelect.rowKey=o.option.table?.rowKey,n.options.treeSelect.nodeKey=o.option.table?.rowKey)};o.option.column.forEach(t),o.option.table?.column?.forEach(t)},initColumnForm:()=>{const a=o.option;l.update.formColumn=[],l.table.column.show={list:[],listSource:[]};const t=[],n=o.option.form?.maxSpan||12,c=o.option.form?.defaultSpan||n/2;let m=[];const h=d=>{if(d.children){l.table.column.show.list.push(d.key),d.children.forEach(g=>{h(g)});return}if(l.update.formDefault[d.key]=d.value,d.table.table&&(d.show.table&&l.table.column.show.list.push(d.key),d.table.table&&l.table.column.show.listSource.push(d.key)),d.isForm){d.form=d.form||{span:c},d.form.span=d.form.span??c;let g=d.form.span,w=m.reduce((B,x)=>B+x.span,g);const V=m.length;if(m.push({item:d,span:g}),(V===1&&m[0].span===0||w>=n||g===0&&V>1)&&(t.push(m),m=[]),d.rules){const B={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},x=(B[d.type]||B.input)+d.label;l.update.rules[d.key]=typeof d.rules=="boolean"?[{required:!0,message:x,trigger:"blur"}]:d.rules}}},f=(d,g)=>{d.isForm=g,Array.isArray(d.children)&&d.children.forEach(w=>f(w,g))};a.column.forEach(d=>{d.isForm=!0,f(d,!0),h(d)}),o.option.table?.column?.forEach(d=>{f(d,!1),h(d)}),l.search.column.list=a.column.concat(a.table?.column||[]),l.table.column.list=l.search.column.list.filter(d=>d.table?.table),l.search.column.list.sort((d,g)=>d.sort?.search-g.sort?.search),l.table.column.list.sort((d,g)=>d.sort?.table-g.sort?.table),m.length>0&&t.push(m),l.update.formColumn=t;const r=o.option.search?.formDefault;r&&Object.keys(r).forEach(d=>{l.search.formDefault[d]=r[d]}),a.column.forEach(d=>{d.show?.search||(l.search.formDefault[d.key]=void 0)}),l.search.form=JSONUtil.cp(l.search.formDefault)}});return l.init(),e.onMounted(()=>{o.option.init!==!1&&l.table.getList()}),{conf:l,switchConfirmRef:i,ruleFormRef:s}},R={class:"dialog-footer"},A=e.defineComponent({__name:"switchConfirm",setup(o,{expose:i}){const s=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let t=null,n=null;const c=f=>(f?.title&&(l.value=f.title),f?.content&&(a.value=f.content),s.value=!0,new Promise((r,d)=>{t=r,n=d})),m=()=>{s.value=!1,t?.(!0),t=null,n=null},h=()=>{s.value=!1,n?.(new Error("用户取消操作")),t=null,n=null};return i({open:c}),(f,r)=>(e.openBlock(),e.createBlock(e.unref(p.ElDialog),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=d=>s.value=d),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createElementVNode("span",R,[e.createVNode(e.unref(p.ElButton),{onClick:h},{default:e.withCtx(()=>[...r[1]||(r[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:m},{default:e.withCtx(()=>[...r[2]||(r[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"]))}}),U=(o,i)=>{const s=o.__vccOpts||o;for(const[l,a]of i)s[l]=a;return s},K={},H={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function J(o,i){return e.openBlock(),e.createElementBlock("svg",H,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const W=U(K,[["render",J]]),q={},G={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(o,i){return e.openBlock(),e.createElementBlock("svg",G,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const Q=U(q,[["render",X]]),Y={class:"row flex-center table-header-label"},Z={class:"table-header-tooltip"},P=["onClick"],_=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(o){const i=e.getCurrentInstance().type;return(s,l)=>{const a=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[o.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label},{ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(s.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",Y,[t.table?.tooltip?(e.openBlock(),e.createBlock(a,{key:0,effect:"dark",content:t.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",Z,[e.createVNode(Q)])]),_:1},8,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)])])]),default:e.withCtx(({row:n})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[0]||(l[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)),{conf:o.conf,columnList:t.children,option:o.option},e.createSlots({_:2},[e.renderList(s.$slots,(c,m)=>({name:m,fn:e.withCtx(h=>[e.renderSlot(s.$slots,m,e.mergeProps({ref_for:!0},h||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.show?.form&&o.option.table?.inlineEdit&&o.conf.inlineEdit.row===n&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.conf.inlineEdit.form[t.key],"onUpdate:modelValue":c=>o.conf.inlineEdit.form[t.key]=c},{ref_for:!0},t.options?.input,{size:"small",style:{width:"100%"},onKeyup:e.withKeys(o.conf.inlineEdit.submit,["enter"])}),null,16,["modelValue","onUpdate:modelValue","onKeyup"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:o.conf.inlineEdit.form[t.key],"onUpdate:modelValue":c=>o.conf.inlineEdit.form[t.key]=c},{ref_for:!0},t.options?.select,{size:"small",style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.select?.data,c=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):e.renderSlot(s.$slots,"table-"+t.key,{key:1,row:n,item:t},()=>[t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:0,modelValue:n[t.key],"onUpdate:modelValue":c=>n[t.key]=c,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,n)},{ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:c=>t.table?.click?.callback?.(n)},e.toDisplayString(n[t.key]),15,P))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),$=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(o){return(i,s)=>o.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[0]||(s[0]=l=>o.conf.update.form[o.item.item.key]=l)},o.item.item.options?.input,e.toHandlers(o.item.item.options?.input?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[1]||(s[1]=l=>o.conf.update.form[o.item.item.key]=l)},o.item.item.options?.switch,{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[2]||(s[2]=l=>o.conf.update.form[o.item.item.key]=l)},o.item.item.options?.select,e.toHandlers(o.item.item.options?.select?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.item.item.options?.select?.data,l=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):o.item.item.type==="list"?(e.openBlock(),e.createBlock(S,e.mergeProps({key:3,row:o.conf.update.form,field:o.item.item.key},o.item.item.options?.list,e.toHandlers(o.item.item.options?.list?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):o.item.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:4,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[3]||(s[3]=l=>o.conf.update.form[o.item.item.key]=l)},o.item.item.options?.treeSelect,e.toHandlers(o.item.item.options?.treeSelect?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):o.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:5,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[4]||(s[4]=l=>o.conf.update.form[o.item.item.key]=l)},o.item.item.options?.datetime,e.toHandlers(o.item.item.options?.datetime?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type&&e.unref(C).customComponent[o.item.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C).customComponent[o.item.item.type]),e.mergeProps({key:6,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[5]||(s[5]=l=>o.conf.update.form[o.item.item.key]=l)},o.item.item.options?.[o.item.item.type],e.toHandlers(o.item.item.options?.[o.item.item.type]?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),v={class:"col relative cc1-form-box"},ee={class:"absolute row fit",style:{overflow:"hidden"}},te={class:"col column fit-width no-wrap"},oe={key:0,class:"relative curd-search fit-width"},le={class:"mb-10 flex justify-between items-center fit-width"},ne={class:"flex items-center",style:{gap:"10px"}},ae={key:0},re={key:1},ie={key:2},se={class:"export-btn"},ce={class:"flex items-center",style:{gap:"10px"}},de={class:"col fit-width relative form-box"},fe={class:"absolute column fit form-box-content"},me={class:"row justify-end mt-10 mb-10"},pe={class:"row form-item-content",style:{width:"100%"}},he={class:"col"},ge={class:"row form-item-content",style:{width:"100%"}},ye={class:"col"},ke={class:"dialog-footer"},be={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(o,{expose:i}){const s=k.EDialog,l=o,a=k.isFun,{conf:t,switchConfirmRef:n,ruleFormRef:c}=z(l);return i({conf:t}),(m,h)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",ee,[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",te,[o.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",oe,[e.createVNode(e.unref(p.ElForm),{model:e.unref(t).search.form,inline:""},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(t).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).search.column.list,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.key},[(typeof r.show?.search=="function"?r.show?.search(e.unref(t).search.form):r.show?.search)?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0,label:typeof r.text?.search?.label=="string"?r.text?.search?.label:r.label,class:e.normalizeClass({"hide-label":typeof r.text?.search?.label=="boolean"?!r.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+r.key,{row:e.unref(t).search.form},()=>[r.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":d=>e.unref(t).search.form[r.key]=d,placeholder:e.unref(t).search.getPlaceholder(r),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.input,e.toHandlers(r.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":d=>e.unref(t).search.form[r.key]=d,placeholder:e.unref(t).search.getPlaceholder(r,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.switch,e.toHandlers(r.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.options?.switch?.activeValue,label:r.options?.switch?.activeLabel,value:r.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.options?.switch?.inactiveValue,label:r.options?.switch?.inactiveLabel,value:r.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":d=>e.unref(t).search.form[r.key]=d,placeholder:e.unref(t).search.getPlaceholder(r,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.select,e.toHandlers(r.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":d=>e.unref(t).search.form[r.key]=d},{ref_for:!0},r.options?.datetime,e.toHandlers(r.options?.datetime?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.type&&e.unref(C).customComponent[r.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C).customComponent[r.type]),e.mergeProps({key:4,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":d=>e.unref(t).search.form[r.key]=d},{ref_for:!0},r.options?.[r.type],e.toHandlers(r.options?.[r.type]?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+r.key+"-right",{row:e.unref(t).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(t).search.form}),o.option.tools?.search||o.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0},{default:e.withCtx(()=>[o.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(t).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),o.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,onClick:e.unref(t).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(t).search.form})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createElementVNode("div",ne,[e.unref(a)(o.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:h[0]||(h[0]=r=>e.unref(t).update.open(e.unref(s).Insert))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.table?.selectable&&e.unref(a)(o.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:h[1]||(h[1]=r=>e.unref(t).remove.open(e.unref(t).table.selection.list))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(p.ElButton),{type:"warning",onClick:h[2]||(h[2]=r=>e.unref(t).table.expand.all())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(p.ElDropdown),{key:3,onCommand:e.unref(t).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(p.ElDropdownMenu),null,{default:e.withCtx(()=>[o.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(p.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(t).export.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",ce,[e.renderSlot(m.$slots,"tools-right"),o.option.tools?.refresh===void 0||o.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:0,class:"refresh-btn",onClick:h[3]||(h[3]=(...r)=>e.unref(t).table.getList&&e.unref(t).table.getList(...r))},[e.createVNode(W)])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",de,[e.createElementVNode("div",fe,[e.withDirectives((e.openBlock(),e.createBlock(e.unref(p.ElTable),e.mergeProps({data:e.unref(t).table.data,border:o.option.table?.border===void 0?!0:o.option.table?.border},o.option.table,{onSelectionChange:e.unref(t).table.selection.change,"expand-row-keys":e.unref(t).table.expand.rowKeys,onExpandChange:e.unref(t).table.expand.change}),{default:e.withCtx(()=>[o.option.table?.selectable&&(e.unref(a)(o.option.tools?.delete)||o.option.tools?.export?.show)?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),{key:0,type:"selection",selectable:typeof o.option.table?.selectable=="function"?o.option.table?.selectable:void 0,width:"55"},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(_,{conf:e.unref(t),columnList:e.unref(t).table.column.list,option:o.option},e.createSlots({_:2},[e.renderList(m.$slots,(r,d)=>({name:d,fn:e.withCtx(g=>[e.renderSlot(m.$slots,d,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(o.option.table?.add)||e.unref(a)(o.option.table?.update)||e.unref(a)(o.option.table?.delete)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:1,width:e.unref(t).table.op.width(e.unref(a)(o.option.table?.add),e.unref(a)(o.option.table?.update),e.unref(a)(o.option.table?.delete),m.$slots["table-op-left"],m.$slots["table-op-right"]),align:"center",fixed:"right"},o.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:r})=>[e.renderSlot(m.$slots,"table-op-left",{row:r}),o.option.table?.inlineEdit&&e.unref(t).inlineEdit.row===r?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(p.ElButton),{link:"",type:"info",onClick:e.unref(t).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{link:"",type:"primary",onClick:e.unref(t).inlineEdit.submit,loading:e.unref(t).inlineEdit.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:r})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(o.option.table?.add,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,link:"",type:"primary",onClick:d=>e.unref(t).update.open(e.unref(s).Insert,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.update,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,link:"",type:"warning",onClick:d=>e.unref(t).update.open(e.unref(s).Update,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.delete,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:2,link:"",type:"danger",onClick:d=>e.unref(t).remove.open([r])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:r})],64))]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","expand-row-keys","onExpandChange"])),[[f,e.unref(t).table.loading]])])]),e.createElementVNode("div",me,[o.option.page?.show===void 0||o.option.page?.show?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),{key:0,"current-page":e.unref(t).page.num,"onUpdate:currentPage":h[4]||(h[4]=r=>e.unref(t).page.num=r),"page-size":e.unref(t).page.size,"onUpdate:pageSize":h[5]||(h[5]=r=>e.unref(t).page.size=r),background:"","page-sizes":e.unref(t).page.sizeList,"pager-count":7,layout:e.unref(t).page.layout,total:e.unref(t).page.total,onSizeChange:e.unref(t).table.getList,onCurrentChange:e.unref(t).table.getList},null,8,["current-page","page-size","page-sizes","layout","total","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])]),e.renderSlot(m.$slots,"box-right")]),e.createVNode(e.unref(p.ElDialog),e.mergeProps({modelValue:e.unref(t).update.show,"onUpdate:modelValue":h[6]||(h[6]=r=>e.unref(t).update.show=r),title:e.unref(t).update.title,"before-close":e.unref(t).update.close},o.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",ke,[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(t).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:e.unref(t).update.submit,loading:e.unref(t).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:c,model:e.unref(t).update.form,rules:e.unref(t).update.rules},{default:e.withCtx(()=>[e.unref(t).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t).update.formColumn,r=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(()=>{const d=[],g=w=>{if(w.children)return g(w.children);d.push(...w.map(V=>V.item.show?.form))};return g(r),d},e.unref(t).update.form)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:o.option.form?.stripe===void 0?!0:o.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(t).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(d.item.show?.form,e.unref(t).update.form)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.item.form.span>0?`col-${d.item.form.span}`:"col")},[d.item.children?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(d.children,g=>(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{class:e.normalizeClass({"hide-label":typeof g.item.text?.form?.label=="boolean"?!g.item.text?.form?.label:!1}),label:typeof g.item.text?.form?.label=="string"?g.item.text?.form?.label:g.item.label,prop:g.item.key,"label-width":g.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.renderSlot(m.$slots,"form-"+g.item.key+"-start",{row:e.unref(t).update.form,item:g.item}),e.createElementVNode("div",he,[e.renderSlot(m.$slots,"form-"+g.item.key,{row:e.unref(t).update.form,item:g.item},()=>[e.createVNode($,{conf:e.unref(t),item:d},null,8,["conf","item"])]),e.renderSlot(m.$slots,"form-"+g.item.key+"-right",{row:e.unref(t).update.form,item:g.item})]),e.renderSlot(m.$slots,"form-"+g.item.key+"-end",{row:e.unref(t).update.form,item:g.item})])]),_:2},1032,["class","label","prop","label-width"]))),256)):(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:1,class:e.normalizeClass({"hide-label":typeof d.item.text?.form?.label=="boolean"?!d.item.text?.form?.label:!1}),label:typeof d.item.text?.form?.label=="string"?d.item.text?.form?.label:d.item.label,prop:d.item.key,"label-width":d.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.renderSlot(m.$slots,"form-"+d.item.key+"-start",{row:e.unref(t).update.form,item:d.item}),e.createElementVNode("div",ye,[e.renderSlot(m.$slots,"form-"+d.item.key,{row:e.unref(t).update.form,item:d.item},()=>[e.createVNode($,{conf:e.unref(t),item:d},null,8,["conf","item"])]),e.renderSlot(m.$slots,"form-"+d.item.key+"-right",{row:e.unref(t).update.form,item:d.item})]),e.renderSlot(m.$slots,"form-"+d.item.key+"-end",{row:e.unref(t).update.form,item:d.item})])]),_:2},1032,["class","label","prop","label-width"]))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(t).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(p.ElDialog),{modelValue:e.unref(t).remove.show,"onUpdate:modelValue":h[7]||(h[7]=r=>e.unref(t).remove.show=r),title:e.unref(t).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",be,[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(t).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:e.unref(t).remove.submit,loading:e.unref(t).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(t).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(A,{ref_key:"switchConfirmRef",ref:n},null,512)])}}});class ue{static async download(i,s="download.png"){const l=document.createElement("a");l.style.display="none",l.href=i,l.setAttribute("download",s),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(i)}static exportJSONFile=(i,s)=>{const l=new Blob([JSON.stringify(i)],{type:"application/json"}),a=URL.createObjectURL(l),t=document.createElement("a");t.href=a,t.download=`${s||"config"}.json`,t.click()};static importFile=async i=>new Promise((s,l)=>{const a=document.createElement("input");a.type="file";const t=i?.accept||".json";a.accept=t,a.style.display="none",a.onchange=n=>{const c=n.target.files[0];if(!c){k.fail("未选择文件"),l("未选择文件");return}const m=new FileReader;m.onload=async h=>{const f=t==".json"?JSON.parse(h.target.result):h.target.result;s(f)},m.onerror=()=>{k.fail("文件读取失败"),l("文件读取失败")},m.readAsText(c),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const T=(o,i)=>{if(o.component("TCurd",O),o.component("TFormList",S),o.component("TColumn",D),i?.customComponent){C.customComponent=i.customComponent;for(const s in i.customComponent)o.component(s,i.customComponent[s])}},we={install:T};u.ArrUtil=E,u.ExcelUtil=F,u.TColumn=D,u.TCurd=O,u.TFile=ue,u.TForm=C,u.TFormConfig=b,u.TFormI18n=y,u.TFormList=S,u.TSys=k,u.default=we,u.install=T,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(u,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("element-plus"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue"],p):(u=typeof globalThis<"u"?globalThis:u||self,p(u.cc1Form={},u.ElementPlus,u.Vue))})(this,(function(u,p,e){"use strict";class g{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Insert:"Insert",Update:"Update",View:"View",Remove:"Remove"};static isFun=(i,...s)=>Array.isArray(i)?i.some(l=>typeof l=="function"?l(...s):l):typeof i=="function"?i(...s):i;static getRouterParams=()=>{const i=this.router.currentRoute.value.query||{},s=this.router.currentRoute.value.params||{};return Object.keys(i).length?i:Object.keys(s).length?s:{}};static moduleObj={};static loadModule=async i=>{if(!g.moduleObj[i])throw new Error(`模块${i}未加载,请赋值如:TSys.moduleObj = { ${i}: ()=>import('${i}') }`);const s=await g.moduleObj[i]();return s.default??s};static tipMessages={};static tipMessagesGap=500;static showMessage(i,s,l={}){const a=Date.now();if(!this.tipMessages[i]||a-this.tipMessages[i]>this.tipMessagesGap){this.tipMessages[i]=a;const t=Object.assign({message:i,type:s},l);p.ElMessage(t),setTimeout(()=>{delete this.tipMessages[i]},this.tipMessagesGap)}}static fail=(i,s={})=>{this.showMessage(i,"error",s)};static success=(i,s={})=>{this.showMessage(i,"success",s)};static loadingObj=null;static loadingTimer=null;static loading=(i=!0,s="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{i?this.loadingObj=p.ElLoading.service({lock:!0,text:s,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(i,s=!0)=>{if(s){let l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(i,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}else window.open(i,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=i=>new Promise(async(s,l)=>{let a=document.getElementById(i.id);const t=await g.loadModule("html2canvas");try{t(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:i.windowWidth,height:i.windowHeight,windowWidth:i.windowWidth,windowHeight:i.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(n){let d=n.toDataURL("image/png");s(d)})}catch(n){l(n)}})}class b{static config={page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"},dialog:{width:"980px",closeOnClickModal:!1},tools:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,fileName:"Export Data "}},form:{stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0},columnConfig:{type:"input",form:{labelWidth:"100px",width:"100%"},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},options:{switch:{activeValue:!0,inactiveValue:!1},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=i=>{b.config=ObjectUtil.deepMerge(b.config,i)}}class C{static customComponent={};static findOptions=(i,s)=>{const l=i.column.find(t=>t.key===s),a=t=>t.replace(/-([a-z])/g,(n,d)=>d.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(i,s,l)=>{const a=C.findOptions(i,s);a&&(a.data=l)};static form={openBefore:{parentId:(i,s,l,a)=>{const t=b.config.table.rowKey;i?s.type===g.EDialog.Insert?(s.form.parentId=i[t],s.form.sort=i.children.length+1):s.form.parentId=i.parentId.substring(i.parentId.lastIndexOf(",")+1):(s.form.parentId="0",s.form.sort=l.length+1),C.setOptionsData(a,"parentId",[{[t]:"0",title:"根",children:l}])}}}}class B{static getIdFun=()=>StrUtil.uuid();static setId=(i,s,l)=>{s[i]||(s[i]=[]);const a=b.config.table.rowKey;s[i].forEach(t=>{l.forEach(n=>{let d=n.default??"";n.type==="number"&&(d=n.default??0),n.type==="boolean"&&(d=n.default??!1),n.type==="time"&&(d=n.default??new Date),t[n.value]===void 0&&(t[n.value]=d)}),t[a]||(t[a]=B.getIdFun())})};static add=(i,s,l,a)=>{const t=JSONUtil.cp(l);B.setId(i,s,l);const n=b.config.table.rowKey;s[i].push(t.reduce((d,m)=>{let h=m.default??"";return m.type==="number"&&(h=m.default??0),m.type==="boolean"&&(h=m.default??!1),m.type==="time"&&(h=m.default??new Date),d[m.value]=h,d},{[n]:B.getIdFun()})),a?.(s)};static remove=(i,s,l,a)=>{const t=b.config.table.rowKey;s[i]=s[i].filter(n=>n[t]!==l[t]),a?.(s)};static getNoIdData=(i,s)=>{const l=JSONUtil.cp(i),a=b.config.table.rowKey;return l.forEach(t=>{t[a]&&delete t[a],s&&t[s]&&B.getNoIdData(t[s],s)}),l}}const L={key:0,class:"column",style:{width:"100%",gap:"10px"}},I={class:"row items-center",style:{gap:"10px",width:"100%"}},N=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""}},emits:["change"],setup(o,{emit:i}){const s=o,l=e.reactive({show:!1,add:(t,n,d)=>{B.add(t,n,d,()=>{a("change")})},remove:(t,n,d)=>{B.remove(t,n,d,()=>{a("change")})}});e.onMounted(()=>{B.setId(s.field,s.row,s.itemFields),l.show=!0});const a=i;return(t,n)=>{const d=e.resolveComponent("el-button"),m=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(t.$slots,"list-start",{row:o.row}),e.createElementVNode("div",null,[e.createVNode(d,{link:"",type:"primary",onClick:n[0]||(n[0]=h=>l.add(o.field,o.row,o.itemFields))},{default:e.withCtx(()=>[...n[2]||(n[2]=[e.createTextVNode("添加",-1)])]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.row[o.field],h=>(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"item-start",{item:h,row:o.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.itemFields,f=>(e.openBlock(),e.createBlock(m,{modelValue:h[f.value],"onUpdate:modelValue":r=>h[f.value]=r,style:e.normalizeStyle({width:o.inputWidth}),class:e.normalizeClass(o.inputClass),placeholder:f[o.label]||f[o.value],onChange:n[1]||(n[1]=r=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(t.$slots,"item-end",{item:h,row:o.row}),e.createVNode(d,{link:"",type:"danger",onClick:f=>l.remove(o.field,o.row,h)},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),e.renderSlot(t.$slots,"list-end",{row:o.row})])):e.createCommentVNode("",!0)}}}),M={class:"row curd-row"},D=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(o,{expose:i}){const s=g.isFun,l=g.EDialog,a=e.ref(),t=o,n=e.reactive({rules:{},show:!0,form:{},formDefault:{},formColumn:[],getDisabled:d=>d.disabled?.[(t.type||l.Insert)===l.Insert?"create":"update"],initColumnForm:async()=>{const d=t.option;n.formColumn=[];const m=[],h=t.option.form?.maxSpan||12,f=t.option.form?.defaultSpan||h;let r=[];const c=k=>{if(n.formDefault[k.key]=k.value,k.isForm){k.form=k.form||{span:f},k.form.span=k.form.span??f;let w=k.form.span,V=r.reduce((S,Ce)=>S+Ce.span,w);const E=r.length;r.push({item:k,span:w}),(E===1&&r[0].span===0||V>=h||w===0&&E>1)&&(m.push(r),r=[]),k.rules&&(n.rules[k.key]=k.rules)}};d.column.forEach(k=>{k.isForm=!0,c(k)}),r.length>0&&m.push(r),n.formColumn=m,n.form=JSONUtil.cp(n.formDefault)},init:async()=>{n.show=!1,await e.nextTick(),n.initColumnForm()}});return n.initColumnForm(),i({ref:a,conf:n}),(d,m)=>(e.openBlock(),e.createBlock(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:a,model:n.form,rules:n.rules},{default:e.withCtx(()=>[n.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.formColumn,h=>(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(d.$slots,"form-start",{row:n.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s)(f.item.show?.form,n.form)??!0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.item.form.span>0?`col-${f.item.form.span}`:"col")},[e.createVNode(e.unref(p.ElFormItem),{label:f.item.label,prop:f.item.key,"label-width":f.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"form-"+f.item.key+"-start",{row:n.form,item:f.item}),e.renderSlot(d.$slots,"form-"+f.item.key,{row:n.form,item:f.item},()=>[f.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.input,e.toHandlers(f.item.options?.input?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.switch,e.toHandlers(f.item.options?.switch?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.select,e.toHandlers(f.item.options?.select?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.select?.data,r=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="list"?(e.openBlock(),e.createBlock(N,e.mergeProps({key:3,row:n.form,field:f.item.key},{ref_for:!0},f.item.options?.list,e.toHandlers(f.item.options?.list?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):f.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:4,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.treeSelect,e.toHandlers(f.item.options?.treeSelect?.on||{}),{disabled:n.getDisabled(f.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:5,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.datetime,e.toHandlers(f.item.options?.datetime?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type&&e.unref(C).customComponent[f.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C).customComponent[f.item.type]),e.mergeProps({key:6,modelValue:n.form[f.item.key],"onUpdate:modelValue":r=>n.form[f.item.key]=r},{ref_for:!0},f.item.options?.[f.item.type],e.toHandlers(f.item.options?.[f.item.type]?.on||{}),{disabled:n.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(d.$slots,"form-"+f.item.key+"-end",{row:n.form,item:f.item})]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(d.$slots,"form-end",{row:n.form})]))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});function Ve(o){return o}const j={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?"};class y{static t(i,...s){if(typeof i=="function")return i(...s);i=String(i);let l=0;return i.replace(/{([^}]+)}/g,(a,t)=>l<s.length?String(s[l++]):`{${t}}`)}static setI18n=i=>{y.curd=ObjectUtil.deepMerge(y.curd,i)};static tCurd(i,...s){return this.t(this.curd[i],...s)}static curd=j}class F{static exportToExcel=async(i,s,l)=>{if(!i||i.length===0)return;const a=await g.loadModule("xlsx"),t=i.map(m=>{const h={};return s.forEach(f=>{h[f.label]=m[f.key]}),h}),n=a.utils.json_to_sheet(t),d=a.utils.book_new();a.utils.book_append_sheet(d,n,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(d,`${l}.xlsx`)}}const x=g.EDialog,z=o=>{const i=e.ref(),s=e.ref(),l=e.reactive({search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(a,t=y.tCurd("placeholderInput"))=>a.text?.search?.placeholder===void 0?`${t}${a.label}`:a.text?.search?.placeholder,getFormData:()=>{let a={};o.option.column.forEach(n=>{(typeof n.show?.search=="function"?n.show?.search(l.search.form):n.show?.search)&&(a[n.key]=l.search.form[n.key])});const t=o.option.search?.before?.(a);return t&&(a=t),a},reset:()=>{const a=l.search.formDefault;Object.keys(a).forEach(t=>{o.option.search?.resetMode==="none"?a[t]=void 0:a[t]=l.search.formDefault[t]}),l.search.form=JSONUtil.cp(a),l.page.num=1,o.option.init!==!1&&l.table.getList()},submit:()=>{l.page.num=1,l.table.getList()}},page:{size:o.option.page?.size||10,sizeList:o.option.page?.sizeList||[10,20,50,100],num:1,total:0,layout:o.option.page?.layout||"total, sizes, prev, pager, next, jumper"},table:{op:{width:(...a)=>a.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(a,t)=>{},all:()=>{if(l.table.expand.isExpand)l.table.expand.rowKeys=[];else{const a=t=>{let n=[];return t.forEach(d=>{n.push(d[o.option.table.rowKey]),d.children&&d.children.length>0&&(n=n.concat(a(d.children)))}),n};l.table.expand.rowKeys=a(l.table.data)}l.table.expand.isExpand=!l.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{l.table.loading=!0;const a=o.option.api.list;try{await l.initApiData("init");const t=await a({[b.config.page.size]:l.page.size,[b.config.page.num]:l.page.num,...l.search.getFormData()}),n=b.config.result,d=t.data||{[n.list]:t};let m=(Array.isArray(d[n.list]),d[n.list]);const h=l.update.formColumn.flat(),f=JSONUtil.cp(m).map(r=>(Object.keys(r).forEach(k=>{const w=h.find(V=>V.item.key===k);w&&w.item.type==="select"&&(w.item.table.format||(w.item.table.format=V=>w.item.options?.select?.data?.find(E=>E.value==V[k])?.label))}),r));l.table.data=o.option.data?await o.option.data(f,m):f,l.page.total=d[n.total]||0}catch(t){console.error(t)}finally{l.table.loading=!1}},selection:{list:[],change:a=>{l.table.selection.list=a}}},export:{run:{start:async a=>{let t=await l.export.run[a](),n=o.option.column;const d=JSONUtil.cp({data:t,columns:n}),m=o.option.tools?.export||{};m.before&&m.before(d),F.exportToExcel(d.data,d.columns,m.fileName)},select:()=>{if(l.table.selection.list.length===0)throw g.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return l.table.selection.list},page:()=>{if(l.table.data.length===0)throw g.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return l.table.data},all:async()=>{l.export.loading=!0;try{if(o.option.tools?.export?.all){await o.option.tools?.export?.all({[b.config.page.size]:l.page.size,[b.config.page.num]:l.page.num,...l.search.getFormData()});return}const a=o.option.api.list,t=await a({[b.config.page.size]:999999,[b.config.page.num]:1});return(t.data||{[b.config.result.list]:t})[b.config.result.list]}catch(a){console.error(a)}finally{l.export.loading=!1}}},loading:!1,click:a=>{l.export.loading||l.export.run.start(a)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:x.Insert,form:{},formDefault:{},formColumn:[],getDisabled:a=>l.update.type===x.View?!0:a.disabled?.[l.update.type===x.Insert?"create":"update"],edit:{data:{},getApiData:a=>{if(o.option.form?.editAll)return a;let t={[o.option.table?.rowKey]:l.update.edit.data[o.option.table?.rowKey]};return Object.keys(l.update.edit.data).forEach(n=>{a[n]!==l.update.edit.data[n]&&(t[n]=a[n])}),t}},view:{},open:(a,t)=>{l.update.showContent||FunUtil.throttle(async()=>{g.loading(!0);try{await l.initApiData("update");const n=a===x.Insert;if(!n&&o.option.table?.inlineEdit){l.inlineEdit.open(t);return}l.update.type=a,l.update.edit.data=t,l.update.title=y.tCurd(n?"add":a===x.View?"view":"edit"),l.update.form=JSONUtil.cp(n?l.update.formDefault:t),await o.option.form?.openBefore?.(t,l.update),l.update.show=!0,l.update.showContent=!0,o.option.form?.openAfter?.(t,l.update)}catch(n){console.error(n)}finally{g.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await s.value?.validate(async(d,m)=>new Promise((h,f)=>{d||(g.fail(y.tCurd("checkFormData")),f(!1)),h()})),l.update.loading=!0;const a=l.update.type===x.Insert?o.option.api.create:o.option.api.update;let t=JSONUtil.cp(l.update.form);delete t.children,await o.option.form?.submitBefore?.(t,l.update);const n=new Set(o.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(t).forEach(d=>{if(n.has(d)&&t[d]!=null){const m=new Date(t[d]).getTime();isNaN(m)||(t[d]=m)}});try{if(!a)return;await a({...t}),l.update.close(),await l.table.getList(),o.option.form?.submitAfter?.(t,l.update)}catch(d){console.error(d)}finally{l.update.loading=!1}})},close:()=>{l.update.show=!1,setTimeout(()=>{l.update.showContent=!1},350)}},inlineEdit:{row:null,form:{},loading:!1,open:a=>{l.inlineEdit.row=a,l.inlineEdit.form=JSONUtil.cp(a)},close:()=>{l.inlineEdit.row=null,l.inlineEdit.form={}},submit:()=>{FunUtil.throttle(async()=>{l.inlineEdit.loading=!0;const a=o.option.api.update;let t=JSONUtil.cp(l.inlineEdit.form);delete t.children;try{if(!a)return;await a({...t}),l.inlineEdit.close(),await l.table.getList(),g.success(y.tCurd("operationSuccess"))}catch(n){console.error(n)}finally{l.inlineEdit.loading=!1}})}},remove:{title:y.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{l.remove.show=!1},open:a=>{if(a.length===0){g.fail(y.tCurd("selectDataToDelete"));return}l.remove.items=a,l.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{l.remove.loading=!0;const a=o.option.api.delete;try{if(!a)return;await a({[o.option.table?.rowKey]:l.remove.items.map(t=>t[o.option.table?.rowKey]),items:l.remove.items}),g.success(y.tCurd("operationSuccess")),l.table.data.length<=1&&l.page.num>1&&(l.page.num-=1),l.remove.close(),await l.table.getList()}catch(t){console.error(t)}finally{l.remove.loading=!1}})}},init:()=>{l.initCurdConfig(),l.initColumnOptions(),l.initColumnForm()},apiDataMap:{},initApiData:async a=>{const t=[],n=d=>{if(d.children&&d.children.length){d.children.forEach(m=>n(m));return}if(d.type==="select"&&d.options?.select?.dataApi&&d.options?.select?.dataApiConfig?.[a]){if(l.apiDataMap[d.key]&&d.options?.select?.dataApiConfig?.once)return;const m=(async()=>{try{let h=await d.options?.select?.dataApi?.();if(h){const f=d.options?.select?.dataPath;f&&(h=ObjectUtil.getPathValue(h,f)),d.options.select.data=h,l.apiDataMap[d.key]=h}}catch{}})();t.push(m)}};return o.option.column.forEach(d=>{n(d)}),await Promise.all(t),!0},initCurdConfig:()=>{const a=JSONUtil.cp(b.config);a.table.emptyText=y.tCurd("noData");const t=ObjectUtil.deepMerge(a,o.option||{});Object.keys(t).forEach(n=>{o.option[n]=t[n]})},initColumnOptions:()=>{let a=JSONUtil.cp(b.config.columnConfig);a.options=ObjectUtil.deepMerge(a.options,{switch:{activeLabel:y.tCurd("switchOn"),inactiveLabel:y.tCurd("switchOff")}});const t=n=>{if(n.table=ObjectUtil.deepMerge(a.table,n.table||{}),n.children){n.children.forEach(d=>{t(d)});return}n.options=ObjectUtil.deepMerge(a.options,n.options||{}),n.form=ObjectUtil.deepMerge(a.form,n.form||{}),n.show=ObjectUtil.deepMerge(a.show,n.show||{}),n.sort=ObjectUtil.deepMerge(a.sort,n.sort||{}),n.type=n.type||a.type,n.type==="switch"&&(n.options.switch.tableBeforeChange=async(d,m)=>{const h=n.options?.switch;try{await i.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")}),l.table.loading=!0;try{return o.option.api.update?(await o.option.api.update({[o.option.table?.rowKey]:m[o.option.table?.rowKey],[d]:m[d]===h.activeValue?h.inactiveValue:h.activeValue,final(f,r,c){l.table.loading=!1}}),l.table.loading=!1,g.success(y.tCurd("operationSuccess")),l.table.getList(),!0):void 0}catch(f){return console.error(f),!1}finally{l.table.loading=!1}}catch{return!1}}),n.type==="tree-select"&&(n.options.treeSelect.rowKey=o.option.table?.rowKey,n.options.treeSelect.nodeKey=o.option.table?.rowKey)};o.option.column.forEach(t),o.option.table?.column?.forEach(t)},initColumnForm:()=>{const a=o.option;l.update.formColumn=[],l.table.column.show={list:[],listSource:[]};const t=[],n=o.option.form?.maxSpan||12,d=o.option.form?.defaultSpan||n/2;let m=[];const h=c=>{if(c.children){l.table.column.show.list.push(c.key),c.children.forEach(k=>{h(k)});return}if(l.update.formDefault[c.key]=c.value,c.table.table&&(c.show.table&&l.table.column.show.list.push(c.key),c.table.table&&l.table.column.show.listSource.push(c.key)),c.isForm){c.form=c.form||{span:d},c.form.span=c.form.span??d;let k=c.form.span,w=m.reduce((E,S)=>E+S.span,k);const V=m.length;if(m.push({item:c,span:k}),(V===1&&m[0].span===0||w>=n||k===0&&V>1)&&(t.push(m),m=[]),c.rules){const E={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(E[c.type]||E.input)+c.label;l.update.rules[c.key]=typeof c.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:c.rules}}},f=(c,k)=>{c.isForm=k,Array.isArray(c.children)&&c.children.forEach(w=>f(w,k))};a.column.forEach(c=>{c.isForm=!0,f(c,!0),h(c)}),o.option.table?.column?.forEach(c=>{f(c,!1),h(c)}),l.search.column.list=a.column.concat(a.table?.column||[]),l.table.column.list=l.search.column.list.filter(c=>c.table?.table),l.search.column.list.sort((c,k)=>c.sort?.search-k.sort?.search),l.table.column.list.sort((c,k)=>c.sort?.table-k.sort?.table),m.length>0&&t.push(m),l.update.formColumn=t;const r=o.option.search?.formDefault;r&&Object.keys(r).forEach(c=>{l.search.formDefault[c]=r[c]}),a.column.forEach(c=>{c.show?.search||(l.search.formDefault[c.key]=void 0)}),l.search.form=JSONUtil.cp(l.search.formDefault)}});return l.init(),e.onMounted(()=>{o.option.init!==!1&&l.table.getList()}),{conf:l,switchConfirmRef:i,ruleFormRef:s}},A={class:"dialog-footer"},R=e.defineComponent({__name:"switchConfirm",setup(o,{expose:i}){const s=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let t=null,n=null;const d=f=>(f?.title&&(l.value=f.title),f?.content&&(a.value=f.content),s.value=!0,new Promise((r,c)=>{t=r,n=c})),m=()=>{s.value=!1,t?.(!0),t=null,n=null},h=()=>{s.value=!1,n?.(new Error("用户取消操作")),t=null,n=null};return i({open:d}),(f,r)=>(e.openBlock(),e.createBlock(e.unref(p.ElDialog),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=c=>s.value=c),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createElementVNode("span",A,[e.createVNode(e.unref(p.ElButton),{onClick:h},{default:e.withCtx(()=>[...r[1]||(r[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:m},{default:e.withCtx(()=>[...r[2]||(r[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"]))}}),U=(o,i)=>{const s=o.__vccOpts||o;for(const[l,a]of i)s[l]=a;return s},K={},H={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function J(o,i){return e.openBlock(),e.createElementBlock("svg",H,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const W=U(K,[["render",J]]),q={},G={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(o,i){return e.openBlock(),e.createElementBlock("svg",G,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const Q=U(q,[["render",X]]),Y={class:"row flex-center table-header-label"},Z={class:"table-header-tooltip"},P=["onClick"],_=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(o){const i=g.isFun,s=e.getCurrentInstance().type;return(l,a)=>{const t=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.key},[o.conf.table.column.show.list.includes(n.key)?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:0,prop:n.key,label:n.label},{ref_for:!0},n.table),{header:e.withCtx(()=>[e.renderSlot(l.$slots,"table-header-"+n.key,{item:n},()=>[e.createElementVNode("div",Y,[n.table?.tooltip?(e.openBlock(),e.createBlock(t,{key:0,effect:"dark",content:n.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",Z,[e.createVNode(Q)])]),_:1},8,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)])])]),default:e.withCtx(({row:d})=>[n.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),{conf:o.conf,columnList:n.children,option:o.option},e.createSlots({_:2},[e.renderList(l.$slots,(m,h)=>({name:h,fn:e.withCtx(f=>[e.renderSlot(l.$slots,h,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(n.show?.form,o.conf.inlineEdit.form,e.unref(g).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.inlineEdit.row===d&&(n.type==="input"||n.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.conf.inlineEdit.form[n.key],"onUpdate:modelValue":m=>o.conf.inlineEdit.form[n.key]=m},{ref_for:!0},n.options?.input,{size:"small",style:{width:"100%"},onKeyup:e.withKeys(o.conf.inlineEdit.submit,["enter"])}),null,16,["modelValue","onUpdate:modelValue","onKeyup"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:o.conf.inlineEdit.form[n.key],"onUpdate:modelValue":m=>o.conf.inlineEdit.form[n.key]=m},{ref_for:!0},n.options?.select,{size:"small",style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options?.select?.data,m=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):e.renderSlot(l.$slots,"table-"+n.key,{key:1,row:d,item:n},()=>[n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:0,modelValue:d[n.key],"onUpdate:modelValue":m=>d[n.key]=m,"before-change":()=>n.options?.switch?.tableBeforeChange?.(n.key,d)},{ref_for:!0},n.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({"--table-text-click-color":n.table?.click?.color}),class:e.normalizeClass({"table-text-click":n.table?.click?.callback}),onClick:m=>n.table?.click?.callback?.(d)},e.toDisplayString(n.table?.format?n.table?.format(d):d[n.key]),15,P))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),$=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(o){return(i,s)=>{const l=e.resolveComponent("el-radio"),a=e.resolveComponent("el-radio-group");return o.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[0]||(s[0]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.input,e.toHandlers(o.item.item.options?.input?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSwitch),e.mergeProps({key:1,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[1]||(s[1]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.switch,{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[2]||(s[2]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.select,e.toHandlers(o.item.item.options?.select?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.item.item.options?.select?.data,t=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):o.item.item.type==="radio"?(e.openBlock(),e.createBlock(a,e.mergeProps({key:3,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[3]||(s[3]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.radio,e.toHandlers(o.item.item.options?.radio?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.item.item.options?.radio?.data,t=>(e.openBlock(),e.createBlock(l,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):o.item.item.type==="list"?(e.openBlock(),e.createBlock(N,e.mergeProps({key:4,row:o.conf.update.form,field:o.item.item.key},o.item.item.options?.list,e.toHandlers(o.item.item.options?.list?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):o.item.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(p.ElTreeSelect),e.mergeProps({key:5,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[4]||(s[4]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.treeSelect,e.toHandlers(o.item.item.options?.treeSelect?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):o.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:6,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[5]||(s[5]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.datetime,e.toHandlers(o.item.item.options?.datetime?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):o.item.item.type&&e.unref(C).customComponent[o.item.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C).customComponent[o.item.item.type]),e.mergeProps({key:7,modelValue:o.conf.update.form[o.item.item.key],"onUpdate:modelValue":s[6]||(s[6]=t=>o.conf.update.form[o.item.item.key]=t)},o.item.item.options?.[o.item.item.type],e.toHandlers(o.item.item.options?.[o.item.item.type]?.on||{}),{disabled:o.conf.update.getDisabled(o.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}}),v={class:"col relative cc1-form-box"},ee={class:"absolute row fit",style:{overflow:"hidden"}},te={class:"col column fit-width no-wrap"},oe={key:0,class:"relative curd-search fit-width"},le={class:"mb-10 flex justify-between items-center fit-width"},ne={class:"flex items-center",style:{gap:"10px"}},ae={key:0},re={key:1},ie={key:2},se={class:"export-btn"},ce={class:"flex items-center",style:{gap:"10px"}},de={class:"col fit-width relative form-box"},fe={class:"absolute column fit form-box-content"},me={class:"row justify-end mt-10 mb-10"},pe={class:"row form-item-content",style:{width:"100%"}},he={class:"col"},ke={class:"row form-item-content",style:{width:"100%"}},ye={class:"col"},ge={class:"dialog-footer"},be={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(o,{expose:i}){const s=g.EDialog,l=o,a=g.isFun,{conf:t,switchConfirmRef:n,ruleFormRef:d}=z(l);return i({conf:t}),(m,h)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",ee,[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",te,[o.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",oe,[e.createVNode(e.unref(p.ElForm),{model:e.unref(t).search.form,inline:""},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(t).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).search.column.list,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.key},[(typeof r.show?.search=="function"?r.show?.search(e.unref(t).search.form):r.show?.search)?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0,label:typeof r.text?.search?.label=="string"?r.text?.search?.label:r.label,class:e.normalizeClass({"hide-label":typeof r.text?.search?.label=="boolean"?!r.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+r.key,{row:e.unref(t).search.form},()=>[r.type==="input"?(e.openBlock(),e.createBlock(e.unref(p.ElInput),e.mergeProps({key:0,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c,placeholder:e.unref(t).search.getPlaceholder(r),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.input,e.toHandlers(r.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="switch"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:1,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c,placeholder:e.unref(t).search.getPlaceholder(r,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.switch,e.toHandlers(r.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.options?.switch?.activeValue,label:r.options?.switch?.activeLabel,value:r.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:r.options?.switch?.inactiveValue,label:r.options?.switch?.inactiveLabel,value:r.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="select"?(e.openBlock(),e.createBlock(e.unref(p.ElSelect),e.mergeProps({key:2,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c,placeholder:e.unref(t).search.getPlaceholder(r,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search},{ref_for:!0},r.options?.select,e.toHandlers(r.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options?.select?.data,c=>(e.openBlock(),e.createBlock(e.unref(p.ElOption),{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(p.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c},{ref_for:!0},r.options?.datetime,e.toHandlers(r.options?.datetime?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.type&&e.unref(C).customComponent[r.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(C).customComponent[r.type]),e.mergeProps({key:4,modelValue:e.unref(t).search.form[r.key],"onUpdate:modelValue":c=>e.unref(t).search.form[r.key]=c},{ref_for:!0},r.options?.[r.type],e.toHandlers(r.options?.[r.type]?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+r.key+"-right",{row:e.unref(t).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(t).search.form}),o.option.tools?.search||o.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:0},{default:e.withCtx(()=>[o.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(t).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),o.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,onClick:e.unref(t).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(t).search.form})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createElementVNode("div",ne,[e.unref(a)(o.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:h[0]||(h[0]=r=>e.unref(t).update.open(e.unref(s).Insert))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.table?.selectable&&e.unref(a)(o.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:h[1]||(h[1]=r=>e.unref(t).remove.open(e.unref(t).table.selection.list))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(p.ElButton),{type:"warning",onClick:h[2]||(h[2]=r=>e.unref(t).table.expand.all())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1})])):e.createCommentVNode("",!0),o.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(p.ElDropdown),{key:3,onCommand:e.unref(t).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(p.ElDropdownMenu),null,{default:e.withCtx(()=>[o.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(p.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(p.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createVNode(e.unref(p.ElButton),{type:"warning",loading:e.unref(t).export.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",ce,[e.renderSlot(m.$slots,"tools-right"),o.option.tools?.refresh===void 0||o.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:0,class:"refresh-btn",onClick:h[3]||(h[3]=(...r)=>e.unref(t).table.getList&&e.unref(t).table.getList(...r))},[e.createVNode(W)])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",de,[e.createElementVNode("div",fe,[e.withDirectives((e.openBlock(),e.createBlock(e.unref(p.ElTable),e.mergeProps({data:e.unref(t).table.data,border:o.option.table?.border===void 0?!0:o.option.table?.border},o.option.table,{onSelectionChange:e.unref(t).table.selection.change,"expand-row-keys":e.unref(t).table.expand.rowKeys,onExpandChange:e.unref(t).table.expand.change}),{default:e.withCtx(()=>[o.option.table?.selectable||e.unref(a)(o.option.tools?.delete)||o.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),{key:0,type:"selection",selectable:typeof o.option.table?.selectable=="function"?o.option.table?.selectable:void 0,width:"55"},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(_,{conf:e.unref(t),columnList:e.unref(t).table.column.list,option:o.option},e.createSlots({_:2},[e.renderList(m.$slots,(r,c)=>({name:c,fn:e.withCtx(k=>[e.renderSlot(m.$slots,c,e.normalizeProps(e.guardReactiveProps(k||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(o.option.table?.add)||e.unref(a)(o.option.table?.update)||e.unref(a)(o.option.table?.delete)||e.unref(a)(o.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(p.ElTableColumn),e.mergeProps({key:1,width:e.unref(t).table.op.width(e.unref(a)(o.option.table?.add),e.unref(a)(o.option.table?.update),e.unref(a)(o.option.table?.delete),e.unref(a)(o.option.table?.view),m.$slots["table-op-left"],m.$slots["table-op-right"]),align:"center",fixed:"right"},o.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:r})=>[e.renderSlot(m.$slots,"table-op-left",{row:r}),o.option.table?.inlineEdit&&e.unref(t).inlineEdit.row===r?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(p.ElButton),{link:"",type:"info",onClick:e.unref(t).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{link:"",type:"primary",onClick:e.unref(t).inlineEdit.submit,loading:e.unref(t).inlineEdit.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:r})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(o.option.table?.add,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,link:"",type:"primary",onClick:c=>e.unref(t).update.open(e.unref(s).Insert,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.view,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:1,link:"",type:"primary",onClick:c=>e.unref(t).update.open(e.unref(s).View,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.update,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:2,link:"",type:"warning",onClick:c=>e.unref(t).update.open(e.unref(s).Update,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(o.option.table?.delete,r)?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:3,link:"",type:"danger",onClick:c=>e.unref(t).remove.open([r])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:r})],64))]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","expand-row-keys","onExpandChange"])),[[f,e.unref(t).table.loading]])])]),e.createElementVNode("div",me,[o.option.page?.show===void 0||o.option.page?.show?(e.openBlock(),e.createBlock(e.unref(p.ElPagination),{key:0,"current-page":e.unref(t).page.num,"onUpdate:currentPage":h[4]||(h[4]=r=>e.unref(t).page.num=r),"page-size":e.unref(t).page.size,"onUpdate:pageSize":h[5]||(h[5]=r=>e.unref(t).page.size=r),background:"","page-sizes":e.unref(t).page.sizeList,"pager-count":7,layout:e.unref(t).page.layout,total:e.unref(t).page.total,onSizeChange:e.unref(t).table.getList,onCurrentChange:e.unref(t).table.getList},null,8,["current-page","page-size","page-sizes","layout","total","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])]),e.renderSlot(m.$slots,"box-right")]),e.createVNode(e.unref(p.ElDialog),e.mergeProps({modelValue:e.unref(t).update.show,"onUpdate:modelValue":h[6]||(h[6]=r=>e.unref(t).update.show=r),title:e.unref(t).update.title,"before-close":e.unref(t).update.close},o.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",ge,[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(t).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(t).update.type!==e.unref(s).View?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,type:"primary",onClick:e.unref(t).update.submit,loading:e.unref(t).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(p.ElForm),{ref_key:"ruleFormRef",ref:d,model:e.unref(t).update.form,rules:e.unref(t).update.rules},{default:e.withCtx(()=>[e.unref(t).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t).update.formColumn,r=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(()=>{const c=[],k=w=>{if(w.children)return k(w.children);c.push(...w.map(V=>V.item.show?.form))};return k(r),c},e.unref(t).update.form,e.unref(t).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:o.option.form?.stripe===void 0?!0:o.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(t).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(c.item.show?.form,e.unref(t).update.form)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(c.item.form.span>0?`col-${c.item.form.span}`:"col")},[c.item.children?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.children,k=>(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{class:e.normalizeClass({"hide-label":typeof k.item.text?.form?.label=="boolean"?!k.item.text?.form?.label:!1}),label:typeof k.item.text?.form?.label=="string"?k.item.text?.form?.label:k.item.label,prop:k.item.key,"label-width":k.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.renderSlot(m.$slots,"form-"+k.item.key+"-start",{row:e.unref(t).update.form,item:k.item}),e.createElementVNode("div",he,[e.renderSlot(m.$slots,"form-"+k.item.key,{row:e.unref(t).update.form,item:k.item},()=>[e.createVNode($,{conf:e.unref(t),item:c},null,8,["conf","item"])]),e.renderSlot(m.$slots,"form-"+k.item.key+"-right",{row:e.unref(t).update.form,item:k.item})]),e.renderSlot(m.$slots,"form-"+k.item.key+"-end",{row:e.unref(t).update.form,item:k.item})])]),_:2},1032,["class","label","prop","label-width"]))),256)):(e.openBlock(),e.createBlock(e.unref(p.ElFormItem),{key:1,class:e.normalizeClass({"hide-label":typeof c.item.text?.form?.label=="boolean"?!c.item.text?.form?.label:!1}),label:typeof c.item.text?.form?.label=="string"?c.item.text?.form?.label:c.item.label,prop:c.item.key,"label-width":c.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.renderSlot(m.$slots,"form-"+c.item.key+"-start",{row:e.unref(t).update.form,item:c.item}),e.createElementVNode("div",ye,[e.renderSlot(m.$slots,"form-"+c.item.key,{row:e.unref(t).update.form,item:c.item},()=>[e.createVNode($,{conf:e.unref(t),item:c},null,8,["conf","item"])]),e.renderSlot(m.$slots,"form-"+c.item.key+"-right",{row:e.unref(t).update.form,item:c.item})]),e.renderSlot(m.$slots,"form-"+c.item.key+"-end",{row:e.unref(t).update.form,item:c.item})])]),_:2},1032,["class","label","prop","label-width"]))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(t).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(p.ElDialog),{modelValue:e.unref(t).remove.show,"onUpdate:modelValue":h[7]||(h[7]=r=>e.unref(t).remove.show=r),title:e.unref(t).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",be,[e.createVNode(e.unref(p.ElButton),{onClick:e.unref(t).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(p.ElButton),{type:"danger",onClick:e.unref(t).remove.submit,loading:e.unref(t).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(t).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(R,{ref_key:"switchConfirmRef",ref:n},null,512)])}}});class ue{static async download(i,s="download.png"){const l=document.createElement("a");l.style.display="none",l.href=i,l.setAttribute("download",s),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(i)}static exportJSONFile=(i,s)=>{const l=new Blob([JSON.stringify(i)],{type:"application/json"}),a=URL.createObjectURL(l),t=document.createElement("a");t.href=a,t.download=`${s||"config"}.json`,t.click()};static importFile=async i=>new Promise((s,l)=>{const a=document.createElement("input");a.type="file";const t=i?.accept||".json";a.accept=t,a.style.display="none",a.onchange=n=>{const d=n.target.files[0];if(!d){g.fail("未选择文件"),l("未选择文件");return}const m=new FileReader;m.onload=async h=>{const f=t==".json"?JSON.parse(h.target.result):h.target.result;s(f)},m.onerror=()=>{g.fail("文件读取失败"),l("文件读取失败")},m.readAsText(d),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const T=(o,i)=>{if(o.component("TCurd",O),o.component("TFormList",N),o.component("TColumn",D),i?.customComponent){C.customComponent=i.customComponent;for(const s in i.customComponent)o.component(s,i.customComponent[s])}},we={install:T};u.ArrUtil=B,u.ExcelUtil=F,u.TColumn=D,u.TCurd=O,u.TFile=ue,u.TForm=C,u.TFormConfig=b,u.TFormI18n=y,u.TFormList=N,u.TSys=g,u.default=we,u.install=T,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import TForm from '../../../../utils/TForm';
|
|
2
|
+
import TSys from '../../../../utils/TSys';
|
|
2
3
|
import FormList from './list.vue';
|
|
3
4
|
import { type FormInstance, ElDatePicker, ElForm, ElFormItem, ElInput, ElOption, ElSelect, ElSwitch, ElTreeSelect } from 'element-plus';
|
|
4
5
|
import type { CurdConfigColumn } from '../../indexType';
|
|
5
|
-
declare const isFun: (fun: any,
|
|
6
|
+
declare const isFun: (fun: any, ...args: any[]) => any;
|
|
6
7
|
declare const ruleFormRef: import("vue").Ref<FormInstance | undefined, FormInstance | undefined>;
|
|
7
8
|
declare const conf: {
|
|
8
9
|
rules: any;
|
|
@@ -69,6 +70,21 @@ declare const conf: {
|
|
|
69
70
|
inputWidth?: string | undefined;
|
|
70
71
|
inputClass?: string | undefined;
|
|
71
72
|
} | undefined;
|
|
73
|
+
radio?: {
|
|
74
|
+
[x: string]: any;
|
|
75
|
+
on?: any;
|
|
76
|
+
data?: {
|
|
77
|
+
[x: string]: any;
|
|
78
|
+
label: string;
|
|
79
|
+
value: string;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
82
|
+
dataApiConfig?: {
|
|
83
|
+
once: boolean;
|
|
84
|
+
init: boolean;
|
|
85
|
+
update: boolean;
|
|
86
|
+
} | undefined;
|
|
87
|
+
} | undefined;
|
|
72
88
|
} | undefined;
|
|
73
89
|
form?: {
|
|
74
90
|
labelWidth?: string | undefined;
|
|
@@ -81,7 +97,7 @@ declare const conf: {
|
|
|
81
97
|
minWidth?: string | undefined;
|
|
82
98
|
width?: string | undefined;
|
|
83
99
|
fixed?: "left" | "right" | undefined;
|
|
84
|
-
align?: "
|
|
100
|
+
align?: "center" | "left" | "right" | undefined;
|
|
85
101
|
showOverflowTooltip?: boolean | undefined;
|
|
86
102
|
format?: ((data: any) => any) | undefined;
|
|
87
103
|
click?: {
|
|
@@ -103,7 +119,8 @@ declare const conf: {
|
|
|
103
119
|
show?: {
|
|
104
120
|
table?: boolean | undefined;
|
|
105
121
|
search?: boolean | ((data: any) => boolean) | undefined;
|
|
106
|
-
form?: boolean | ((data: any
|
|
122
|
+
form?: boolean | ((data: any, type: typeof TSys.EDialog.Insert | typeof TSys.EDialog.Update | typeof
|
|
123
|
+
/** @type {typeof __VLS_ctx.ruleFormRef} */ TSys.EDialog.View) => boolean) | undefined;
|
|
107
124
|
} | undefined;
|
|
108
125
|
sort?: {
|
|
109
126
|
search?: number | undefined;
|
|
@@ -181,6 +198,21 @@ declare var __VLS_7: {
|
|
|
181
198
|
inputWidth?: string | undefined;
|
|
182
199
|
inputClass?: string | undefined;
|
|
183
200
|
} | undefined;
|
|
201
|
+
radio?: {
|
|
202
|
+
[x: string]: any;
|
|
203
|
+
on?: any;
|
|
204
|
+
data?: {
|
|
205
|
+
[x: string]: any;
|
|
206
|
+
label: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}[] | undefined;
|
|
209
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
210
|
+
dataApiConfig?: {
|
|
211
|
+
once: boolean;
|
|
212
|
+
init: boolean;
|
|
213
|
+
update: boolean;
|
|
214
|
+
} | undefined;
|
|
215
|
+
} | undefined;
|
|
184
216
|
} | undefined;
|
|
185
217
|
form?: {
|
|
186
218
|
labelWidth?: string | undefined;
|
|
@@ -193,7 +225,7 @@ declare var __VLS_7: {
|
|
|
193
225
|
minWidth?: string | undefined;
|
|
194
226
|
width?: string | undefined;
|
|
195
227
|
fixed?: "left" | "right" | undefined;
|
|
196
|
-
align?: "
|
|
228
|
+
align?: "center" | "left" | "right" | undefined;
|
|
197
229
|
showOverflowTooltip?: boolean | undefined;
|
|
198
230
|
format?: ((data: any) => any) | undefined;
|
|
199
231
|
click?: {
|
|
@@ -215,7 +247,8 @@ declare var __VLS_7: {
|
|
|
215
247
|
show?: {
|
|
216
248
|
table?: boolean | undefined;
|
|
217
249
|
search?: boolean | ((data: any) => boolean) | undefined;
|
|
218
|
-
form?: boolean | ((data: any
|
|
250
|
+
form?: boolean | ((data: any, type: typeof TSys.EDialog.Insert | typeof TSys.EDialog.Update | typeof
|
|
251
|
+
/** @type {typeof __VLS_ctx.ruleFormRef} */ TSys.EDialog.View) => boolean) | undefined;
|
|
219
252
|
} | undefined;
|
|
220
253
|
sort?: {
|
|
221
254
|
search?: number | undefined;
|
|
@@ -284,6 +317,21 @@ declare var __VLS_7: {
|
|
|
284
317
|
inputWidth?: string | undefined;
|
|
285
318
|
inputClass?: string | undefined;
|
|
286
319
|
} | undefined;
|
|
320
|
+
radio?: {
|
|
321
|
+
[x: string]: any;
|
|
322
|
+
on?: any;
|
|
323
|
+
data?: {
|
|
324
|
+
[x: string]: any;
|
|
325
|
+
label: string;
|
|
326
|
+
value: string;
|
|
327
|
+
}[] | undefined;
|
|
328
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
329
|
+
dataApiConfig?: {
|
|
330
|
+
once: boolean;
|
|
331
|
+
init: boolean;
|
|
332
|
+
update: boolean;
|
|
333
|
+
} | undefined;
|
|
334
|
+
} | undefined;
|
|
287
335
|
} | undefined;
|
|
288
336
|
form?: {
|
|
289
337
|
labelWidth?: string | undefined;
|
|
@@ -296,7 +344,7 @@ declare var __VLS_7: {
|
|
|
296
344
|
minWidth?: string | undefined;
|
|
297
345
|
width?: string | undefined;
|
|
298
346
|
fixed?: "left" | "right" | undefined;
|
|
299
|
-
align?: "
|
|
347
|
+
align?: "center" | "left" | "right" | undefined;
|
|
300
348
|
showOverflowTooltip?: boolean | undefined;
|
|
301
349
|
format?: ((data: any) => any) | undefined;
|
|
302
350
|
click?: {
|
|
@@ -318,7 +366,8 @@ declare var __VLS_7: {
|
|
|
318
366
|
show?: {
|
|
319
367
|
table?: boolean | undefined;
|
|
320
368
|
search?: boolean | ((data: any) => boolean) | undefined;
|
|
321
|
-
form?: boolean | ((data: any
|
|
369
|
+
form?: boolean | ((data: any, type: typeof TSys.EDialog.Insert | typeof TSys.EDialog.Update | typeof
|
|
370
|
+
/** @type {typeof __VLS_ctx.ruleFormRef} */ TSys.EDialog.View) => boolean) | undefined;
|
|
322
371
|
} | undefined;
|
|
323
372
|
sort?: {
|
|
324
373
|
search?: number | undefined;
|
|
@@ -387,6 +436,21 @@ declare var __VLS_7: {
|
|
|
387
436
|
inputWidth?: string | undefined;
|
|
388
437
|
inputClass?: string | undefined;
|
|
389
438
|
} | undefined;
|
|
439
|
+
radio?: {
|
|
440
|
+
[x: string]: any;
|
|
441
|
+
on?: any;
|
|
442
|
+
data?: {
|
|
443
|
+
[x: string]: any;
|
|
444
|
+
label: string;
|
|
445
|
+
value: string;
|
|
446
|
+
}[] | undefined;
|
|
447
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
448
|
+
dataApiConfig?: {
|
|
449
|
+
once: boolean;
|
|
450
|
+
init: boolean;
|
|
451
|
+
update: boolean;
|
|
452
|
+
} | undefined;
|
|
453
|
+
} | undefined;
|
|
390
454
|
} | undefined;
|
|
391
455
|
form?: {
|
|
392
456
|
labelWidth?: string | undefined;
|
|
@@ -399,7 +463,7 @@ declare var __VLS_7: {
|
|
|
399
463
|
minWidth?: string | undefined;
|
|
400
464
|
width?: string | undefined;
|
|
401
465
|
fixed?: "left" | "right" | undefined;
|
|
402
|
-
align?: "
|
|
466
|
+
align?: "center" | "left" | "right" | undefined;
|
|
403
467
|
showOverflowTooltip?: boolean | undefined;
|
|
404
468
|
format?: ((data: any) => any) | undefined;
|
|
405
469
|
click?: {
|
|
@@ -421,7 +485,8 @@ declare var __VLS_7: {
|
|
|
421
485
|
show?: {
|
|
422
486
|
table?: boolean | undefined;
|
|
423
487
|
search?: boolean | ((data: any) => boolean) | undefined;
|
|
424
|
-
form?: boolean | ((data: any
|
|
488
|
+
form?: boolean | ((data: any, type: typeof TSys.EDialog.Insert | typeof TSys.EDialog.Update | typeof
|
|
489
|
+
/** @type {typeof __VLS_ctx.ruleFormRef} */ TSys.EDialog.View) => boolean) | undefined;
|
|
425
490
|
} | undefined;
|
|
426
491
|
sort?: {
|
|
427
492
|
search?: number | undefined;
|
|
@@ -599,6 +664,21 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
599
664
|
inputWidth?: string | undefined;
|
|
600
665
|
inputClass?: string | undefined;
|
|
601
666
|
} | undefined;
|
|
667
|
+
radio?: {
|
|
668
|
+
[x: string]: any;
|
|
669
|
+
on?: any;
|
|
670
|
+
data?: {
|
|
671
|
+
[x: string]: any;
|
|
672
|
+
label: string;
|
|
673
|
+
value: string;
|
|
674
|
+
}[] | undefined;
|
|
675
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
676
|
+
dataApiConfig?: {
|
|
677
|
+
once: boolean;
|
|
678
|
+
init: boolean;
|
|
679
|
+
update: boolean;
|
|
680
|
+
} | undefined;
|
|
681
|
+
} | undefined;
|
|
602
682
|
} | undefined;
|
|
603
683
|
form?: {
|
|
604
684
|
labelWidth?: string | undefined;
|
|
@@ -611,7 +691,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
611
691
|
minWidth?: string | undefined;
|
|
612
692
|
width?: string | undefined;
|
|
613
693
|
fixed?: "left" | "right" | undefined;
|
|
614
|
-
align?: "
|
|
694
|
+
align?: "center" | "left" | "right" | undefined;
|
|
615
695
|
showOverflowTooltip?: boolean | undefined;
|
|
616
696
|
format?: ((data: any) => any) | undefined;
|
|
617
697
|
click?: {
|
|
@@ -633,7 +713,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
633
713
|
show?: {
|
|
634
714
|
table?: boolean | undefined;
|
|
635
715
|
search?: boolean | ((data: any) => boolean) | undefined;
|
|
636
|
-
form?: boolean | ((data: any
|
|
716
|
+
form?: boolean | ((data: any, type: typeof TSys.EDialog.Insert | typeof TSys.EDialog.Update | typeof
|
|
717
|
+
/** @type {typeof __VLS_ctx.ruleFormRef} */ TSys.EDialog.View) => boolean) | undefined;
|
|
637
718
|
} | undefined;
|
|
638
719
|
sort?: {
|
|
639
720
|
search?: number | undefined;
|
|
@@ -81,9 +81,9 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
81
81
|
value: string;
|
|
82
82
|
row: any;
|
|
83
83
|
itemFields: any[];
|
|
84
|
-
field: string;
|
|
85
84
|
inputWidth: string;
|
|
86
85
|
inputClass: string;
|
|
86
|
+
field: string;
|
|
87
87
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
88
88
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
89
89
|
row: {
|
|
@@ -138,9 +138,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
138
138
|
value: string;
|
|
139
139
|
row: any;
|
|
140
140
|
itemFields: any[];
|
|
141
|
-
field: string;
|
|
142
141
|
inputWidth: string;
|
|
143
142
|
inputClass: string;
|
|
143
|
+
field: string;
|
|
144
144
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
145
145
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
146
146
|
export default _default;
|