cc1-form 1.1.28 → 1.1.30
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 +963 -997
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +325 -0
- package/dist/components/TCurd/formColumn.vue.d.ts +961 -1
- package/dist/components/TCurd/index.d.ts +198 -9
- package/dist/components/TCurd/index.vue.d.ts +459 -858
- package/dist/components/TCurd/indexType.d.ts +174 -169
- package/package.json +1 -1
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],m):(u=typeof globalThis<"u"?globalThis:u||self,m(u.cc1Form={},u.ElementPlus,u.VueRouter,u.Vue))})(this,(function(u,m,Se,e){"use strict";class y{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Insert:"Insert",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...d)=>Array.isArray(n)?n.some(o=>typeof o=="function"?o(...d):o):typeof n=="function"?n(...d):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},d=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(d).length?d:{}};static moduleObj={};static loadModule=async n=>{if(!y.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const d=await y.moduleObj[n]();return d.default??d};static tipMessages={};static tipMessagesGap=500;static showMessage(n,d,o={}){const r=Date.now();if(!this.tipMessages[n]||r-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=r;const t=Object.assign({message:n,type:d},o);m.ElMessage(t),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,d={})=>{this.showMessage(n,"error",d)};static success=(n,d={})=>{this.showMessage(n,"success",d)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,d="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=m.ElLoading.service({lock:!0,text:d,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,d=!0)=>{if(d){let o=screen.width/2-500,r=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+r+", left="+o)}else window.open(n,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=n=>new Promise(async(d,o)=>{let r=document.getElementById(n.id);const t=await y.loadModule("html2canvas");try{t(r,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(l){let c=l.toDataURL("image/png");d(c)})}catch(l){o(l)}})}class b{static config={page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"},dialog:{width:"980px",closeOnClickModal:!1},tools:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,fileName:"Export Data "}},form:{stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0}},columnConfig:{type:"input",form:{labelWidth:"100px",width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},options:{switch:{activeValue:!0,inactiveValue:!1},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=n=>{b.config=ObjectUtil.deepMerge(b.config,n)}}class B{static customComponent={};static findOptions=(n,d)=>{const o=n.column.find(t=>t.key===d),r=t=>t.replace(/-([a-z])/g,(l,c)=>c.toUpperCase());if(o)return o.options[r(o.type)]};static setOptionsData=(n,d,o)=>{const r=B.findOptions(n,d);r&&(r.data=o)};static form={openBefore:{parentId:(n,d,o,r)=>{const t=b.config.table.rowKey;n?d.type===y.EDialog.Insert?(d.form.parentId=n[t],d.form.sort=n.children.length+1):d.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(d.form.parentId="0",d.form.sort=o.length+1),B.setOptionsData(r,"parentId",[{[t]:"0",title:"根",children:o}])}}}}class E{static getIdFun=()=>StrUtil.uuid();static setId=(n,d,o)=>{d[n]||(d[n]=[]);const r=b.config.table.rowKey;d[n].forEach(t=>{o.forEach(l=>{let c=l.default??"";l.type==="number"&&(c=l.default??0),l.type==="boolean"&&(c=l.default??!1),l.type==="time"&&(c=l.default??new Date),t[l.value]===void 0&&(t[l.value]=c)}),t[r]||(t[r]=E.getIdFun())})};static add=(n,d,o,r)=>{const t=JSONUtil.cp(o);E.setId(n,d,o);const l=b.config.table.rowKey;d[n].push(t.reduce((c,p)=>{let h=p.default??"";return p.type==="number"&&(h=p.default??0),p.type==="boolean"&&(h=p.default??!1),p.type==="time"&&(h=p.default??new Date),c[p.value]=h,c},{[l]:E.getIdFun()})),r?.(d)};static remove=(n,d,o,r)=>{const t=b.config.table.rowKey;d[n]=d[n].filter(l=>l[t]!==o[t]),r?.(d)};static getNoIdData=(n,d)=>{const o=JSONUtil.cp(n),r=b.config.table.rowKey;return o.forEach(t=>{t[r]&&delete t[r],d&&t[d]&&E.getNoIdData(t[d],d)}),o}}const I={key:0,class:"column",style:{width:"100%",gap:"10px"}},L={class:"row items-center",style:{gap:"10px",width:"100%"}},D=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""}},emits:["change"],setup(i,{emit:n}){const d=i,o=e.reactive({show:!1,add:(t,l,c)=>{E.add(t,l,c,()=>{r("change")})},remove:(t,l,c)=>{E.remove(t,l,c,()=>{r("change")})}});e.onMounted(()=>{E.setId(d.field,d.row,d.itemFields),o.show=!0});const r=n;return(t,l)=>{const c=e.resolveComponent("el-button"),p=e.resolveComponent("el-input");return o.show?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"list-start",{row:i.row}),e.createElementVNode("div",null,[e.createVNode(c,{link:"",type:"primary",onClick:l[0]||(l[0]=h=>o.add(i.field,i.row,i.itemFields))},{default:e.withCtx(()=>l[2]||(l[2]=[e.createTextVNode("添加")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.row[i.field],h=>(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(t.$slots,"item-start",{item:h,row:i.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.itemFields,f=>(e.openBlock(),e.createBlock(p,{modelValue:h[f.value],"onUpdate:modelValue":a=>h[f.value]=a,style:e.normalizeStyle({width:i.inputWidth}),class:e.normalizeClass(i.inputClass),placeholder:f[i.label]||f[i.value],onChange:l[1]||(l[1]=a=>r("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(t.$slots,"item-end",{item:h,row:i.row}),e.createVNode(c,{link:"",type:"danger",onClick:f=>o.remove(i.field,i.row,h)},{default:e.withCtx(()=>l[3]||(l[3]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),e.renderSlot(t.$slots,"list-end",{row:i.row})])):e.createCommentVNode("",!0)}}}),M={class:"row curd-row"},F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(i,{expose:n}){const d=y.isFun,o=y.EDialog,r=e.ref(),t=i,l=e.reactive({rules:{},show:!0,form:{},formDefault:{},formColumn:[],getDisabled:c=>c.disabled?.[(t.type||o.Insert)===o.Insert?"create":"update"],initColumnForm:async()=>{const c=t.option;l.formColumn=[];const p=[],h=t.option.form?.maxSpan||12,f=t.option.form?.defaultSpan||h;let a=[];const s=g=>{if(l.formDefault[g.key]=g.value,g.isForm){g.form=g.form||{span:f},g.form.span=g.form.span??f;let w=g.form.span,C=a.reduce((S,Ee)=>S+Ee.span,w);const V=a.length;a.push({item:g,span:w}),(V===1&&a[0].span===0||C>=h||w===0&&V>1)&&(p.push(a),a=[]),g.rules&&(l.rules[g.key]=g.rules)}};c.column.forEach(g=>{g.isForm=!0,s(g)}),a.length>0&&p.push(a),l.formColumn=p,l.form=JSONUtil.cp(l.formDefault)},init:async()=>{l.show=!1,await e.nextTick(),l.initColumnForm()}});return l.initColumnForm(),n({ref:r,conf:l}),(c,p)=>(e.openBlock(),e.createBlock(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:r,model:l.form,rules:l.rules},{default:e.withCtx(()=>[l.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.formColumn,h=>(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(c.$slots,"form-start",{row:l.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(d)(f.item.show?.form,l.form)??!0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.item.form.span>0?`col-${f.item.form.span}`:"col")},[e.createVNode(e.unref(m.ElFormItem),{label:f.item.label,prop:f.item.key,"label-width":f.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"form-"+f.item.key+"-start",{row:l.form,item:f.item}),e.renderSlot(c.$slots,"form-"+f.item.key,{row:l.form,item:f.item},()=>[f.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.input,e.toHandlers(f.item.options?.input?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.switch,e.toHandlers(f.item.options?.switch?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.select,e.toHandlers(f.item.options?.select?.on||{}),{disabled:l.getDisabled(f.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.options?.select?.data,a=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:3,row:l.form,field:f.item.key,ref_for:!0},f.item.options?.list,e.toHandlers(f.item.options?.list?.on||{}),{disabled:l.getDisabled(f.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):f.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:4,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.treeSelect,e.toHandlers(f.item.options?.treeSelect?.on||{}),{disabled:l.getDisabled(f.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:5,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.datetime,e.toHandlers(f.item.options?.datetime?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):f.item.type&&e.unref(B).customComponent[f.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[f.item.type]),e.mergeProps({key:6,modelValue:l.form[f.item.key],"onUpdate:modelValue":a=>l.form[f.item.key]=a,ref_for:!0},f.item.options?.[f.item.type],e.toHandlers(f.item.options?.[f.item.type]?.on||{}),{disabled:l.getDisabled(f.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(c.$slots,"form-"+f.item.key+"-end",{row:l.form,item:f.item})]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(c.$slots,"form-end",{row:l.form})]))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});function Ne(i){return i}const j={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?"};class k{static t(n,...d){if(typeof n=="function")return n(...d);n=String(n);let o=0;return n.replace(/{([^}]+)}/g,(r,t)=>o<d.length?String(d[o++]):`{${t}}`)}static setI18n=n=>{k.curd=ObjectUtil.deepMerge(k.curd,n)};static tCurd(n,...d){return this.t(this.curd[n],...d)}static curd=j}class U{static exportToExcel=async(n,d,o)=>{if(!n||n.length===0)return;const r=await y.loadModule("xlsx"),t=n.map(p=>{const h={};return d.forEach(f=>{h[f.label]=p[f.key]}),h}),l=r.utils.json_to_sheet(t),c=r.utils.book_new();r.utils.book_append_sheet(c,l,"Sheet1"),o?typeof o=="function"&&(o=o()):o=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,r.writeFile(c,`${o}.xlsx`)}}const N=y.EDialog,z=i=>{const n=e.ref(),d=e.ref(),o=e.reactive({search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(r,t=k.tCurd("placeholderInput"))=>r.text?.search?.placeholder===void 0?`${t}${r.label}`:r.text?.search?.placeholder,getFormData:()=>{let r={};i.option.column.forEach(l=>{(typeof l.show?.search=="function"?l.show?.search(o.search.form):l.show?.search)&&(r[l.key]=o.search.form[l.key])});const t=i.option.search?.before?.(r);return t&&(r=t),r},reset:()=>{const r=o.search.formDefault;Object.keys(r).forEach(t=>{i.option.search?.resetMode==="none"?r[t]=void 0:r[t]=o.search.formDefault[t]}),o.search.form=JSONUtil.cp(r),o.page.num=1,i.option.init!==!1&&o.table.getList()},submit:()=>{o.page.num=1,o.table.getList()}},page:{size:i.option.page?.size||10,sizeList:i.option.page?.sizeList||[10,20,50,100],num:1,total:0,layout:i.option.page?.layout||"total, sizes, prev, pager, next, jumper"},table:{op:{width:(...r)=>r.filter(l=>l).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(r,t)=>{},all:()=>{if(o.table.expand.isExpand)o.table.expand.rowKeys=[];else{const r=t=>{let l=[];return t.forEach(c=>{l.push(c[i.option.table.rowKey]),c.children&&c.children.length>0&&(l=l.concat(r(c.children)))}),l};o.table.expand.rowKeys=r(o.table.data)}o.table.expand.isExpand=!o.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{o.table.loading=!0;const r=i.option.api.list;try{await o.initApiData("init");let t={};if(o.table.sort.prop){const{props:s,order:g}=b.config.table.sort;t={[s.field]:o.table.sort.prop,[g.field]:o.table.sort.order}}const l=await r({[b.config.page.size]:o.page.size,[b.config.page.num]:o.page.num,...o.search.getFormData(),...t}),c=b.config.result,p=l.data||{[c.list]:l};let h=(Array.isArray(p[c.list]),p[c.list]);const f=o.update.formColumn.flat(),a=JSONUtil.cp(h).map(s=>(Object.keys(s).forEach(w=>{const C=f.find(V=>V.item.key===w);C&&["select","radio"].includes(C.item.type)&&(C.item.table.format||(C.item.table.format=V=>C.item.options[C.item.type].data?.find(S=>S.value==V[w])?.label||V[w]))}),s));o.table.data=i.option.data?await i.option.data(a,h):a,o.page.total=p[c.total]||0}catch(t){console.error(t)}finally{o.table.loading=!1}},selection:{list:[],change:r=>{o.table.selection.list=r}},sort:{prop:"",order:"",change:r=>{b.config.table.sort.resetPage&&(o.page.num=1);const t=b.config.table.sort;if(t.change){t.change(r,o);return}o.table.sort.prop=r.prop,r.order===null?o.table.sort.order="":o.table.sort.order=r.order==="ascending"?t.order.asc:t.order.desc,o.table.getList()}}},export:{run:{start:async r=>{let t=await o.export.run[r](),l=i.option.column;const c=JSONUtil.cp({data:t,columns:l}),p=i.option.tools?.export||{};p.before&&p.before(c),U.exportToExcel(c.data,c.columns,p.fileName)},select:()=>{if(o.table.selection.list.length===0)throw y.fail(k.tCurd("selectDataToExport")),new Error(k.tCurd("selectDataToExport"));return o.table.selection.list},page:()=>{if(o.table.data.length===0)throw y.fail(k.tCurd("noData")),new Error(k.tCurd("noData"));return o.table.data},all:async()=>{o.export.loading=!0;try{if(i.option.tools?.export?.all){await i.option.tools?.export?.all({[b.config.page.size]:o.page.size,[b.config.page.num]:o.page.num,...o.search.getFormData()});return}const r=i.option.api.list,t=await r({[b.config.page.size]:999999,[b.config.page.num]:1});return(t.data||{[b.config.result.list]:t})[b.config.result.list]}catch(r){console.error(r)}finally{o.export.loading=!1}}},loading:!1,click:r=>{o.export.loading||o.export.run.start(r)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:N.Insert,form:{},formDefault:{},formColumn:[],getDisabled:r=>o.update.type===N.View?!0:r.disabled?.[o.update.type===N.Insert?"create":"update"],edit:{data:{},getApiData:r=>{if(i.option.form?.editAll)return r;let t={[i.option.table?.rowKey]:o.update.edit.data[i.option.table?.rowKey]};return Object.keys(o.update.edit.data).forEach(l=>{r[l]!==o.update.edit.data[l]&&(t[l]=r[l])}),t}},view:{},open:(r,t)=>{o.update.showContent||FunUtil.throttle(async()=>{y.loading(!0);try{await o.initApiData("update");const l=r===N.Insert;if(!l&&i.option.table?.inlineEdit){o.inlineEdit.open(t);return}o.update.type=r,o.update.edit.data=t,o.update.title=k.tCurd(l?"add":r===N.View?"view":"edit"),o.update.form=JSONUtil.cp(l?o.update.formDefault:t),await i.option.form?.openBefore?.(t,o.update),o.update.show=!0,o.update.showContent=!0,i.option.form?.openAfter?.(t,o.update)}catch(l){console.error(l)}finally{y.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await d.value?.validate(async(c,p)=>new Promise((h,f)=>{c||(y.fail(k.tCurd("checkFormData")),f(!1)),h()})),o.update.loading=!0;const r=o.update.type===N.Insert?i.option.api.create:i.option.api.update;let t=JSONUtil.cp(o.update.form);delete t.children,await i.option.form?.submitBefore?.(t,o.update);const l=new Set(i.option.column.filter(c=>c.type==="datetime").map(c=>c.key));Object.keys(t).forEach(c=>{if(l.has(c)&&t[c]!=null){const p=new Date(t[c]).getTime();isNaN(p)||(t[c]=p)}});try{if(!r)return;await r({...t}),o.update.close(),await o.table.getList(),i.option.form?.submitAfter?.(t,o.update)}catch(c){console.error(c)}finally{o.update.loading=!1}})},close:()=>{o.update.show=!1,setTimeout(()=>{o.update.showContent=!1},350)}},inlineEdit:{row:null,form:{},loading:!1,open:r=>{o.inlineEdit.row=r,o.inlineEdit.form=JSONUtil.cp(r)},close:()=>{o.inlineEdit.row=null,o.inlineEdit.form={}},submit:()=>{FunUtil.throttle(async()=>{o.inlineEdit.loading=!0;const r=i.option.api.update;let t=JSONUtil.cp(o.inlineEdit.form);delete t.children;try{if(!r)return;await r({...t}),o.inlineEdit.close(),await o.table.getList(),y.success(k.tCurd("operationSuccess"))}catch(l){console.error(l)}finally{o.inlineEdit.loading=!1}})}},remove:{title:k.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{o.remove.show=!1},open:r=>{if(r.length===0){y.fail(k.tCurd("selectDataToDelete"));return}o.remove.items=r,o.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{o.remove.loading=!0;const r=i.option.api.delete;try{if(!r)return;await r({[i.option.table?.rowKey]:o.remove.items.map(t=>t[i.option.table?.rowKey]),items:o.remove.items}),y.success(k.tCurd("operationSuccess")),o.table.data.length<=1&&o.page.num>1&&(o.page.num-=1),o.remove.close(),await o.table.getList()}catch(t){console.error(t)}finally{o.remove.loading=!1}})}},init:()=>{o.initCurdConfig(),o.initColumnOptions(),o.initColumnForm()},apiDataMap:{},initApiData:async r=>{const t=[],l=c=>{if(c.children&&c.children.length){c.children.forEach(p=>l(p));return}if(c.type==="select"&&c.options?.select?.dataApi&&c.options?.select?.dataApiConfig?.[r]){if(o.apiDataMap[c.key]&&c.options?.select?.dataApiConfig?.once)return;const p=(async()=>{try{let h=await c.options?.select?.dataApi?.();if(h){const f=c.options?.select?.dataPath;f&&(h=ObjectUtil.getPathValue(h,f)),c.options.select.data=h,o.apiDataMap[c.key]=h}}catch{}})();t.push(p)}};return i.option.column.forEach(c=>{l(c)}),await Promise.all(t),!0},initCurdConfig:()=>{const r=JSONUtil.cp(b.config);r.table.emptyText=k.tCurd("noData");const t=ObjectUtil.deepMerge(r,i.option||{});Object.keys(t).forEach(l=>{i.option[l]=t[l]})},initColumnOptions:()=>{let r=JSONUtil.cp(b.config.columnConfig);r.options=ObjectUtil.deepMerge(r.options,{switch:{activeLabel:k.tCurd("switchOn"),inactiveLabel:k.tCurd("switchOff")}});const t=l=>{if(l.table=ObjectUtil.deepMerge(r.table,l.table||{}),l.children){l.children.forEach(c=>{t(c)});return}l.options=ObjectUtil.deepMerge(r.options,l.options||{}),l.form=ObjectUtil.deepMerge(r.form,l.form||{}),l.show=ObjectUtil.deepMerge(r.show,l.show||{}),l.sort=ObjectUtil.deepMerge(r.sort,l.sort||{}),l.type=l.type||r.type,l.type==="switch"&&(l.options.switch.tableBeforeChange=async(c,p)=>{const h=l.options?.switch;try{await n.value?.open({title:k.tCurd("confirmModify"),content:k.tCurd("confirmSwitchMessage")}),o.table.loading=!0;try{return i.option.api.update?(await i.option.api.update({[i.option.table?.rowKey]:p[i.option.table?.rowKey],[c]:p[c]===h.activeValue?h.inactiveValue:h.activeValue,final(f,a,s){o.table.loading=!1}}),o.table.loading=!1,y.success(k.tCurd("operationSuccess")),o.table.getList(),!0):void 0}catch(f){return console.error(f),!1}finally{o.table.loading=!1}}catch{return!1}}),l.type==="tree-select"&&(l.options.treeSelect.rowKey=i.option.table?.rowKey,l.options.treeSelect.nodeKey=i.option.table?.rowKey)};i.option.column.forEach(t),i.option.table?.column?.forEach(t)},getColumnSpan:(r,t)=>{if(r.item.form?.spanCol){const l=b.config.form.defaultSpan,p=t.filter(h=>!y.isFun(h.item.show?.form,o.update.form,o.update.type)).reduce((h,f)=>h+(f.item.form?.span||l),0);return(r.item?.form.span||l)+p}return r.item.form.span},initColumnForm:()=>{const r=i.option;o.update.formColumn=[],o.table.column.show={list:[],listSource:[]};const t=[],l=i.option.form?.maxSpan||12,c=i.option.form?.defaultSpan||l/2;let p=[];const h=s=>{if(s.children){o.table.column.show.list.push(s.key),s.children.forEach(g=>{h(g)});return}if(o.update.formDefault[s.key]=s.value,s.table.table&&(s.show.table&&o.table.column.show.list.push(s.key),s.table.table&&o.table.column.show.listSource.push(s.key)),!(s.isForm&&typeof s.show?.form=="boolean")||s.show?.form){s.form=s.form||{span:c},s.form.span=s.form.span??c;let g=s.form.span,w=p.reduce((V,S)=>V+S.span,g);const C=p.length;if(p.push({item:s,span:g}),(C===1&&p[0].span===0||w>=l||g===0&&C>1)&&(t.push(p),p=[]),s.rules){const V={input:k.tCurd("placeholderInput"),select:k.tCurd("placeholderSelect")},S=(V[s.type]||V.input)+s.label;o.update.rules[s.key]=typeof s.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:s.rules}}},f=(s,g)=>{s.isForm=g,Array.isArray(s.children)&&s.children.forEach(w=>f(w,g))};r.column.forEach(s=>{s.isForm=!0,f(s,!0),h(s)}),i.option.table?.column?.forEach(s=>{f(s,!1),h(s)}),o.search.column.list=r.column.concat(r.table?.column||[]),o.table.column.list=o.search.column.list.filter(s=>s.table?.table),o.search.column.list.sort((s,g)=>s.sort?.search-g.sort?.search),o.table.column.list.sort((s,g)=>s.sort?.table-g.sort?.table),p.length>0&&t.push(p),o.update.formColumn=t;const a=i.option.search?.formDefault;a&&Object.keys(a).forEach(s=>{o.search.formDefault[s]=a[s]}),r.column.forEach(s=>{s.show?.search||(o.search.formDefault[s.key]=void 0)}),o.search.form=JSONUtil.cp(o.search.formDefault)}});return o.init(),e.onMounted(()=>{i.option.init!==!1&&o.table.getList()}),{conf:o,switchConfirmRef:n,ruleFormRef:d}},R={class:"dialog-footer"},A=e.defineComponent({__name:"switchConfirm",setup(i,{expose:n}){const d=e.ref(!1),o=e.ref("确认修改"),r=e.ref("确认要修改状态吗?");let t=null,l=null;const c=f=>(f?.title&&(o.value=f.title),f?.content&&(r.value=f.content),d.value=!0,new Promise((a,s)=>{t=a,l=s})),p=()=>{d.value=!1,t?.(!0),t=null,l=null},h=()=>{d.value=!1,l?.(new Error("用户取消操作")),t=null,l=null};return n({open:c}),(f,a)=>(e.openBlock(),e.createBlock(e.unref(m.ElDialog),{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=s=>d.value=s),title:o.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createElementVNode("span",R,[e.createVNode(e.unref(m.ElButton),{onClick:h},{default:e.withCtx(()=>a[1]||(a[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:p},{default:e.withCtx(()=>a[2]||(a[2]=[e.createTextVNode("确认")])),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(r.value),1)]),_:1},8,["modelValue","title"]))}}),$=(i,n)=>{const d=i.__vccOpts||i;for(const[o,r]of n)d[o]=r;return d},H={},K={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function J(i,n){return e.openBlock(),e.createElementBlock("svg",K,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)]))}const W=$(H,[["render",J]]),q={},G={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(i,n){return e.openBlock(),e.createElementBlock("svg",G,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)]))}const Q=$(q,[["render",X]]),Y={class:"row flex-center table-header-label inline"},Z={class:"table-header-tooltip"},P=["onClick"],_=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(i){const n=y.isFun,d=e.getCurrentInstance().type;return(o,r)=>{const t=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[o.conf.table.column.show.list.includes(l.key)?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:0,prop:l.key,label:l.label,ref_for:!0},l.table),{header:e.withCtx(()=>[e.renderSlot(o.$slots,"table-header-"+l.key,{item:l},()=>[e.createElementVNode("div",Y,[l.table?.tooltip?(e.openBlock(),e.createBlock(t,{key:0,effect:"dark",content:l.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",Z,[e.createVNode(Q)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)])])]),default:e.withCtx(({row:c})=>[l.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r[0]||(r[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(d)),{conf:o.conf,columnList:l.children,option:o.option},e.createSlots({_:2},[e.renderList(o.$slots,(p,h)=>({name:h,fn:e.withCtx(f=>[e.renderSlot(o.$slots,h,e.mergeProps({ref_for:!0},f||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(n)(l.show?.form,o.conf.inlineEdit.form,e.unref(y).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.inlineEdit.row===c&&(l.type==="input"||l.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:o.conf.inlineEdit.form[l.key],"onUpdate:modelValue":p=>o.conf.inlineEdit.form[l.key]=p,ref_for:!0},l.options?.input,{size:"small",style:{width:"100%"},onKeyup:e.withKeys(o.conf.inlineEdit.submit,["enter"])}),null,16,["modelValue","onUpdate:modelValue","onKeyup"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:o.conf.inlineEdit.form[l.key],"onUpdate:modelValue":p=>o.conf.inlineEdit.form[l.key]=p,ref_for:!0},l.options?.select,{size:"small",style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.select?.data,p=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):e.renderSlot(o.$slots,"table-"+l.key,{key:1,row:c,item:l},()=>[l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:0,modelValue:c[l.key],"onUpdate:modelValue":p=>c[l.key]=p,"before-change":()=>l.options?.switch?.tableBeforeChange?.(l.key,c),ref_for:!0},l.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({"--table-text-click-color":l.table?.click?.color}),class:e.normalizeClass({"table-text-click":l.table?.click?.callback}),onClick:p=>l.table?.click?.callback?.(c)},e.toDisplayString(l.table?.format?l.table?.format(c):c[l.key]),15,P))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),x=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(i){return(n,d)=>{const o=e.resolveComponent("el-radio"),r=e.resolveComponent("el-radio-group");return n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[0]||(d[0]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.input,e.toHandlers(n.item.item.options?.input?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[1]||(d[1]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.switch,{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[2]||(d[2]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.select,e.toHandlers(n.item.item.options?.select?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.item.item.options?.select?.data,t=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(r,e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[3]||(d[3]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.radio,e.toHandlers(n.item.item.options?.radio?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.item.item.options?.radio?.data,t=>(e.openBlock(),e.createBlock(o,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.item.item.options?.list,e.toHandlers(n.item.item.options?.list?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[4]||(d[4]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.treeSelect,e.toHandlers(n.item.item.options?.treeSelect?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[5]||(d[5]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.datetime,e.toHandlers(n.item.item.options?.datetime?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&e.unref(B).customComponent[n.item.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":d[6]||(d[6]=t=>n.conf.update.form[n.item.item.key]=t)},n.item.item.options?.[n.item.item.type],e.toHandlers(n.item.item.options?.[n.item.item.type]?.on||{}),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}}),v={class:"col relative cc1-form-box"},ee={class:"absolute row fit",style:{overflow:"hidden"}},te={class:"col column fit-width no-wrap"},oe={key:0,class:"relative curd-search fit-width"},le={class:"mb-10 flex justify-between items-center fit-width"},ne={class:"flex items-center",style:{gap:"10px"}},re={key:0},ae={key:1},ie={key:2},se={class:"export-btn"},de={class:"flex items-center",style:{gap:"10px"}},ce={class:"col fit-width relative form-box"},fe={class:"absolute column fit form-box-content"},pe={class:"row justify-end mt-10 mb-10"},me={class:"row form-item-content",style:{width:"100%"}},he={class:"col"},ge={key:0,class:"form-tip-text"},ke={class:"row form-item-content",style:{width:"100%"}},ye={class:"col"},be={class:"col"},ue={key:0,class:"form-tip-text"},we={class:"dialog-footer"},Ce={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(i,{expose:n}){const d=y.EDialog,o=i,r=y.isFun,{conf:t,switchConfirmRef:l,ruleFormRef:c}=z(o);return n({conf:t}),(p,h)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",ee,[e.renderSlot(p.$slots,"box-left"),e.createElementVNode("div",te,[i.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",oe,[e.createVNode(e.unref(m.ElForm),{model:e.unref(t).search.form,inline:""},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-start",{row:e.unref(t).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).search.column.list,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[(typeof a.show?.search=="function"?a.show?.search(e.unref(t).search.form):a.show?.search)?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0,label:typeof a.text?.search?.label=="string"?a.text?.search?.label:a.label,class:e.normalizeClass({"hide-label":typeof a.text?.search?.label=="boolean"?!a.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-"+a.key,{row:e.unref(t).search.form},()=>[a.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,placeholder:e.unref(t).search.getPlaceholder(a),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.input,e.toHandlers(a.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,placeholder:e.unref(t).search.getPlaceholder(a,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.switch,e.toHandlers(a.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.options?.switch?.activeValue,label:a.options?.switch?.activeLabel,value:a.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.options?.switch?.inactiveValue,label:a.options?.switch?.inactiveLabel,value:a.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,placeholder:e.unref(t).search.getPlaceholder(a,e.unref(k).tCurd("placeholderSelect")),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.select,e.toHandlers(a.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,ref_for:!0},a.options?.datetime,e.toHandlers(a.options?.datetime?.on||{}),{disabled:a.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):a.type&&e.unref(B).customComponent[a.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[a.type]),e.mergeProps({key:4,modelValue:e.unref(t).search.form[a.key],"onUpdate:modelValue":s=>e.unref(t).search.form[a.key]=s,ref_for:!0},a.options?.[a.type],e.toHandlers(a.options?.[a.type]?.on||{}),{disabled:a.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"search-"+a.key+"-right",{row:e.unref(t).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(p.$slots,"search-center",{row:e.unref(t).search.form}),i.option.tools?.search||i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0},{default:e.withCtx(()=>[i.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(t).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:e.unref(t).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-end",{row:e.unref(t).search.form})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createElementVNode("div",ne,[e.unref(r)(i.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:h[0]||(h[0]=a=>e.unref(t).update.open(e.unref(d).Insert))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.table?.selectable&&e.unref(r)(i.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:h[1]||(h[1]=a=>e.unref(t).remove.open(e.unref(t).table.selection.list))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(m.ElButton),{type:"warning",onClick:h[2]||(h[2]=a=>e.unref(t).table.expand.all())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("expandCollapse")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElDropdown),{key:3,onCommand:e.unref(t).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(m.ElDropdownMenu),null,{default:e.withCtx(()=>[i.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(m.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("exportAll")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(t).export.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("export")),1)]),_:1},8,["loading"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"tools-left")]),e.createElementVNode("div",de,[e.renderSlot(p.$slots,"tools-right"),i.option.tools?.refresh===void 0||i.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:0,class:"refresh-btn",onClick:h[3]||(h[3]=(...a)=>e.unref(t).table.getList&&e.unref(t).table.getList(...a))},[e.createVNode(W)])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",ce,[e.createElementVNode("div",fe,[e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElTable),e.mergeProps({data:e.unref(t).table.data,border:i.option.table?.border===void 0?!0:i.option.table?.border,onSelectionChange:e.unref(t).table.selection.change,onSortChange:e.unref(t).table.sort.change,"expand-row-keys":e.unref(t).table.expand.rowKeys,onExpandChange:e.unref(t).table.expand.change},i.option.table,e.toHandlers(i.option.table?.on||{})),{default:e.withCtx(()=>[i.option.table?.selectable||e.unref(r)(i.option.tools?.delete)||i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,type:"selection",selectable:typeof i.option.table?.selectable=="function"?i.option.table?.selectable:void 0,width:"40",align:"center","show-overflow-tooltip":!1},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(_,{conf:e.unref(t),columnList:e.unref(t).table.column.list,option:i.option},e.createSlots({_:2},[e.renderList(p.$slots,(a,s)=>({name:s,fn:e.withCtx(g=>[e.renderSlot(p.$slots,s,e.normalizeProps(e.guardReactiveProps(g||{})))])}))]),1032,["conf","columnList","option"]),e.unref(r)(i.option.table?.add)||e.unref(r)(i.option.table?.update)||e.unref(r)(i.option.table?.delete)||e.unref(r)(i.option.table?.view)||p.$slots["table-op-left"]||p.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:1,width:e.unref(t).table.op.width(e.unref(r)(i.option.table?.add),e.unref(r)(i.option.table?.update),e.unref(r)(i.option.table?.delete),e.unref(r)(i.option.table?.view),p.$slots["table-op-left"],p.$slots["table-op-right"]),align:"center",fixed:"right"},i.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(p.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("operation")),1)])]),default:e.withCtx(({row:a})=>[e.renderSlot(p.$slots,"table-op-left",{row:a}),i.option.table?.inlineEdit&&e.unref(t).inlineEdit.row===a?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(m.ElButton),{link:"",type:"info",onClick:e.unref(t).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{link:"",type:"primary",onClick:e.unref(t).inlineEdit.submit,loading:e.unref(t).inlineEdit.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(p.$slots,"table-op-edit-right",{row:a})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(r)(i.option.table?.add,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,link:"",type:"primary",onClick:s=>e.unref(t).update.open(e.unref(d).Insert,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.view,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,link:"",type:"primary",onClick:s=>e.unref(t).update.open(e.unref(d).View,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.update,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,link:"",type:"warning",onClick:s=>e.unref(t).update.open(e.unref(d).Update,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.delete,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:3,link:"",type:"danger",onClick:s=>e.unref(t).remove.open([a])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"table-op-right",{row:a})],64))]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[f,e.unref(t).table.loading]])])]),e.createElementVNode("div",pe,[i.option.page?.show===void 0||i.option.page?.show?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),{key:0,"current-page":e.unref(t).page.num,"onUpdate:currentPage":h[4]||(h[4]=a=>e.unref(t).page.num=a),"page-size":e.unref(t).page.size,"onUpdate:pageSize":h[5]||(h[5]=a=>e.unref(t).page.size=a),background:"","page-sizes":e.unref(t).page.sizeList,"pager-count":7,layout:e.unref(t).page.layout,total:e.unref(t).page.total,onSizeChange:e.unref(t).table.getList,onCurrentChange:e.unref(t).table.getList},null,8,["current-page","page-size","page-sizes","layout","total","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])]),e.renderSlot(p.$slots,"box-right")]),e.createVNode(e.unref(m.ElDialog),e.mergeProps({modelValue:e.unref(t).update.show,"onUpdate:modelValue":h[6]||(h[6]=a=>e.unref(t).update.show=a),title:e.unref(t).update.title,"before-close":e.unref(t).update.close},i.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",we,[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(t).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(t).update.type!==e.unref(d).View?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(t).update.submit,loading:e.unref(t).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:c,model:e.unref(t).update.form,rules:e.unref(t).update.rules},{default:e.withCtx(()=>[e.unref(t).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t).update.formColumn,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)((()=>{const s=[],g=w=>{w?.item?.children?g(w.item.children):s.push(...w.map(C=>C.item?.show?.form))};return g(a),s})(),e.unref(t).update.form,e.unref(t).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(p.$slots,"form-start",{row:e.unref(t).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,s=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)(s.item.show?.form,e.unref(t).update.form,e.unref(t).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.item.form.span>0?`col-${e.unref(t).getColumnSpan(s,a)}`:"col",`form-item-col-${s.item.key}`])},[s.item.children?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.children,g=>(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof g.item.text?.form?.label=="boolean"?!g.item.text?.form?.label:!1}),label:typeof g.item.text?.form?.label=="string"?g.item.text?.form?.label:g.item.label,prop:g.item.key,"label-width":g.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",me,[e.renderSlot(p.$slots,"form-"+g.item.key+"-start",{row:e.unref(t).update.form,item:g.item}),e.createElementVNode("div",he,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"form-"+g.item.key,{row:e.unref(t).update.form,item:g.item},()=>[e.createVNode(x,{conf:e.unref(t),item:s},null,8,["conf","item"])]),e.renderSlot(p.$slots,"form-"+g.item.key+"-right",{row:e.unref(t).update.form,item:g.item})]),g.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",ge,e.toDisplayString(g.item.form?.tipText),1)):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"form-"+g.item.key+"-end",{row:e.unref(t).update.form,item:g.item})])]),_:2},1032,["class","label","prop","label-width"]))),256)):(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:1,class:e.normalizeClass({"hide-label":typeof s.item.text?.form?.label=="boolean"?!s.item.text?.form?.label:!1}),label:typeof s.item.text?.form?.label=="string"?s.item.text?.form?.label:s.item.label,prop:s.item.key,"label-width":s.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.renderSlot(p.$slots,"form-"+s.item.key+"-start",{row:e.unref(t).update.form,item:s.item}),e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.renderSlot(p.$slots,"form-"+s.item.key,{row:e.unref(t).update.form,item:s.item},()=>[e.createVNode(x,{conf:e.unref(t),item:s},null,8,["conf","item"])]),e.renderSlot(p.$slots,"form-"+s.item.key+"-right",{row:e.unref(t).update.form,item:s.item})]),s.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString(s.item.form?.tipText),1)):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"form-"+s.item.key+"-end",{row:e.unref(t).update.form,item:s.item})])]),_:2},1032,["class","label","prop","label-width"]))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(p.$slots,"form-end",{row:e.unref(t).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(m.ElDialog),{modelValue:e.unref(t).remove.show,"onUpdate:modelValue":h[7]||(h[7]=a=>e.unref(t).remove.show=a),title:e.unref(t).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Ce,[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(t).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:e.unref(t).remove.submit,loading:e.unref(t).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(k).tCurd("confirmDeleteMessage",e.unref(t).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(A,{ref_key:"switchConfirmRef",ref:l},null,512)])}}});class Ve{static async download(n,d="download.png"){const o=document.createElement("a");o.style.display="none",o.href=n,o.setAttribute("download",d),typeof o.download>"u"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,d)=>{const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=URL.createObjectURL(o),t=document.createElement("a");t.href=r,t.download=`${d||"config"}.json`,t.click()};static importFile=async n=>new Promise((d,o)=>{const r=document.createElement("input");r.type="file";const t=n?.accept||".json";r.accept=t,r.style.display="none",r.onchange=l=>{const c=l.target.files[0];if(!c){y.fail("未选择文件"),o("未选择文件");return}const p=new FileReader;p.onload=async h=>{const f=t==".json"?JSON.parse(h.target.result):h.target.result;d(f)},p.onerror=()=>{y.fail("文件读取失败"),o("文件读取失败")},p.readAsText(c),document.body.removeChild(r)},document.body.appendChild(r),r.click()})}const T=(i,n)=>{if(i.component("TCurd",O),i.component("TFormList",D),i.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const d in n.customComponent)i.component(d,n.customComponent[d])}},Be={install:T};u.ArrUtil=E,u.ExcelUtil=U,u.TColumn=F,u.TCurd=O,u.TFile=Ve,u.TForm=B,u.TFormConfig=b,u.TFormI18n=k,u.TFormList=D,u.TSys=y,u.default=Be,u.install=T,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(b,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],m):(b=typeof globalThis<"u"?globalThis:b||self,m(b.cc1Form={},b.ElementPlus,b.VueRouter,b.Vue))})(this,(function(b,m,Ve,e){"use strict";class u{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Insert:"Insert",Update:"Update",View:"View",Remove:"Remove"};static isFun=(l,...s)=>Array.isArray(l)?l.some(t=>typeof t=="function"?t(...s):t):typeof l=="function"?l(...s):l;static getRouterParams=()=>{const l=this.router.currentRoute.value.query||{},s=this.router.currentRoute.value.params||{};return Object.keys(l).length?l:Object.keys(s).length?s:{}};static moduleObj={};static loadModule=async l=>{if(!u.moduleObj[l])throw new Error(`模块${l}未加载,请赋值如:TSys.moduleObj = { ${l}: ()=>import('${l}') }`);const s=await u.moduleObj[l]();return s.default??s};static tipMessages={};static tipMessagesGap=500;static showMessage(l,s,t={}){const r=Date.now();if(!this.tipMessages[l]||r-this.tipMessages[l]>this.tipMessagesGap){this.tipMessages[l]=r;const o=Object.assign({message:l,type:s},t);m.ElMessage(o),setTimeout(()=>{delete this.tipMessages[l]},this.tipMessagesGap)}}static fail=(l,s={})=>{this.showMessage(l,"error",s)};static success=(l,s={})=>{this.showMessage(l,"success",s)};static loadingObj=null;static loadingTimer=null;static loading=(l=!0,s="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{l?this.loadingObj=m.ElLoading.service({lock:!0,text:s,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(l,s=!0)=>{if(s){let t=screen.width/2-500,r=screen.height/2-800/2-30;window.open(l,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+r+", left="+t)}else window.open(l,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=l=>new Promise(async(s,t)=>{let r=document.getElementById(l.id);const o=await u.loadModule("html2canvas");try{o(r,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:l.windowWidth,height:l.windowHeight,windowWidth:l.windowWidth,windowHeight:l.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(n){let d=n.toDataURL("image/png");s(d)})}catch(n){t(n)}})}class y{static config={page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"},dialog:{width:"980px",closeOnClickModal:!1},tools:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,fileName:"Export Data "}},form:{stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0}},columnConfig:{type:"input",form:{labelWidth:"100px",width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},options:{switch:{activeValue:!0,inactiveValue:!1},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=l=>{y.config=ObjectUtil.deepMerge(y.config,l)}}class B{static customComponent={};static findOptions=(l,s)=>{const t=l.column.find(o=>o.key===s),r=o=>o.replace(/-([a-z])/g,(n,d)=>d.toUpperCase());if(t)return t.options[r(t.type)]};static setOptionsData=(l,s,t)=>{const r=B.findOptions(l,s);r&&(r.data=t)};static form={openBefore:{parentId:(l,s,t,r)=>{const o=y.config.table.rowKey;l?s.type===u.EDialog.Insert?(s.form.parentId=l[o],s.form.sort=l.children.length+1):s.form.parentId=l.parentId.substring(l.parentId.lastIndexOf(",")+1):(s.form.parentId="0",s.form.sort=t.length+1),B.setOptionsData(r,"parentId",[{[o]:"0",title:"根",children:t}])}}}}class E{static getIdFun=()=>StrUtil.uuid();static setId=(l,s,t)=>{s[l]||(s[l]=[]);const r=y.config.table.rowKey;s[l].forEach(o=>{t.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),o[n.value]===void 0&&(o[n.value]=d)}),o[r]||(o[r]=E.getIdFun())})};static add=(l,s,t,r)=>{const o=JSONUtil.cp(t);E.setId(l,s,t);const n=y.config.table.rowKey;s[l].push(o.reduce((d,p)=>{let h=p.default??"";return p.type==="number"&&(h=p.default??0),p.type==="boolean"&&(h=p.default??!1),p.type==="time"&&(h=p.default??new Date),d[p.value]=h,d},{[n]:E.getIdFun()})),r?.(s)};static remove=(l,s,t,r)=>{const o=y.config.table.rowKey;s[l]=s[l].filter(n=>n[o]!==t[o]),r?.(s)};static getNoIdData=(l,s)=>{const t=JSONUtil.cp(l),r=y.config.table.rowKey;return t.forEach(o=>{o[r]&&delete o[r],s&&o[s]&&E.getNoIdData(o[s],s)}),t}}const L={key:0,class:"column",style:{width:"100%",gap:"10px"}},I={class:"row items-center",style:{gap:"10px",width:"100%"}},D=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""}},emits:["change"],setup(i,{emit:l}){const s=i,t=e.reactive({show:!1,add:(o,n,d)=>{E.add(o,n,d,()=>{r("change")})},remove:(o,n,d)=>{E.remove(o,n,d,()=>{r("change")})}});e.onMounted(()=>{E.setId(s.field,s.row,s.itemFields),t.show=!0});const r=l;return(o,n)=>{const d=e.resolveComponent("el-button"),p=e.resolveComponent("el-input");return t.show?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(o.$slots,"list-start",{row:i.row}),e.createElementVNode("div",null,[e.createVNode(d,{link:"",type:"primary",onClick:n[0]||(n[0]=h=>t.add(i.field,i.row,i.itemFields))},{default:e.withCtx(()=>n[2]||(n[2]=[e.createTextVNode("添加")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.row[i.field],h=>(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(o.$slots,"item-start",{item:h,row:i.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.itemFields,c=>(e.openBlock(),e.createBlock(p,{modelValue:h[c.value],"onUpdate:modelValue":a=>h[c.value]=a,style:e.normalizeStyle({width:i.inputWidth}),class:e.normalizeClass(i.inputClass),placeholder:c[i.label]||c[i.value],onChange:n[1]||(n[1]=a=>r("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:h,row:i.row}),e.createVNode(d,{link:"",type:"danger",onClick:c=>t.remove(i.field,i.row,h)},{default:e.withCtx(()=>n[3]||(n[3]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),e.renderSlot(o.$slots,"list-end",{row:i.row})])):e.createCommentVNode("",!0)}}}),x={class:"row curd-row"},F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(i,{expose:l}){const s=u.isFun,t=u.EDialog,r=e.ref(),o=i,n=e.reactive({rules:{},show:!0,form:{},formDefault:{},formColumn:[],getDisabled:d=>d.disabled?.[(o.type||t.Insert)===t.Insert?"create":"update"],initColumnForm:async()=>{const d=o.option;n.formColumn=[];const p=[],h=o.option.form?.maxSpan||12,c=o.option.form?.defaultSpan||h;let a=[];const f=k=>{if(n.formDefault[k.key]=k.value,k.isForm){k.form=k.form||{span:c},k.form.span=k.form.span??c;let w=k.form.span,C=a.reduce((S,Ce)=>S+Ce.span,w);const V=a.length;a.push({item:k,span:w}),(V===1&&a[0].span===0||C>=h||w===0&&V>1)&&(p.push(a),a=[]),k.rules&&(n.rules[k.key]=k.rules)}};d.column.forEach(k=>{k.isForm=!0,f(k)}),a.length>0&&p.push(a),n.formColumn=p,n.form=JSONUtil.cp(n.formDefault)},init:async()=>{n.show=!1,await e.nextTick(),n.initColumnForm()}});return n.initColumnForm(),l({ref:r,conf:n}),(d,p)=>(e.openBlock(),e.createBlock(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:r,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",x,[e.renderSlot(d.$slots,"form-start",{row:n.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s)(c.item.show?.form,n.form)??!0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(c.item.form.span>0?`col-${c.item.form.span}`:"col")},[e.createVNode(e.unref(m.ElFormItem),{label:c.item.label,prop:c.item.key,"label-width":c.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"form-"+c.item.key+"-start",{row:n.form,item:c.item}),e.renderSlot(d.$slots,"form-"+c.item.key,{row:n.form,item:c.item},()=>[c.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:n.form[c.item.key],"onUpdate:modelValue":a=>n.form[c.item.key]=a,ref_for:!0},c.item.options?.input,e.toHandlers(c.item.options?.input?.on||{}),{disabled:n.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:n.form[c.item.key],"onUpdate:modelValue":a=>n.form[c.item.key]=a,ref_for:!0},c.item.options?.switch,e.toHandlers(c.item.options?.switch?.on||{}),{disabled:n.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:n.form[c.item.key],"onUpdate:modelValue":a=>n.form[c.item.key]=a,ref_for:!0},c.item.options?.select,e.toHandlers(c.item.options?.select?.on||{}),{disabled:n.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.select?.data,a=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:3,row:n.form,field:c.item.key,ref_for:!0},c.item.options?.list,e.toHandlers(c.item.options?.list?.on||{}),{disabled:n.getDisabled(c.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):c.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:4,modelValue:n.form[c.item.key],"onUpdate:modelValue":a=>n.form[c.item.key]=a,ref_for:!0},c.item.options?.treeSelect,e.toHandlers(c.item.options?.treeSelect?.on||{}),{disabled:n.getDisabled(c.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:5,modelValue:n.form[c.item.key],"onUpdate:modelValue":a=>n.form[c.item.key]=a,ref_for:!0},c.item.options?.datetime,e.toHandlers(c.item.options?.datetime?.on||{}),{disabled:n.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type&&e.unref(B).customComponent[c.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[c.item.type]),e.mergeProps({key:6,modelValue:n.form[c.item.key],"onUpdate:modelValue":a=>n.form[c.item.key]=a,ref_for:!0},c.item.options?.[c.item.type],e.toHandlers(c.item.options?.[c.item.type]?.on||{}),{disabled:n.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(d.$slots,"form-"+c.item.key+"-end",{row:n.form,item:c.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 Be(i){return i}const M={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?"};class g{static t(l,...s){if(typeof l=="function")return l(...s);l=String(l);let t=0;return l.replace(/{([^}]+)}/g,(r,o)=>t<s.length?String(s[t++]):`{${o}}`)}static setI18n=l=>{g.curd=ObjectUtil.deepMerge(g.curd,l)};static tCurd(l,...s){return this.t(this.curd[l],...s)}static curd=M}class ${static exportToExcel=async(l,s,t)=>{if(!l||l.length===0)return;const r=await u.loadModule("xlsx"),o=l.map(p=>{const h={};return s.forEach(c=>{h[c.label]=p[c.key]}),h}),n=r.utils.json_to_sheet(o),d=r.utils.book_new();r.utils.book_append_sheet(d,n,"Sheet1"),t?typeof t=="function"&&(t=t()):t=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,r.writeFile(d,`${t}.xlsx`)}}const N=u.EDialog,j=i=>{const l=e.ref(),s=e.ref(),t=e.reactive({search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(r,o=g.tCurd("placeholderInput"))=>r.text?.search?.placeholder===void 0?`${o}${r.label}`:r.text?.search?.placeholder,getFormData:()=>{let r={};i.option.column.forEach(n=>{(typeof n.show?.search=="function"?n.show?.search(t.search.form):n.show?.search)&&(r[n.key]=t.search.form[n.key])});const o=i.option.search?.before?.(r);return o&&(r=o),r},reset:()=>{const r=t.search.formDefault;Object.keys(r).forEach(o=>{i.option.search?.resetMode==="none"?r[o]=void 0:r[o]=t.search.formDefault[o]}),t.search.form=JSONUtil.cp(r),t.page.num=1,i.option.init!==!1&&t.table.getList()},submit:()=>{t.page.num=1,t.table.getList()}},page:{size:i.option.page?.size||10,sizeList:i.option.page?.sizeList||[10,20,50,100],num:1,total:0,layout:i.option.page?.layout||"total, sizes, prev, pager, next, jumper"},table:{op:{width:(...r)=>r.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(r,o)=>{},all:()=>{if(t.table.expand.isExpand)t.table.expand.rowKeys=[];else{const r=o=>{let n=[];return o.forEach(d=>{n.push(d[i.option.table.rowKey]),d.children&&d.children.length>0&&(n=n.concat(r(d.children)))}),n};t.table.expand.rowKeys=r(t.table.data)}t.table.expand.isExpand=!t.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{t.table.loading=!0;const r=i.option.api.list;try{await t.initApiData("init");let o={};if(t.table.sort.prop){const{props:f,order:k}=y.config.table.sort;o={[f.field]:t.table.sort.prop,[k.field]:t.table.sort.order}}const n=await r({[y.config.page.size]:t.page.size,[y.config.page.num]:t.page.num,...t.search.getFormData(),...o}),d=y.config.result,p=n.data||{[d.list]:n};let h=(Array.isArray(p[d.list]),p[d.list]);const c=t.update.formColumn.flat(),a=JSONUtil.cp(h).map(f=>(Object.keys(f).forEach(w=>{const C=c.find(V=>V.item.key===w);C&&["select","radio"].includes(C.item.type)&&(C.item.table.format||(C.item.table.format=V=>C.item.options[C.item.type].data?.find(S=>S.value==V[w])?.label||V[w]))}),f));t.table.data=i.option.data?await i.option.data(a,h):a,t.page.total=p[d.total]||0}catch(o){console.error(o)}finally{t.table.loading=!1}},selection:{list:[],change:r=>{t.table.selection.list=r}},sort:{prop:"",order:"",change:r=>{y.config.table.sort.resetPage&&(t.page.num=1);const o=y.config.table.sort;if(o.change){o.change(r,t);return}t.table.sort.prop=r.prop,r.order===null?t.table.sort.order="":t.table.sort.order=r.order==="ascending"?o.order.asc:o.order.desc,t.table.getList()}}},export:{run:{start:async r=>{let o=await t.export.run[r](),n=i.option.column;const d=JSONUtil.cp({data:o,columns:n}),p=i.option.tools?.export||{};p.before&&p.before(d),$.exportToExcel(d.data,d.columns,p.fileName)},select:()=>{if(t.table.selection.list.length===0)throw u.fail(g.tCurd("selectDataToExport")),new Error(g.tCurd("selectDataToExport"));return t.table.selection.list},page:()=>{if(t.table.data.length===0)throw u.fail(g.tCurd("noData")),new Error(g.tCurd("noData"));return t.table.data},all:async()=>{t.export.loading=!0;try{if(i.option.tools?.export?.all){await i.option.tools?.export?.all({[y.config.page.size]:t.page.size,[y.config.page.num]:t.page.num,...t.search.getFormData()});return}const r=i.option.api.list,o=await r({[y.config.page.size]:999999,[y.config.page.num]:1});return(o.data||{[y.config.result.list]:o})[y.config.result.list]}catch(r){console.error(r)}finally{t.export.loading=!1}}},loading:!1,click:r=>{t.export.loading||t.export.run.start(r)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:N.Insert,form:{},formDefault:{},formColumn:[],getDisabled:r=>t.update.type===N.View?!0:r.disabled?.[t.update.type===N.Insert?"create":"update"],edit:{data:{},getApiData:r=>{if(i.option.form?.editAll)return r;let o={[i.option.table?.rowKey]:t.update.edit.data[i.option.table?.rowKey]};return Object.keys(t.update.edit.data).forEach(n=>{r[n]!==t.update.edit.data[n]&&(o[n]=r[n])}),o}},view:{},open:(r,o)=>{t.update.showContent||FunUtil.throttle(async()=>{u.loading(!0);try{await t.initApiData("update");const n=r===N.Insert;if(!n&&i.option.table?.inlineEdit){t.inlineEdit.open(o);return}t.update.type=r,t.update.edit.data=o,t.update.title=g.tCurd(n?"add":r===N.View?"view":"edit"),t.update.form=JSONUtil.cp(n?t.update.formDefault:o),await i.option.form?.openBefore?.(o,t.update),t.update.show=!0,t.update.showContent=!0,i.option.form?.openAfter?.(o,t.update)}catch(n){console.error(n)}finally{u.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await s.value?.validate(async(d,p)=>new Promise((h,c)=>{d||(u.fail(g.tCurd("checkFormData")),c(!1)),h()})),t.update.loading=!0;const r=t.update.type===N.Insert?i.option.api.create:i.option.api.update;let o=JSONUtil.cp(t.update.form);delete o.children,await i.option.form?.submitBefore?.(o,t.update);const n=new Set(i.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(o).forEach(d=>{if(n.has(d)&&o[d]!=null){const p=new Date(o[d]).getTime();isNaN(p)||(o[d]=p)}});try{if(!r)return;await r({...o}),t.update.close(),await t.table.getList(),i.option.form?.submitAfter?.(o,t.update)}catch(d){console.error(d)}finally{t.update.loading=!1}})},close:()=>{t.update.show=!1,setTimeout(()=>{t.update.showContent=!1},350)}},inlineEdit:{row:null,form:{},loading:!1,open:r=>{t.inlineEdit.row=r,t.inlineEdit.form=JSONUtil.cp(r)},close:()=>{t.inlineEdit.row=null,t.inlineEdit.form={}},submit:()=>{FunUtil.throttle(async()=>{t.inlineEdit.loading=!0;const r=i.option.api.update;let o=JSONUtil.cp(t.inlineEdit.form);delete o.children;try{if(!r)return;await r({...o}),t.inlineEdit.close(),await t.table.getList(),u.success(g.tCurd("operationSuccess"))}catch(n){console.error(n)}finally{t.inlineEdit.loading=!1}})}},remove:{title:g.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{t.remove.show=!1},open:r=>{if(r.length===0){u.fail(g.tCurd("selectDataToDelete"));return}t.remove.items=r,t.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{t.remove.loading=!0;const r=i.option.api.delete;try{if(!r)return;await r({[i.option.table?.rowKey]:t.remove.items.map(o=>o[i.option.table?.rowKey]),items:t.remove.items}),u.success(g.tCurd("operationSuccess")),t.table.data.length<=1&&t.page.num>1&&(t.page.num-=1),t.remove.close(),await t.table.getList()}catch(o){console.error(o)}finally{t.remove.loading=!1}})}},init:()=>{t.initCurdConfig(),t.initColumnOptions(),t.initColumnForm()},apiDataMap:{},initApiData:async r=>{const o=[],n=d=>{if(d.children&&d.children.length){d.children.forEach(p=>n(p));return}if(d.type==="select"&&d.options?.select?.dataApi&&d.options?.select?.dataApiConfig?.[r]){if(t.apiDataMap[d.key]&&d.options?.select?.dataApiConfig?.once)return;const p=(async()=>{try{let h=await d.options?.select?.dataApi?.();if(h){const c=d.options?.select?.dataPath;c&&(h=ObjectUtil.getPathValue(h,c)),d.options.select.data=h,t.apiDataMap[d.key]=h}}catch{}})();o.push(p)}};return i.option.column.forEach(d=>{n(d)}),await Promise.all(o),!0},initCurdConfig:()=>{const r=JSONUtil.cp(y.config);r.table.emptyText=g.tCurd("noData");const o=ObjectUtil.deepMerge(r,i.option||{});Object.keys(o).forEach(n=>{i.option[n]=o[n]})},initColumnOptions:()=>{let r=JSONUtil.cp(y.config.columnConfig);r.options=ObjectUtil.deepMerge(r.options,{switch:{activeLabel:g.tCurd("switchOn"),inactiveLabel:g.tCurd("switchOff")}});const o=n=>{if(n.table=ObjectUtil.deepMerge(r.table,n.table||{}),n.children){n.children.forEach(d=>{o(d)});return}n.options=ObjectUtil.deepMerge(r.options,n.options||{}),n.form=ObjectUtil.deepMerge(r.form,n.form||{}),n.show=ObjectUtil.deepMerge(r.show,n.show||{}),n.sort=ObjectUtil.deepMerge(r.sort,n.sort||{}),n.type=n.type||r.type,n.type==="switch"&&(n.options.switch.tableBeforeChange=async(d,p)=>{const h=n.options?.switch;try{await l.value?.open({title:g.tCurd("confirmModify"),content:g.tCurd("confirmSwitchMessage")}),t.table.loading=!0;try{return i.option.api.update?(await i.option.api.update({[i.option.table?.rowKey]:p[i.option.table?.rowKey],[d]:p[d]===h.activeValue?h.inactiveValue:h.activeValue,final(c,a,f){t.table.loading=!1}}),t.table.loading=!1,u.success(g.tCurd("operationSuccess")),t.table.getList(),!0):void 0}catch(c){return console.error(c),!1}finally{t.table.loading=!1}}catch{return!1}}),n.type==="tree-select"&&(n.options.treeSelect.rowKey=i.option.table?.rowKey,n.options.treeSelect.nodeKey=i.option.table?.rowKey)};i.option.column.forEach(o),i.option.table?.column?.forEach(o)},getColumnSpan:(r,o)=>{if(r.item.form?.spanCol){const n=y.config.form.defaultSpan,p=o.filter(h=>!u.isFun(h.item.show?.form,t.update.form,t.update.type)).reduce((h,c)=>h+(c.item.form?.span||n),0);return(r.item?.form.span||n)+p}return r.item.form.span},initColumnForm:()=>{const r=i.option;t.update.formColumn=[],t.table.column.show={list:[],listSource:[]};const o=[],n=i.option.form?.maxSpan||12,d=i.option.form?.defaultSpan||n/2;let p=[];const h=f=>{if(f.children){t.table.column.show.list.push(f.key),f.children.forEach(k=>{h(k)});return}if(t.update.formDefault[f.key]=f.value,f.table.table&&(f.show.table&&t.table.column.show.list.push(f.key),f.table.table&&t.table.column.show.listSource.push(f.key)),!(f.isForm&&typeof f.show?.form=="boolean")||f.show?.form){f.form=f.form||{span:d},f.form.span=f.form.span??d;let k=f.form.span,w=p.reduce((V,S)=>V+S.span,k);const C=p.length;if(p.push({item:f,span:k}),(C===1&&p[0].span===0||w>=n||k===0&&C>1)&&(o.push(p),p=[]),f.rules){const V={input:g.tCurd("placeholderInput"),select:g.tCurd("placeholderSelect")},S=(V[f.type]||V.input)+f.label;t.update.rules[f.key]=typeof f.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:f.rules}}},c=(f,k)=>{f.isForm=k,Array.isArray(f.children)&&f.children.forEach(w=>c(w,k))};r.column.forEach(f=>{f.isForm=!0,c(f,!0),h(f)}),i.option.table?.column?.forEach(f=>{c(f,!1),h(f)}),t.search.column.list=r.column.concat(r.table?.column||[]),t.table.column.list=t.search.column.list.filter(f=>f.table?.table),t.search.column.list.sort((f,k)=>f.sort?.search-k.sort?.search),t.table.column.list.sort((f,k)=>f.sort?.table-k.sort?.table),p.length>0&&o.push(p),t.update.formColumn=o;const a=i.option.search?.formDefault;a&&Object.keys(a).forEach(f=>{t.search.formDefault[f]=a[f]}),r.column.forEach(f=>{f.show?.search||(t.search.formDefault[f.key]=void 0)}),t.search.form=JSONUtil.cp(t.search.formDefault)}});return t.init(),e.onMounted(()=>{i.option.init!==!1&&t.table.getList()}),{conf:t,switchConfirmRef:l,ruleFormRef:s}},z={class:"dialog-footer"},R=e.defineComponent({__name:"switchConfirm",setup(i,{expose:l}){const s=e.ref(!1),t=e.ref("确认修改"),r=e.ref("确认要修改状态吗?");let o=null,n=null;const d=c=>(c?.title&&(t.value=c.title),c?.content&&(r.value=c.content),s.value=!0,new Promise((a,f)=>{o=a,n=f})),p=()=>{s.value=!1,o?.(!0),o=null,n=null},h=()=>{s.value=!1,n?.(new Error("用户取消操作")),o=null,n=null};return l({open:d}),(c,a)=>(e.openBlock(),e.createBlock(e.unref(m.ElDialog),{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=f=>s.value=f),title:t.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createElementVNode("span",z,[e.createVNode(e.unref(m.ElButton),{onClick:h},{default:e.withCtx(()=>a[1]||(a[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:p},{default:e.withCtx(()=>a[2]||(a[2]=[e.createTextVNode("确认")])),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(r.value),1)]),_:1},8,["modelValue","title"]))}}),U=(i,l)=>{const s=i.__vccOpts||i;for(const[t,r]of l)s[t]=r;return s},A={},H={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function K(i,l){return e.openBlock(),e.createElementBlock("svg",H,l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)]))}const J=U(A,[["render",K]]),W={},q={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function G(i,l){return e.openBlock(),e.createElementBlock("svg",q,l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)]))}const X=U(W,[["render",G]]),Q={class:"row flex-center table-header-label inline"},Y={class:"table-header-tooltip"},Z=["onClick","innerHTML"],P=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(i){const l=u.isFun,s=e.getCurrentInstance().type;return(t,r)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.key},[t.conf.table.column.show.list.includes(n.key)?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:0,prop:n.key,label:n.label,ref_for:!0},n.table),{header:e.withCtx(()=>[e.renderSlot(t.$slots,"table-header-"+n.key,{item:n},()=>[e.createElementVNode("div",Q,[n.table?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",content:n.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",Y,[e.createVNode(X)])]),_:2},1032,["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},[r[0]||(r[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),{conf:t.conf,columnList:n.children,option:t.option},e.createSlots({_:2},[e.renderList(t.$slots,(p,h)=>({name:h,fn:e.withCtx(c=>[e.renderSlot(t.$slots,h,e.mergeProps({ref_for:!0},c||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(l)(n.show?.form,t.conf.inlineEdit.form,e.unref(u).EDialog.Update)&&t.option.table?.inlineEdit&&t.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(m.ElInput),e.mergeProps({key:0,modelValue:t.conf.inlineEdit.form[n.key],"onUpdate:modelValue":p=>t.conf.inlineEdit.form[n.key]=p,ref_for:!0},n.options?.input,{size:"small",style:{width:"100%"},onKeyup:e.withKeys(t.conf.inlineEdit.submit,["enter"])}),null,16,["modelValue","onUpdate:modelValue","onKeyup"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:t.conf.inlineEdit.form[n.key],"onUpdate:modelValue":p=>t.conf.inlineEdit.form[n.key]=p,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,p=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):e.renderSlot(t.$slots,"table-"+n.key,{key:1,row:d,item:n},()=>[n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:0,modelValue:d[n.key],"onUpdate:modelValue":p=>d[n.key]=p,"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:p=>n.table?.click?.callback?.(d),innerHTML:n.table?.format?n.table?.format(d):d[n.key]},null,14,Z))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),_={class:"row form-item-content",style:{width:"100%"}},v={class:"col"},ee={class:"col"},te=["innerHTML"],oe=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(i){return(l,s)=>(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof l.item.item.text?.form?.label=="boolean"?!l.item.item.text?.form?.label:!1}),label:typeof l.item.item.text?.form?.label=="string"?l.item.item.text?.form?.label:l.item.item.label,prop:l.item.item.key,"label-width":l.item.item.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.renderSlot(l.$slots,"form-"+l.item.item.key+"-start",{row:l.conf.update.form,item:l.item.item}),e.createElementVNode("div",v,[e.createElementVNode("div",ee,[e.renderSlot(l.$slots,"form-"+l.item.item.key,{row:l.conf.update.form,item:l.item.item},()=>[l.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[0]||(s[0]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.input,e.toHandlers(l.item.item.options?.input?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item)}),null,16,["modelValue","disabled"])):l.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[1]||(s[1]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.switch,{disabled:l.conf.update.getDisabled(l.item.item)}),null,16,["modelValue","disabled"])):l.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[2]||(s[2]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.select,e.toHandlers(l.item.item.options?.select?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.item.options?.select?.data,t=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):l.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[3]||(s[3]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.radio,e.toHandlers(l.item.item.options?.radio?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.item.options?.radio?.data,t=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):l.item.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:l.conf.update.form,field:l.item.item.key},l.item.item.options?.list,e.toHandlers(l.item.item.options?.list?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):l.item.item.type==="tree-select"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[4]||(s[4]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.treeSelect,e.toHandlers(l.item.item.options?.treeSelect?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):l.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[5]||(s[5]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.datetime,e.toHandlers(l.item.item.options?.datetime?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item)}),null,16,["modelValue","disabled"])):l.item.item.type&&e.unref(B).customComponent[l.item.item.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.item.item.type]),e.mergeProps({key:7,modelValue:l.conf.update.form[l.item.item.key],"onUpdate:modelValue":s[6]||(s[6]=t=>l.conf.update.form[l.item.item.key]=t)},l.item.item.options?.[l.item.item.type],e.toHandlers(l.item.item.options?.[l.item.item.type]?.on||{}),{disabled:l.conf.update.getDisabled(l.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(l.$slots,"form-"+l.item.item.key+"-right",{row:l.conf.update.form,item:l.item.item})]),e.renderSlot(l.$slots,"form-"+l.item.item.key+"-tip",{row:l.conf.update.form,item:l.item.item},()=>[l.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:l.item.item.form?.tipText},null,8,te)):e.createCommentVNode("",!0)])]),e.renderSlot(l.$slots,"form-"+l.item.item.key+"-end",{row:l.conf.update.form,item:l.item.item})])]),_:3},8,["class","label","prop","label-width"]))}}),le={class:"col relative cc1-form-box"},ne={class:"absolute row fit",style:{overflow:"hidden"}},re={class:"col column fit-width no-wrap"},ae={key:0,class:"relative curd-search fit-width"},ie={class:"mb-10 flex justify-between items-center fit-width"},se={class:"flex items-center",style:{gap:"10px"}},de={key:0},ce={key:1},fe={key:2},pe={class:"export-btn"},me={class:"flex items-center",style:{gap:"10px"}},he={class:"col fit-width relative form-box"},ge={class:"absolute column fit form-box-content"},ke={class:"row justify-end mt-10 mb-10"},ue={class:"dialog-footer"},ye={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(i,{expose:l}){const s=u.EDialog,t=i,r=u.isFun,{conf:o,switchConfirmRef:n,ruleFormRef:d}=j(t);return l({conf:o}),(p,h)=>{const c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("div",ne,[e.renderSlot(p.$slots,"box-left"),e.createElementVNode("div",re,[i.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(m.ElForm),{model:e.unref(o).search.form,inline:""},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[(typeof a.show?.search=="function"?a.show?.search(e.unref(o).search.form):a.show?.search)?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0,label:typeof a.text?.search?.label=="string"?a.text?.search?.label:a.label,class:e.normalizeClass({"hide-label":typeof a.text?.search?.label=="boolean"?!a.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"search-"+a.key,{row:e.unref(o).search.form},()=>[a.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:e.unref(o).search.form[a.key],"onUpdate:modelValue":f=>e.unref(o).search.form[a.key]=f,placeholder:e.unref(o).search.getPlaceholder(a),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.search?.input||a.options?.input,e.toHandlers(a.options?.search?.input?.on||a.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:e.unref(o).search.form[a.key],"onUpdate:modelValue":f=>e.unref(o).search.form[a.key]=f,placeholder:e.unref(o).search.getPlaceholder(a,e.unref(g).tCurd("placeholderSelect")),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.search?.switch||a.options?.switch,e.toHandlers(a.options?.search?.switch?.on||a.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.options?.switch?.activeValue,label:a.options?.switch?.activeLabel,value:a.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.options?.switch?.inactiveValue,label:a.options?.switch?.inactiveLabel,value:a.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:e.unref(o).search.form[a.key],"onUpdate:modelValue":f=>e.unref(o).search.form[a.key]=f,placeholder:e.unref(o).search.getPlaceholder(a,e.unref(g).tCurd("placeholderSelect")),clearable:"",disabled:a.disabled?.search,ref_for:!0},a.options?.search?.select||a.options?.select,e.toHandlers(a.options?.search?.select?.on||a.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options?.select?.data,f=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):a.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(o).search.form[a.key],"onUpdate:modelValue":f=>e.unref(o).search.form[a.key]=f,disabled:a.disabled?.search,ref_for:!0},a.options?.search?.datetime||a.options?.datetime,e.toHandlers(a.options?.search?.datetime?.on||a.options?.datetime?.on||{})),null,16,["modelValue","onUpdate:modelValue","disabled"])):a.type&&e.unref(B).customComponent[a.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[a.type]),e.mergeProps({key:4,modelValue:e.unref(o).search.form[a.key],"onUpdate:modelValue":f=>e.unref(o).search.form[a.key]=f,ref_for:!0},a.options?.search?.[a.type]||a.options?.[a.type],e.toHandlers(a.options?.search?.[a.type]?.on||a.options?.[a.type]?.on||{}),{disabled:a.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(p.$slots,"search-"+a.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(p.$slots,"search-center",{row:e.unref(o).search.form}),i.option.tools?.search||i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0},{default:e.withCtx(()=>[i.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createElementVNode("div",ie,[e.createElementVNode("div",se,[e.unref(r)(i.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",de,[e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:h[0]||(h[0]=a=>e.unref(o).update.open(e.unref(s).Insert))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("add")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.table?.selectable&&e.unref(r)(i.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:h[1]||(h[1]=a=>e.unref(o).remove.open(e.unref(o).table.selection.list))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("delete")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(m.ElButton),{type:"warning",onClick:h[2]||(h[2]=a=>e.unref(o).table.expand.all())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("expandCollapse")),1)]),_:1})])):e.createCommentVNode("",!0),i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElDropdown),{key:3,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(m.ElDropdownMenu),null,{default:e.withCtx(()=>[i.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(m.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("exportAll")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(o).export.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("export")),1)]),_:1},8,["loading"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"tools-left")]),e.createElementVNode("div",me,[e.renderSlot(p.$slots,"tools-right"),i.option.tools?.refresh===void 0||i.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:0,class:"refresh-btn",onClick:h[3]||(h[3]=(...a)=>e.unref(o).table.getList&&e.unref(o).table.getList(...a))},[e.createVNode(J)])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",he,[e.createElementVNode("div",ge,[e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElTable),e.mergeProps({data:e.unref(o).table.data,border:i.option.table?.border===void 0?!0:i.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},i.option.table,e.toHandlers(i.option.table?.on||{})),{default:e.withCtx(()=>[i.option.table?.selectable||e.unref(r)(i.option.tools?.delete)||i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,type:"selection",selectable:typeof i.option.table?.selectable=="function"?i.option.table?.selectable:void 0,width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(P,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:i.option},e.createSlots({_:2},[e.renderList(p.$slots,(a,f)=>({name:f,fn:e.withCtx(k=>[e.renderSlot(p.$slots,f,e.normalizeProps(e.guardReactiveProps(k||{})))])}))]),1032,["conf","columnList","option"]),e.unref(r)(i.option.table?.add)||e.unref(r)(i.option.table?.update)||e.unref(r)(i.option.table?.delete)||e.unref(r)(i.option.table?.view)||p.$slots["table-op-left"]||p.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:1,width:e.unref(o).table.op.width(e.unref(r)(i.option.table?.add),e.unref(r)(i.option.table?.update),e.unref(r)(i.option.table?.delete),e.unref(r)(i.option.table?.view),p.$slots["table-op-left"],p.$slots["table-op-right"]),align:"center",fixed:"right"},i.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(p.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("operation")),1)])]),default:e.withCtx(({row:a})=>[e.renderSlot(p.$slots,"table-op-left",{row:a}),i.option.table?.inlineEdit&&e.unref(o).inlineEdit.row===a?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(m.ElButton),{link:"",type:"info",onClick:e.unref(o).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{link:"",type:"primary",onClick:e.unref(o).inlineEdit.submit,loading:e.unref(o).inlineEdit.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(p.$slots,"table-op-edit-right",{row:a})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(r)(i.option.table?.add,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,link:"",type:"primary",onClick:f=>e.unref(o).update.open(e.unref(s).Insert,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.view,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,link:"",type:"primary",onClick:f=>e.unref(o).update.open(e.unref(s).View,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.update,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,link:"",type:"warning",onClick:f=>e.unref(o).update.open(e.unref(s).Update,a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.delete,a)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:3,link:"",type:"danger",onClick:f=>e.unref(o).remove.open([a])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"table-op-right",{row:a})],64))]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[c,e.unref(o).table.loading]])])]),e.createElementVNode("div",ke,[i.option.page?.show===void 0||i.option.page?.show?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),{key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":h[4]||(h[4]=a=>e.unref(o).page.num=a),"page-size":e.unref(o).page.size,"onUpdate:pageSize":h[5]||(h[5]=a=>e.unref(o).page.size=a),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":7,layout:e.unref(o).page.layout,total:e.unref(o).page.total,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},null,8,["current-page","page-size","page-sizes","layout","total","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])]),e.renderSlot(p.$slots,"box-right")]),e.createVNode(e.unref(m.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":h[6]||(h[6]=a=>e.unref(o).update.show=a),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},i.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",ue,[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(s).View?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createVNode(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:d,model:e.unref(o).update.form,rules:e.unref(o).update.rules},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)((()=>{const f=[],k=w=>{w?.item?.children?k(w.item.children):f.push(...w.map(C=>C.item?.show?.form))};return k(a),f})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(p.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)(f.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([f.item.form.span>0?`col-${e.unref(o).getColumnSpan(f,a)}`:"col",`form-item-col-${f.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.item.children?f.children:[f],k=>(e.openBlock(),e.createBlock(oe,{key:k.item.key,conf:e.unref(o),item:k},e.createSlots({_:2},[e.renderList(p.$slots,(w,C)=>({name:C,fn:e.withCtx(V=>[e.renderSlot(p.$slots,C,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(p.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(m.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":h[7]||(h[7]=a=>e.unref(o).remove.show=a),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",ye,[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(g).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(R,{ref_key:"switchConfirmRef",ref:n},null,512)])}}});class be{static async download(l,s="download.png"){const t=document.createElement("a");t.style.display="none",t.href=l,t.setAttribute("download",s),typeof t.download>"u"&&t.setAttribute("target","_blank"),document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(l)}static exportJSONFile=(l,s)=>{const t=new Blob([JSON.stringify(l)],{type:"application/json"}),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=`${s||"config"}.json`,o.click()};static importFile=async l=>new Promise((s,t)=>{const r=document.createElement("input");r.type="file";const o=l?.accept||".json";r.accept=o,r.style.display="none",r.onchange=n=>{const d=n.target.files[0];if(!d){u.fail("未选择文件"),t("未选择文件");return}const p=new FileReader;p.onload=async h=>{const c=o==".json"?JSON.parse(h.target.result):h.target.result;s(c)},p.onerror=()=>{u.fail("文件读取失败"),t("文件读取失败")},p.readAsText(d),document.body.removeChild(r)},document.body.appendChild(r),r.click()})}const T=(i,l)=>{if(i.component("TCurd",O),i.component("TFormList",D),i.component("TColumn",F),l?.customComponent){B.customComponent=l.customComponent;for(const s in l.customComponent)i.component(s,l.customComponent[s])}},we={install:T};b.ArrUtil=E,b.ExcelUtil=$,b.TColumn=F,b.TCurd=O,b.TFile=be,b.TForm=B,b.TFormConfig=y,b.TFormI18n=g,b.TFormList=D,b.TSys=u,b.default=we,b.install=T,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -23,6 +23,71 @@ declare const conf: {
|
|
|
23
23
|
} | undefined;
|
|
24
24
|
options?: {
|
|
25
25
|
[x: string]: any;
|
|
26
|
+
search?: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
input?: {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
on?: any;
|
|
31
|
+
} | undefined;
|
|
32
|
+
switch?: {
|
|
33
|
+
on?: Record<string, any> | undefined;
|
|
34
|
+
activeValue?: any;
|
|
35
|
+
activeLabel?: string | undefined;
|
|
36
|
+
inactiveValue?: any;
|
|
37
|
+
inactiveLabel?: string | undefined;
|
|
38
|
+
tableBeforeChange?: ((key: string, data: any) => any) | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
select?: {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
on?: any;
|
|
43
|
+
data?: {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
label: string;
|
|
46
|
+
value: any;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
49
|
+
dataApiConfig?: {
|
|
50
|
+
once: boolean;
|
|
51
|
+
init: boolean;
|
|
52
|
+
update: boolean;
|
|
53
|
+
} | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
treeSelect?: {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
on?: any;
|
|
58
|
+
} | undefined;
|
|
59
|
+
datetime?: {
|
|
60
|
+
[x: string]: any;
|
|
61
|
+
on?: any;
|
|
62
|
+
} | undefined;
|
|
63
|
+
list?: {
|
|
64
|
+
on?: Record<string, any> | undefined;
|
|
65
|
+
label?: string | undefined;
|
|
66
|
+
value?: any;
|
|
67
|
+
itemFields?: {
|
|
68
|
+
[x: string]: any;
|
|
69
|
+
label: string;
|
|
70
|
+
value: any;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
inputWidth?: any;
|
|
73
|
+
inputClass?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
radio?: {
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
on?: any;
|
|
78
|
+
data?: {
|
|
79
|
+
[x: string]: any;
|
|
80
|
+
label: string;
|
|
81
|
+
value: any;
|
|
82
|
+
}[] | undefined;
|
|
83
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
84
|
+
dataApiConfig?: {
|
|
85
|
+
once: boolean;
|
|
86
|
+
init: boolean;
|
|
87
|
+
update: boolean;
|
|
88
|
+
} | undefined;
|
|
89
|
+
} | undefined;
|
|
90
|
+
} | undefined;
|
|
26
91
|
input?: {
|
|
27
92
|
[x: string]: any;
|
|
28
93
|
on?: any;
|
|
@@ -152,6 +217,71 @@ declare var __VLS_7: {
|
|
|
152
217
|
} | undefined;
|
|
153
218
|
options?: {
|
|
154
219
|
[x: string]: any;
|
|
220
|
+
search?: {
|
|
221
|
+
[x: string]: any;
|
|
222
|
+
input?: {
|
|
223
|
+
[x: string]: any;
|
|
224
|
+
on?: any;
|
|
225
|
+
} | undefined;
|
|
226
|
+
switch?: {
|
|
227
|
+
on?: Record<string, any> | undefined;
|
|
228
|
+
activeValue?: any;
|
|
229
|
+
activeLabel?: string | undefined;
|
|
230
|
+
inactiveValue?: any;
|
|
231
|
+
inactiveLabel?: string | undefined;
|
|
232
|
+
tableBeforeChange?: ((key: string, data: any) => any) | undefined;
|
|
233
|
+
} | undefined;
|
|
234
|
+
select?: {
|
|
235
|
+
[x: string]: any;
|
|
236
|
+
on?: any;
|
|
237
|
+
data?: {
|
|
238
|
+
[x: string]: any;
|
|
239
|
+
label: string;
|
|
240
|
+
value: any;
|
|
241
|
+
}[] | undefined;
|
|
242
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
243
|
+
dataApiConfig?: {
|
|
244
|
+
once: boolean;
|
|
245
|
+
init: boolean;
|
|
246
|
+
update: boolean;
|
|
247
|
+
} | undefined;
|
|
248
|
+
} | undefined;
|
|
249
|
+
treeSelect?: {
|
|
250
|
+
[x: string]: any;
|
|
251
|
+
on?: any;
|
|
252
|
+
} | undefined;
|
|
253
|
+
datetime?: {
|
|
254
|
+
[x: string]: any;
|
|
255
|
+
on?: any;
|
|
256
|
+
} | undefined;
|
|
257
|
+
list?: {
|
|
258
|
+
on?: Record<string, any> | undefined;
|
|
259
|
+
label?: string | undefined;
|
|
260
|
+
value?: any;
|
|
261
|
+
itemFields?: {
|
|
262
|
+
[x: string]: any;
|
|
263
|
+
label: string;
|
|
264
|
+
value: any;
|
|
265
|
+
}[] | undefined;
|
|
266
|
+
inputWidth?: any;
|
|
267
|
+
inputClass?: string | undefined;
|
|
268
|
+
} | undefined;
|
|
269
|
+
radio?: {
|
|
270
|
+
[x: string]: any;
|
|
271
|
+
on?: any;
|
|
272
|
+
data?: {
|
|
273
|
+
[x: string]: any;
|
|
274
|
+
label: string;
|
|
275
|
+
value: any;
|
|
276
|
+
}[] | undefined;
|
|
277
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
278
|
+
dataApiConfig?: {
|
|
279
|
+
once: boolean;
|
|
280
|
+
init: boolean;
|
|
281
|
+
update: boolean;
|
|
282
|
+
} | undefined;
|
|
283
|
+
} | undefined;
|
|
284
|
+
} | undefined;
|
|
155
285
|
input?: {
|
|
156
286
|
[x: string]: any;
|
|
157
287
|
on?: any;
|
|
@@ -272,6 +402,71 @@ declare var __VLS_7: {
|
|
|
272
402
|
} | undefined;
|
|
273
403
|
options?: {
|
|
274
404
|
[x: string]: any;
|
|
405
|
+
search?: {
|
|
406
|
+
[x: string]: any;
|
|
407
|
+
input?: {
|
|
408
|
+
[x: string]: any;
|
|
409
|
+
on?: any;
|
|
410
|
+
} | undefined;
|
|
411
|
+
switch?: {
|
|
412
|
+
on?: Record<string, any> | undefined;
|
|
413
|
+
activeValue?: any;
|
|
414
|
+
activeLabel?: string | undefined;
|
|
415
|
+
inactiveValue?: any;
|
|
416
|
+
inactiveLabel?: string | undefined;
|
|
417
|
+
tableBeforeChange?: ((key: string, data: any) => any) | undefined;
|
|
418
|
+
} | undefined;
|
|
419
|
+
select?: {
|
|
420
|
+
[x: string]: any;
|
|
421
|
+
on?: any;
|
|
422
|
+
data?: {
|
|
423
|
+
[x: string]: any;
|
|
424
|
+
label: string;
|
|
425
|
+
value: any;
|
|
426
|
+
}[] | undefined;
|
|
427
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
428
|
+
dataApiConfig?: {
|
|
429
|
+
once: boolean;
|
|
430
|
+
init: boolean;
|
|
431
|
+
update: boolean;
|
|
432
|
+
} | undefined;
|
|
433
|
+
} | undefined;
|
|
434
|
+
treeSelect?: {
|
|
435
|
+
[x: string]: any;
|
|
436
|
+
on?: any;
|
|
437
|
+
} | undefined;
|
|
438
|
+
datetime?: {
|
|
439
|
+
[x: string]: any;
|
|
440
|
+
on?: any;
|
|
441
|
+
} | undefined;
|
|
442
|
+
list?: {
|
|
443
|
+
on?: Record<string, any> | undefined;
|
|
444
|
+
label?: string | undefined;
|
|
445
|
+
value?: any;
|
|
446
|
+
itemFields?: {
|
|
447
|
+
[x: string]: any;
|
|
448
|
+
label: string;
|
|
449
|
+
value: any;
|
|
450
|
+
}[] | undefined;
|
|
451
|
+
inputWidth?: any;
|
|
452
|
+
inputClass?: string | undefined;
|
|
453
|
+
} | undefined;
|
|
454
|
+
radio?: {
|
|
455
|
+
[x: string]: any;
|
|
456
|
+
on?: any;
|
|
457
|
+
data?: {
|
|
458
|
+
[x: string]: any;
|
|
459
|
+
label: string;
|
|
460
|
+
value: any;
|
|
461
|
+
}[] | undefined;
|
|
462
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
463
|
+
dataApiConfig?: {
|
|
464
|
+
once: boolean;
|
|
465
|
+
init: boolean;
|
|
466
|
+
update: boolean;
|
|
467
|
+
} | undefined;
|
|
468
|
+
} | undefined;
|
|
469
|
+
} | undefined;
|
|
275
470
|
input?: {
|
|
276
471
|
[x: string]: any;
|
|
277
472
|
on?: any;
|
|
@@ -392,6 +587,71 @@ declare var __VLS_7: {
|
|
|
392
587
|
} | undefined;
|
|
393
588
|
options?: {
|
|
394
589
|
[x: string]: any;
|
|
590
|
+
search?: {
|
|
591
|
+
[x: string]: any;
|
|
592
|
+
input?: {
|
|
593
|
+
[x: string]: any;
|
|
594
|
+
on?: any;
|
|
595
|
+
} | undefined;
|
|
596
|
+
switch?: {
|
|
597
|
+
on?: Record<string, any> | undefined;
|
|
598
|
+
activeValue?: any;
|
|
599
|
+
activeLabel?: string | undefined;
|
|
600
|
+
inactiveValue?: any;
|
|
601
|
+
inactiveLabel?: string | undefined;
|
|
602
|
+
tableBeforeChange?: ((key: string, data: any) => any) | undefined;
|
|
603
|
+
} | undefined;
|
|
604
|
+
select?: {
|
|
605
|
+
[x: string]: any;
|
|
606
|
+
on?: any;
|
|
607
|
+
data?: {
|
|
608
|
+
[x: string]: any;
|
|
609
|
+
label: string;
|
|
610
|
+
value: any;
|
|
611
|
+
}[] | undefined;
|
|
612
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
613
|
+
dataApiConfig?: {
|
|
614
|
+
once: boolean;
|
|
615
|
+
init: boolean;
|
|
616
|
+
update: boolean;
|
|
617
|
+
} | undefined;
|
|
618
|
+
} | undefined;
|
|
619
|
+
treeSelect?: {
|
|
620
|
+
[x: string]: any;
|
|
621
|
+
on?: any;
|
|
622
|
+
} | undefined;
|
|
623
|
+
datetime?: {
|
|
624
|
+
[x: string]: any;
|
|
625
|
+
on?: any;
|
|
626
|
+
} | undefined;
|
|
627
|
+
list?: {
|
|
628
|
+
on?: Record<string, any> | undefined;
|
|
629
|
+
label?: string | undefined;
|
|
630
|
+
value?: any;
|
|
631
|
+
itemFields?: {
|
|
632
|
+
[x: string]: any;
|
|
633
|
+
label: string;
|
|
634
|
+
value: any;
|
|
635
|
+
}[] | undefined;
|
|
636
|
+
inputWidth?: any;
|
|
637
|
+
inputClass?: string | undefined;
|
|
638
|
+
} | undefined;
|
|
639
|
+
radio?: {
|
|
640
|
+
[x: string]: any;
|
|
641
|
+
on?: any;
|
|
642
|
+
data?: {
|
|
643
|
+
[x: string]: any;
|
|
644
|
+
label: string;
|
|
645
|
+
value: any;
|
|
646
|
+
}[] | undefined;
|
|
647
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
648
|
+
dataApiConfig?: {
|
|
649
|
+
once: boolean;
|
|
650
|
+
init: boolean;
|
|
651
|
+
update: boolean;
|
|
652
|
+
} | undefined;
|
|
653
|
+
} | undefined;
|
|
654
|
+
} | undefined;
|
|
395
655
|
input?: {
|
|
396
656
|
[x: string]: any;
|
|
397
657
|
on?: any;
|
|
@@ -621,6 +881,71 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
621
881
|
} | undefined;
|
|
622
882
|
options?: {
|
|
623
883
|
[x: string]: any;
|
|
884
|
+
search?: {
|
|
885
|
+
[x: string]: any;
|
|
886
|
+
input?: {
|
|
887
|
+
[x: string]: any;
|
|
888
|
+
on?: any;
|
|
889
|
+
} | undefined;
|
|
890
|
+
switch?: {
|
|
891
|
+
on?: Record<string, any> | undefined;
|
|
892
|
+
activeValue?: any;
|
|
893
|
+
activeLabel?: string | undefined;
|
|
894
|
+
inactiveValue?: any;
|
|
895
|
+
inactiveLabel?: string | undefined;
|
|
896
|
+
tableBeforeChange?: ((key: string, data: any) => any) | undefined;
|
|
897
|
+
} | undefined;
|
|
898
|
+
select?: {
|
|
899
|
+
[x: string]: any;
|
|
900
|
+
on?: any;
|
|
901
|
+
data?: {
|
|
902
|
+
[x: string]: any;
|
|
903
|
+
label: string;
|
|
904
|
+
value: any;
|
|
905
|
+
}[] | undefined;
|
|
906
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
907
|
+
dataApiConfig?: {
|
|
908
|
+
once: boolean;
|
|
909
|
+
init: boolean;
|
|
910
|
+
update: boolean;
|
|
911
|
+
} | undefined;
|
|
912
|
+
} | undefined;
|
|
913
|
+
treeSelect?: {
|
|
914
|
+
[x: string]: any;
|
|
915
|
+
on?: any;
|
|
916
|
+
} | undefined;
|
|
917
|
+
datetime?: {
|
|
918
|
+
[x: string]: any;
|
|
919
|
+
on?: any;
|
|
920
|
+
} | undefined;
|
|
921
|
+
list?: {
|
|
922
|
+
on?: Record<string, any> | undefined;
|
|
923
|
+
label?: string | undefined;
|
|
924
|
+
value?: any;
|
|
925
|
+
itemFields?: {
|
|
926
|
+
[x: string]: any;
|
|
927
|
+
label: string;
|
|
928
|
+
value: any;
|
|
929
|
+
}[] | undefined;
|
|
930
|
+
inputWidth?: any;
|
|
931
|
+
inputClass?: string | undefined;
|
|
932
|
+
} | undefined;
|
|
933
|
+
radio?: {
|
|
934
|
+
[x: string]: any;
|
|
935
|
+
on?: any;
|
|
936
|
+
data?: {
|
|
937
|
+
[x: string]: any;
|
|
938
|
+
label: string;
|
|
939
|
+
value: any;
|
|
940
|
+
}[] | undefined;
|
|
941
|
+
dataApi?: ((param?: any) => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean) | undefined;
|
|
942
|
+
dataApiConfig?: {
|
|
943
|
+
once: boolean;
|
|
944
|
+
init: boolean;
|
|
945
|
+
update: boolean;
|
|
946
|
+
} | undefined;
|
|
947
|
+
} | undefined;
|
|
948
|
+
} | undefined;
|
|
624
949
|
input?: {
|
|
625
950
|
[x: string]: any;
|
|
626
951
|
on?: any;
|