var I=(o,b,r)=>new Promise(($,g)=>{var c=d=>{try{u(r.next(d))}catch(m){g(m)}},h=d=>{try{u(r.throw(d))}catch(m){g(m)}},u=d=>d.done?$(d.value):Promise.resolve(d.value).then(c,h);u((r=r.apply(o,b)).next())});import{D as C,d as P,r as B,K as V,j as p,o as n,h as x,w as t,b as R,e as s,k as _,c as y,F as f,v as U,t as k,f as A,O as q,i as E,P as i}from"./index-90c78f99.js";import{u as L}from"./useCurrentInstance-cd4729ef.js";const ee=o=>C.post("/api/v1/app/hardwareIndex/list",o),K=o=>C.post("/api/v1/app/hardwareIndex/submit",o),ae=o=>C.get(`/api/v1/app/hardwareIndex/del?fileId=${o}`),T={class:"flex"},H={class:"ml-8"},J={class:"card-tit mb-16"},Q={key:1},W={class:"flex justify-center"},te=P({__name:"index-check-dialog",props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(o,{emit:b}){const r=o,{proxy:$}=L(),g=[{title:"硬件指标情况",infoField:[{label:"服务器品牌",prop:"serverBrand",key:"serverBrand"},{label:"服务器状态",prop:"serverStatus",key:"serverStatus"},{label:"交换机品牌",prop:"switchBrand",key:"switchBrand"},{label:"交换机状态",prop:"switchStatus",key:"switchStatus"},{label:"硬盘内存",prop:"diskMemory",key:"diskMemory",render:e=>i("span",`${e.diskMemory}GB`)},{label:"硬盘使用量",prop:"diskUsage",key:"diskUsage",render:e=>i("span",`${e.diskUsage}GB`)},{label:"硬盘数量",prop:"diskCount",key:"diskCount"},{label:"CPU",prop:"cpu",key:"cpu",render:e=>i("span",`${e.cpu}GB`)},{label:"内存",prop:"memory",key:"memory",render:e=>i("span",`${e.memory}GB`)},{label:"存储",prop:"storage",key:"storage",render:e=>i("span",`${e.storage}GB`)},{label:"系统&数据库",prop:"systemDatabase",key:"systemDatabase"},{label:"私网IP",prop:"privateIpAddress",key:"privateIpAddress"},{label:"云区",prop:"cloudRegion",key:"cloudRegion"},{label:"地区",prop:"region",key:"region"}]},{title:"使用情况",infoField:[{label:"CPU利用率",prop:"cpuUtilizationRate",key:"cpuUtilizationRate",render:e=>i("span",`${e.cpuUtilizationRate}%`)},{label:"内存利用率",prop:"memoryUtilizationRate",key:"memoryUtilizationRate",render:e=>i("span",`${e.memoryUtilizationRate}%`)},{label:"磁盘利用率",prop:"diskUtilizationRate",key:"diskUtilizationRate",render:e=>i("span",`${e.diskUtilizationRate}%`)},{label:"硬盘占用率",prop:"diskOccupancyRate",key:"diskOccupancyRate",render:e=>i("span",`${e.diskOccupancyRate}%`)},{label:"宽带使用率",prop:"bandwidthUtilizationRate",key:"bandwidthUtilizationRate",render:e=>i("span",`${e.bandwidthUtilizationRate}%`)}]}],c=B(),h=()=>{c.value=r.data&&r.data[Number(u.value)]||{}},u=B("0"),d=e=>{u.value=e,h()},m=B(!1),N=()=>I(this,null,function*(){m.value=!0,yield K({reqs:r.data}),$.$message.success("提交成功"),m.value=!1,b("close",!0)});return V(()=>r.visible,e=>{e&&h()}),(e,w)=>{const S=p("el-menu-item"),F=p("el-menu"),G=p("el-alert"),v=p("el-descriptions-item"),z=p("el-descriptions"),O=p("el-card"),D=p("el-button"),j=p("el-dialog");return n(),x(j,{"model-value":o.visible,title:"硬件指标核对",width:"772px","destroy-on-close":"",class:"scoreDetailDialog",onClose:w[1]||(w[1]=a=>b("close"))},{footer:t(()=>[R("div",W,[s(D,{type:"primary",loading:m.value,onClick:N},{default:t(()=>[_("提交")]),_:1},8,["loading"]),s(D,{onClick:w[0]||(w[0]=a=>b("close"))},{default:t(()=>[_("取消")]),_:1})])]),default:t(()=>[R("div",T,[s(F,{"default-active":u.value,class:"detail-menu",onSelect:d},{default:t(()=>[(n(!0),y(f,null,U(r.data,(a,l)=>(n(),x(S,{key:l,index:l+""},{default:t(()=>[_(k(a.ip),1)]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"]),R("div",H,[s(G,{title:"温馨提示：请核对完所有应用指标并确认无误后，再点击提交。",type:"warning","show-icon":"",style:{"margin-bottom":"8px"},closable:!1}),(n(!0),y(f,null,U(c.value.appInfos,(a,l)=>(n(),y("div",{key:l,class:"descriptions mb-8"},[s(z,{column:2},{default:t(()=>[s(v,{label:"应用名称："},{default:t(()=>[_(k(a.appName||"-"),1)]),_:2},1024),s(v,{label:"应用编码："},{default:t(()=>[_(k(a.appCode||"-"),1)]),_:2},1024),s(v,{label:"所属项目："},{default:t(()=>[_(k(a&&a.project||"-"),1)]),_:2},1024),s(v,{label:"建设部门："},{default:t(()=>[_(k(a.constructionDepartment||"-"),1)]),_:2},1024)]),_:2},1024)]))),128)),(n(),y(f,null,U(g,a=>s(O,{key:a&&a.title,class:"my-card mb-8 min-padding",shadow:"never"},{default:t(()=>[R("div",J,k(a&&a.title),1),s(z,{border:"",column:2},{default:t(()=>[(n(!0),y(f,null,U(a&&a.infoField,(l,M)=>(n(),y(f,{key:l.key},[l.hidden?E("",!0):(n(),x(v,{key:0,label:`${l.label}`,span:l.span||1},{default:t(()=>[l.render?(n(),x(A(q),{key:0,column:l,row:c.value,render:l.render,index:M},null,8,["column","row","render","index"])):(n(),y("span",Q,k(c.value&&c.value[l.key]),1))]),_:2},1032,["label","span"]))],64))),128))]),_:2},1024)]),_:2},1024)),64))])])]),_:1},8,["model-value"])}}});export{te as _,ae as d,ee as l};
