import{E as k,o as $,p as j,q as H,P as J,c as A,I as G,b as K,v as Q}from"./element-plus-53a783a7.js";import"./vue-20eed888.js";import{u as X}from"./vue-i18n-d6e8419a.js";import{y as Z}from"./request-6d47a533.js";/* empty css */import{d as ee,r as h,k as m,ah as te,f as le,ai as ae,o as f,c as g,e as r,P as s,a as o,F as P,a8 as S,b as V,U as T}from"./@vue-e95c845e.js";import{_ as re}from"./y9plugin-components-412bad23.js";import"./lodash-es-2e98bc53.js";import"./@vueuse-409d7ed5.js";import"./@element-plus-57b52633.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-e13f206c.js";import"./axios-db0ed51e.js";import"./async-validator-20f92749.js";import"./memoize-one-297ddbcb.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-606f2ab9.js";import"./@intlify-d4a3a758.js";import"./index-03a63030.js";import"./lodash-11751b8b.js";import"./pinia-22d008e7.js";import"./nprogress-e9cc33fd.js";import"./vue-router-e03c3082.js";/* empty css *//* empty css *//* empty css */import"./y9plugin-sso-6f4b3ca3.js";import"./y9plugin-watermark-e18d3181.js";import"./v-viewer-decd5d79.js";import"./viewerjs-c43574b2.js";import"./vxe-table-3ccf2bcd.js";import"./xe-utils-90392958.js";import"./dom-zindex-d72a3c32.js";const C=Z(),oe=async()=>await C({url:"/api/rest/statistics/logMonitoring/options",method:"GET",cType:!1}),se=async N=>await C({url:"/api/rest/statistics/logMonitoring",method:"POST",JSON:!0,cType:!1,data:N}),ie={class:"log-monitoring",style:{height:"100%","overflow-y":"auto","overflow-x":"hidden","scrollbar-width":"none"}},ne={class:"form-row"},ue={class:"form-item"},me={class:"form-item"},de={class:"form-item"},pe={class:"form-item"},ce={class:"form-item"},fe={class:"form-row"},ve={class:"form-item"},ge={class:"form-item"},ye={class:"form-item"},_e={class:"form-item"},be={class:"form-item"},he={class:"form-row"},Pe={class:"form-item"},Se={class:"form-item time-range-item"},Ve={class:"form-item button-col"},ke={class:"button-group"},Ne=ee({__name:"logMonitoringIndex",setup(N){const{t:n}=X(),t=h({interfaceType:"",deptSystem:[],deptSystemMap:{},limitResult:"",authentic:"",isLimit:"",responseMsg:"",apiName:"",userName:"",serverIP:"",requestIP:"",requestUserName:"",timeRange:[]}),v=h({interfaceType:[],limitResult:[],authentic:[],isLimit:[],responseMsg:[]}),I=h([]),u=e=>e===null||e==="null"?"":e,R=[{type:"index",title:m(()=>n("序号")),width:70,fixed:"left"},{title:m(()=>n("请求方法")),key:"interfaceType",sortable:!0,minWidth:120,render:e=>u(e.interfaceType)},{title:m(()=>n("接口名称")),key:"apiName",sortable:!0,minWidth:160,render:e=>u(e.apiName)},{title:m(()=>n("接口负责人")),key:"userName",sortable:!0,minWidth:120,render:e=>u(e.userName)},{title:m(()=>n("部门名称")),key:"deptName",sortable:!0,minWidth:150,render:e=>u(e.deptName)},{title:m(()=>n("调用系统")),key:"applySystemName",sortable:!0,minWidth:150,render:e=>u(e.applySystemName)},{title:m(()=>n("调用时间")),key:"requestStartTime",sortable:!0,minWidth:180,render:e=>u(e.requestStartTime)},{title:m(()=>n("响应状态")),key:"responseMsg",sortable:!0,width:120,render:e=>{let l="successText";return e.responseMsg=="成功"?l="successText":e.responseMsg=="失败"&&(l="stopText"),te("div",{class:l},n(u(e.responseMsg)))}},{title:m(()=>n("服务器IP")),key:"serverIP",sortable:!0,minWidth:140,render:e=>u(e.serverIP)},{title:m(()=>n("调用者IP")),key:"requestIP",sortable:!0,minWidth:140,render:e=>u(e.requestIP)},{title:m(()=>n("是否鉴权")),key:"authentic",sortable:!0,width:120,render:e=>u(e.authentic)=="1"?"是":"否"},{title:m(()=>n("是否限流")),key:"isLimit",sortable:!0,width:120,render:e=>u(e.isLimit)=="1"?"是":"否"},{title:m(()=>n("接口调用者")),key:"requestUserName",sortable:!0,width:120,render:e=>u(e.requestUserName)},{title:m(()=>n("限流结果")),key:"limitResult",sortable:!0,width:120,render:e=>u(e.limitResult)},{title:m(()=>n("限流等待时长(ms)")),key:"limitTime",sortable:!0,width:165,render:e=>u(e.limitTime)},{title:m(()=>n("限流规则")),key:"rule",sortable:!0,minWidth:150,render:e=>u(e.rule)==null?"":u(e.rule)+" 次/每秒"},{title:m(()=>n("请求参数")),key:"requestParam",minWidth:150,render:e=>u(e.requestParam)}],d=h({headerBackground:!0,pageConfig:{background:!1,currentPage:1,pageSize:15,total:0,pageSizeOpts:[5,10,15,20,30,40,1e3]},columns:R,tableData:[]}),q=e=>{d.value.tableData=[],d.value.pageConfig.pageSize=e,y()},w=e=>{d.value.tableData=[],d.value.pageConfig.currentPage=e,y()},y=async()=>{d.value.loading=!0;try{const e={};t.value.deptSystemMap&&Object.entries(t.value.deptSystemMap).forEach(([i,_])=>{e[i]=_});let l="";if(t.value.timeRange&&t.value.timeRange.length===2){const[i,_]=t.value.timeRange;l=`${i}~${_}`}const p={interfaceType:t.value.interfaceType,deptSystem:e,limitResult:t.value.limitResult,authentic:t.value.authentic,isLimit:t.value.isLimit,responseMsg:t.value.responseMsg,apiName:t.value.apiName,userName:t.value.userName,serverIP:t.value.serverIP,requestIP:t.value.requestIP,requestUserName:t.value.requestUserName,requestStartTime:l,page:d.value.pageConfig.currentPage,pageSize:d.value.pageConfig.pageSize},c=await se(p);c.code==="0"?(d.value.tableData=c.data||[],d.value.pageConfig.total=c.count||0):k.error("获取日志监控数据失败")}catch(e){console.error("获取日志监控数据失败:",e),k.error("获取日志监控数据失败")}finally{d.value.loading=!1}},U=()=>{d.value.pageConfig.currentPage=1,d.value.pageConfig.pageSize=15,d.value.tableData=[],y()},D=e=>{v.value={interfaceType:e.interfaceType||[],limitResult:e.limitResult||[],authentic:e.authentic||[],isLimit:e.isLimit||[],responseMsg:e.responseMsg||[]},I.value=e.deptName||{}},x=async()=>{try{const e=await oe();e.code==="0"?D(e.data):k.error("获取检索条件数据失败")}catch(e){console.error("获取检索条件数据失败:",e)}};le(async()=>{await x(),U()});const E=()=>{d.value.pageConfig.currentPage=1,y()},L=()=>{t.value={interfaceType:"",deptSystem:[],deptSystemMap:{},limitResult:"",authentic:"",isLimit:"",responseMsg:"",apiName:"",userName:"",serverIP:"",requestIP:"",requestUserName:"",timeRange:[]},d.value.pageConfig.currentPage=1,y()},O=h({showBorder:!0,borderRadio:"4px"}),W=e=>{if(!e||e.length===0){t.value.deptSystem=[],t.value.deptSystemMap={};return}const l={};e.forEach(p=>{if(p.length>0){const c=p[0],i=p.length>1?p[1]:null;l[c]||(l[c]=new Set),i&&l[c].add(i)}}),Object.keys(l).forEach(p=>{l[p]=Array.from(l[p])}),t.value.deptSystemMap=l,t.value.deptSystem=e},z=e=>e.getTime()>Date.now();return(e,l)=>{const p=$,c=j,i=H,_=J,b=A,B=G,M=K,F=Q,Y=ae("y9Table");return f(),g("div",ie,[r(F,{model:t.value,ref:"searchFormRef",class:"search-form"},{default:s(()=>[o("div",ne,[o("div",ue,[r(i,{label:"请求方法"},{default:s(()=>[r(c,{modelValue:t.value.interfaceType,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value.interfaceType=a),placeholder:"请选择请求方法",clearable:""},{default:s(()=>[(f(!0),g(P,null,S(v.value.interfaceType,a=>(f(),V(p,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),o("div",me,[r(i,{label:"部门/系统"},{default:s(()=>[r(_,{modelValue:t.value.deptSystem,"onUpdate:modelValue":l[1]||(l[1]=a=>t.value.deptSystem=a),options:I.value,props:{expandTrigger:"hover",value:"value",label:"label",children:"children",multiple:!0,checkStrictly:!1},placeholder:"请选择部门/系统",clearable:"","collapse-tags":"","collapse-tags-tooltip":"","max-collapse-tags":1,onChange:W,class:"custom-cascader"},null,8,["modelValue","options"])]),_:1})]),o("div",de,[r(i,{label:"限流结果"},{default:s(()=>[r(c,{modelValue:t.value.limitResult,"onUpdate:modelValue":l[2]||(l[2]=a=>t.value.limitResult=a),placeholder:"请选择限流结果",clearable:""},{default:s(()=>[(f(!0),g(P,null,S(v.value.limitResult,a=>(f(),V(p,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),o("div",pe,[r(i,{label:"是否鉴权"},{default:s(()=>[r(c,{modelValue:t.value.authentic,"onUpdate:modelValue":l[3]||(l[3]=a=>t.value.authentic=a),placeholder:"请选择是否鉴权",clearable:""},{default:s(()=>[(f(!0),g(P,null,S(v.value.authentic,a=>(f(),V(p,{key:a,label:a==="1"?"是":"否",value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),o("div",ce,[r(i,{label:"是否限流"},{default:s(()=>[r(c,{modelValue:t.value.isLimit,"onUpdate:modelValue":l[4]||(l[4]=a=>t.value.isLimit=a),placeholder:"请选择是否限流",clearable:""},{default:s(()=>[(f(!0),g(P,null,S(v.value.isLimit,a=>(f(),V(p,{key:a,label:a==="1"?"是":"否",value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})])]),o("div",fe,[o("div",ve,[r(i,{label:"响应状态"},{default:s(()=>[r(c,{modelValue:t.value.responseMsg,"onUpdate:modelValue":l[5]||(l[5]=a=>t.value.responseMsg=a),placeholder:"请选择响应状态",clearable:""},{default:s(()=>[(f(!0),g(P,null,S(v.value.responseMsg,a=>(f(),V(p,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),o("div",ge,[r(i,{label:"接口调用者"},{default:s(()=>[r(b,{modelValue:t.value.requestUserName,"onUpdate:modelValue":l[6]||(l[6]=a=>t.value.requestUserName=a),placeholder:"请输入调用者名称",clearable:""},null,8,["modelValue"])]),_:1})]),o("div",ye,[r(i,{label:"接口负责人"},{default:s(()=>[r(b,{modelValue:t.value.userName,"onUpdate:modelValue":l[7]||(l[7]=a=>t.value.userName=a),placeholder:"请输入负责人名称",clearable:""},null,8,["modelValue"])]),_:1})]),o("div",_e,[r(i,{label:"服务器IP"},{default:s(()=>[r(b,{modelValue:t.value.serverIP,"onUpdate:modelValue":l[8]||(l[8]=a=>t.value.serverIP=a),placeholder:"请输入服务器IP",clearable:""},null,8,["modelValue"])]),_:1})]),o("div",be,[r(i,{label:"调者IP"},{default:s(()=>[r(b,{modelValue:t.value.requestIP,"onUpdate:modelValue":l[9]||(l[9]=a=>t.value.requestIP=a),placeholder:"请输入调用者IP",clearable:""},null,8,["modelValue"])]),_:1})])]),o("div",he,[o("div",Pe,[r(i,{label:"接口名称"},{default:s(()=>[r(b,{modelValue:t.value.apiName,"onUpdate:modelValue":l[10]||(l[10]=a=>t.value.apiName=a),placeholder:"请输入接口名称",clearable:""},null,8,["modelValue"])]),_:1})]),o("div",Se,[r(i,{label:"调用时间"},{default:s(()=>[r(B,{modelValue:t.value.timeRange,"onUpdate:modelValue":l[11]||(l[11]=a=>t.value.timeRange=a),type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"YYYY-MM-DD HH:mm:ss","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)],"disabled-date":z,clearable:""},null,8,["modelValue","default-time"])]),_:1})]),l[14]||(l[14]=o("div",{class:"form-item"},null,-1)),o("div",Ve,[o("div",ke,[r(M,{type:"primary",onClick:E},{default:s(()=>[l[12]||(l[12]=o("i",{class:"ri-search-line"},null,-1)),o("span",null,T(e.$t("查询")),1)]),_:1}),r(M,{onClick:L},{default:s(()=>[l[13]||(l[13]=o("i",{class:"ri-refresh-line"},null,-1)),o("span",null,T(e.$t("重置")),1)]),_:1})])])])]),_:1},8,["model"]),r(Y,{config:d.value,filterConfig:O.value,onOnCurrPageChange:w,ref:"filterRef",onOnPageSizeChange:q},null,8,["config","filterConfig"])])}}});const st=re(Ne,[["__scopeId","data-v-521383cb"],["__file","E:/workSpaceJDK11/y9-interface-platform/y9vue-interfacePlatform/src/views/interface/logMonitoringIndex.vue"]]);export{st as default};