var b=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var Y=(s,i)=>{var c={};for(var e in s)y.call(s,e)&&i.indexOf(e)<0&&(c[e]=s[e]);if(s!=null&&b)for(var e of b(s))i.indexOf(e)<0&&B.call(s,e)&&(c[e]=s[e]);return c};import{j as P,k as M,m as j}from"./index.js";import{u as A,B as H}from"./useTable-f8594a7b.js";import{T as I}from"./useForm-322569b9.js";import{j as h}from"./antd-fb8ca017.js";import{r as O,s as F,c as K,a as w}from"./schema-8fcb7613.js";import{u as N}from"./index-922f0b14.js";import{_ as z}from"./drawer.vue_vue_type_script_setup_true_lang-0b583ee6.js";import{d as E,Z as D,_ as V,k as S,a5 as G,a4 as L,u as m,a8 as W}from"./vue-08ef39cb.js";import"./index-9a268806.js";import"./useWindowSizeFn-40274562.js";import"./onMountedOrActivated-4630d53b.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-bf4926ca.js";const ce=E({name:"LogPage",__name:"index",setup(s){P(),M();const[i,{openDrawer:c}]=N(),[e,{reload:g,setSelectedRowKeys:C}]=A({api:t=>F(x(t)),columns:K,formConfig:{labelWidth:120,schemas:w,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:t=>t.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),x=(t,d=!0)=>{const _=t,{pageNum:f,pageSize:u,field:$="id",order:k="descend"}=_,v=Y(_,["pageNum","pageSize","field","order"]),a={pageNum:f,pageSize:u,orderByClause:`${$} ${k==="descend"?"desc":"asc"}`};return Object.keys(v).forEach(p=>{const n=w.find(l=>l.field===p),o=t[p],r=p;if(n){if(o!==void 0&&o!=="")if(n.component==="Input"){const l=d?"":"%";a[r]=`${l}${o.trim()}${l}`}else["Select","ApiSelect","ApiTreeSelect"].includes(n.component)?a[r]=j(o)?o.value:o:n.component==="RangePicker"?(a[`${r}From`]=h(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),a[`${r}To`]=h(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):n.component==="DatePicker"?a[r]=h(o).format(n.componentProps.format||"YYYY-MM-DD"):a[r]=o}else a[r]=o}),a},R=t=>{O(t.id).then(d=>{g(),C([])})},T=()=>{g()};return(t,d)=>(D(),V("div",null,[S(m(H),{onRegister:m(e)},{bodyCell:G(({column:f,record:u})=>[f.dataIndex==="action"?(D(),L(m(I),{key:0,actions:[{label:"详情",icon:"ant-design:eye-outlined",divider:!0},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:R.bind(null,u),placement:"topRight"}}]},null,8,["actions"])):W("",!0)]),_:1},8,["onRegister"]),S(z,{onRegister:m(i),onSuccess:T},null,8,["onRegister"])]))}});export{ce as default};
