import{m as B}from"./setting-BD2OoeWh.js";import{d as P,r as _,a as $,o as T,f as q,i as l,w as r,t as J,p as c,v as h,h as n,m as b,y as a,k as y,l as S}from"./index-htML_UHV.js";const A={class:"inner-toolbar inner-toolbar2"},F=n("div",{class:"toolbar-btns"},null,-1),G={class:"logInfo"},M={class:"logInfo"},U={class:"logInfo"},W={class:"logInfo"},H={class:"logInfo"},K={class:"logInfo"},Q={class:"logInfo"},x=P({__name:"systemLog",setup(R){const w=J(),g=_(!1),t=$({page_no:1,page_size:10,company_id:w.state.companId}),d=_({});_("");const v=_(!1),s=_({}),u=$({});_(null);const z=e=>{t.page_size=e,m()},C=e=>{t.page_no=e,m()},k=e=>{Object.assign(t,{keyword:e}),Object.keys(u).forEach(o=>delete t[o]),t.page_no=1,m()},D=()=>{Object.assign(t,u),delete t.start_time,delete t.end_time,u.order_time_range&&(t.start_time=u.order_time_range[0]/1e3,t.end_time=u.order_time_range[1]/1e3),delete t.keyword,delete t.order_time_range,t.page_no=1,m()},m=()=>{g.value=!0;const e=JSON.parse(JSON.stringify(t));Object.keys(e).forEach(o=>{!e[o]&&e[o]!==0&&delete e[o]}),B(e).then(o=>{g.value=!1,d.value=o,t.page_no=o.page_no,t.page_size=o.page_size}).catch(()=>{g.value=!1})},I=e=>{v.value=!0,s.value=e},L=e=>!0,f=e=>new Date(e*1e3).toLocaleString();return T(()=>{m()}),(e,o)=>{const V=c("en-table-search"),p=c("el-table-column"),E=c("el-button"),N=c("el-pagination"),O=c("en-table-layout"),j=c("el-dialog");return h(),q("div",null,[l(O,{tableData:d.value.data,loading:g.value},{toolbar:r(()=>[n("div",A,[F,l(V,{onSearch:k,onAdvancedSearch:D,advanced:"",advancedWidth:"465",placeholder:e.$t("search_log")},null,8,["placeholder"])])]),"table-columns":r(()=>[l(p,{prop:"operator_name",label:e.$t("operator_name")},null,8,["label"]),l(p,{prop:"operate_detail",label:e.$t("operate_detail")},null,8,["label"]),l(p,{label:e.$t("operate_time"),align:"center"},{default:r(i=>[b(a(f(i.row.operate_time)),1)]),_:1},8,["label"]),l(p,{prop:"operate_ip",label:e.$t("operate_ip")},null,8,["label"]),l(p,{label:e.$t("operate_level"),align:"center"},{default:r(i=>[b(a(i.row.level==="important"?e.$t("operate_import"):e.$t("operate_same")),1)]),_:1},8,["label"]),l(p,{label:e.$t("operate")},{default:r(i=>[L(["systemLogs:detail"])?(h(),y(E,{key:0,size:"small",type:"primary",onClick:X=>I(i.row)},{default:r(()=>[b(a(e.$t("view")),1)]),_:2},1032,["onClick"])):S("",!0)]),_:1},8,["label"])]),pagination:r(()=>[d.value.data_total?(h(),y(N,{key:0,onSizeChange:z,onCurrentChange:C,"current-page":d.value.page_no,"page-sizes":[10,20,50,100],"page-size":d.value.page_size,layout:"total, sizes, prev, pager, next, jumper",total:d.value.data_total},null,8,["current-page","page-size","total"])):S("",!0)]),_:1},8,["tableData","loading"]),l(j,{title:e.$t("log_info"),modelValue:v.value,"onUpdate:modelValue":o[0]||(o[0]=i=>v.value=i),width:"40%",class:"!rounded-lg"},{default:r(()=>[n("div",G,a(e.$t("operator_name"))+"："+a(s.value.operator_name),1),n("div",M,a(e.$t("operate_detail"))+"："+a(s.value.operate_detail),1),n("div",U,a(e.$t("request_method"))+"："+a(s.value.method),1),n("div",W,a(e.$t("request_parameters"))+"："+a(s.value.params),1),n("div",H,a(e.$t("operate_ip"))+"："+a(s.value.operate_ip),1),n("div",K,a(e.$t("operate_level"))+"："+a(s.value.level==="important"?e.$t("operate_import"):e.$t("operate_same")),1),n("div",Q,a(e.$t("operate_time"))+"："+a(f(s.value.operate_time)),1)]),_:1},8,["title","modelValue"])])}}});export{x as default};
