var H=Object.defineProperty,N=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var _=(e,t,s)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,c=(e,t)=>{for(var s in t||(t={}))w.call(t,s)&&_(e,s,t[s]);if(m)for(var s of m(t))v.call(t,s)&&_(e,s,t[s]);return e},b=(e,t)=>N(e,R(t));var g=(e,t)=>{var s={};for(var a in e)w.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&m)for(var a of m(e))t.indexOf(a)<0&&v.call(e,a)&&(s[a]=e[a]);return s};import{u as O,B as z}from"./useTable-e949a6b7.js";import"./useForm-baba730a.js";import{n as E,S as K,j as L,_ as W}from"./index.js";import{j as I}from"./antd-0679333d.js";import{d as Z,o as G,Z as J,_ as Q,$ as Y,k as M,u as h}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const U="/v1/system/log",X=e=>E.get({url:`${U}/search`,params:e}),d={xs:{span:24},sm:{span:24},lg:{span:6}},ee={span:24},u={model:"Log",viewInPage:!1,properties:[{field:"id",label:"ID系统自动生成",defaultValue:void 0,form:{componentProps:{allowClear:!1,placeholder:"ID系统自动生成"},colProps:d,component:"InputNumber",rules:[{required:!0,message:"请输入ID系统自动生成！"}]},table:{}},{field:"userId",label:"操作人",defaultValue:0,form:{componentProps:{allowClear:!1,placeholder:"操作人"},colProps:d,component:"InputNumber",rules:[{required:!0,message:"请输入操作人！"}]},table:{}},{field:"description",label:"描述",defaultValue:void 0,form:{componentProps:{allowClear:!1,placeholder:"描述"},component:"Input",colProps:d,rules:[{required:!0,message:"请输入描述！"}]},table:{ellipsis:!0}},{field:"remark",label:"说明",defaultValue:void 0,form:{componentProps:{allowClear:!0,placeholder:"说明"},colProps:d,component:"Input"},table:{width:400,ellipsis:!0}},{field:"username",label:"操作人",defaultValue:void 0,form:{componentProps:{allowClear:!0,placeholder:"操作人"},colProps:d,component:"Input"},table:{width:150}},{field:"createTime",label:"日志时间",defaultValue:void 0,form:{colProps:d,componentProps:{allowClear:!1,placeholder:["开始时间","结束时间"],format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD",showTime:!1},component:"RangePicker",rules:[{required:!0,message:"请选择日志时间！"}]},table:{width:150}}]},T=["createTime"],C=["description","userId","remark"],V=["description","remark","username","createTime"],k=["description","userId","username","remark","createTime"],P=new Map(T.map((e,t)=>[e,t])),D=u.properties.filter(e=>T.includes(e.field)).map(a=>{var{field:e,label:t,form:n}=a,s=g(n,[]);return b(c({field:e,label:t,defaultValue:void 0},s),{required:!1,rules:[{required:!1}]})}).sort((e,t)=>{const s=P.get(e.field),a=P.get(t.field);return s-a}),F=new Map(C.map((e,t)=>[e,t]));u.properties.filter(e=>C.includes(e.field)).map(({field:e,label:t,defaultValue:s,form:a})=>b(c({field:e,label:t,defaultValue:s},a),{colProps:ee})).sort((e,t)=>{const s=F.get(e.field),a=F.get(t.field);return s-a});const B=new Map(V.map((e,t)=>[e,t])),te=u.properties.filter(e=>V.includes(e.field)).map(({field:e,label:t,table:s})=>c({dataIndex:e,title:t},s)).sort((e,t)=>{const s=B.get(e.dataIndex),a=B.get(t.dataIndex);return s-a}),S=new Map(k.map((e,t)=>[e,t]));u.properties.filter(e=>k.includes(e.field)).map(({field:e,label:t,table:s})=>c({dataIndex:e,title:t},s)).sort((e,t)=>{const s=S.get(e.dataIndex),a=S.get(t.dataIndex);return s-a});const se={class:"header"},ae=Z({__name:"index",setup(e){const[t]=O({api:a=>X(s(a)),columns:te,formConfig:{labelWidth:0,schemas:D,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:a=>a.id});G(()=>{WebViewService.setIsLoading(!1).then(()=>{})});const s=(a,n=!0)=>{const x=a,{pageNum:$,pageSize:q,field:y="id",order:A="descend"}=x,j=g(x,["pageNum","pageSize","field","order"]),r={pageNum:$,pageSize:q,orderByClause:`${y} ${A==="descend"?"desc":"asc"}`};return Object.keys(j).forEach(f=>{const i=D.find(p=>p.field===f),o=a[f],l=f;if(i){if(o!==void 0&&o!=="")if(i.component==="Input"){const p=n?"":"%";r[l]=`${p}${o.trim()}${p}`}else["Select","ApiSelect","ApiTreeSelect"].includes(i.component)?r[l]=L(o)?o.value:o:i.component==="RangePicker"?(r[`${l}From`]=I(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),r[`${l}To`]=I(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):i.component==="DatePicker"?r[l]=I(o).format(i.componentProps.format||"YYYY-MM-DD"):r[l]=o}else r[l]=o}),r};return(a,n)=>(J(),Q("div",null,[Y("div",se,[M(h(K),{size:"19",name:"list"}),n[0]||(n[0]=Y("div",{class:"title"},"日志列表",-1))]),M(h(z),{onRegister:h(t)},null,8,["onRegister"])]))}});const be=W(ae,[["__scopeId","data-v-75abe5ab"]]);export{be as default};
