import{o as K,r as n,a as o,j as e,t as O}from"./react.e658030c.js";import{I as X,e as S,h as m,b as h}from"./zarm.5a521378.js";import{s}from"./RoomDetail.module.64c05461.js";import{s as y}from"./index.5596e121.js";import{u as J,b as U}from"./index.52024c57.js";import"./Project.b97a5292.js";const $=X.createFromIconfont("//at.alicdn.com/t/font_3322051_slcyo8mabxe.js"),P=()=>{const{getRoomDetail:R,getRoomTags:q,getRoomRecords:E,getRoomMembers:N,getRoomChemicals:C,getRoomRiskSources:w,getSnapshotConfig:_}=y.RoomStore,f=J(),c=U().roomId,[l,I]=n.exports.useState(),[b,A]=n.exports.useState("3"),[r,j]=n.exports.useState({}),[g,F]=n.exports.useState([]),[v,B]=n.exports.useState(),[d,k]=n.exports.useState(),[p,T]=n.exports.useState();n.exports.useEffect(()=>{(async()=>{const t=await _();t!=null&&t.content&&I(t.content)})()},[]);const x=n.exports.useMemo(()=>{let t=[];try{t=JSON.parse(r.tags)}catch{}return t},[r]);n.exports.useEffect(()=>{!(l!=null&&l.project_id)||!c||(async()=>(T(await w({},{roomID:c})),k(await C({},{roomID:c})),B(await N({},{roomID:c})),j(await R({},{roomID:c})),F(await E({},{projectID:l==null?void 0:l.project_id,roomID:c}))))()},[l]);const M=t=>{f("/hidden-danger-detail/review",{state:{data:t,flag:0}})},D=()=>{f("/snapshot-form",{state:{projectId:l==null?void 0:l.project_id,room:r}})};return o("div",{className:s.body,children:[o("div",{className:s.info,children:[e("div",{className:s.title,children:(r==null?void 0:r.name)||"--"}),e("div",{className:s.tags,children:x&&x.length?x.map(t=>e(S,{style:{backgroundColor:t.styles.color?t.styles.color:"grey",marginRight:"5px"},shape:"radius",text:t.name},t.id)):e(S,{style:{backgroundColor:"grey",marginRight:"5px"},shape:"radius",text:"\u6682\u65E0\u6807\u7B7E"})}),e("div",{className:s.des,children:o("div",{children:["\u6240\u5C5E\u697C\u5B87\uFF1A",(r==null?void 0:r.campus)&&(r==null?void 0:r.building)?`${r==null?void 0:r.campus}-${r==null?void 0:r.building}`:"--"]})})]}),e("div",{className:s.other_info,children:o(m,{activeKey:b,animated:!0,onChange:t=>{A(t)},children:[e(m.Item,{title:"\u623F\u95F4\u6210\u5458",children:e(h,{title:e("div",{className:s.content,style:{overflowX:"scroll"},children:e("div",{className:s.user_list,children:v&&v.values.length?v.values.map((t,a)=>e("div",{className:s.user_item,children:t.map((u,i)=>i==1?e("span",{},+i):o("span",{children:[u,u.admin?e($,{type:"icon-user"}):null]},+i))},+a)):e("div",{style:{textAlign:"center",padding:"10px"},children:"\u6682\u65E0\u6570\u636E"})})})})},"0"),e(m.Item,{title:"\u5371\u5316\u54C1\u5B58\u91CF",children:e(h,{title:o("div",{className:s.content,style:{overflowX:"scroll"},children:[e("div",{className:s.des_title,style:{marginTop:"0px"},children:d&&d.columns.map((t,a)=>e("span",{style:{padding:"0px 10px",whiteSpace:"nowrap"},children:t},+a))}),e("div",{children:d&&d.values.length?d.values.map((t,a)=>e("div",{style:{display:"flex"},children:t.map((u,i)=>e("span",{style:{padding:"0px 10px",whiteSpace:"nowrap"},children:u},+i))},+a)):e("div",{style:{textAlign:"center",padding:"10px"},children:"\u6682\u65E0\u6570\u636E"})})]})})},"1"),e(m.Item,{title:"\u5371\u9669\u6E90\u5217\u8868",children:e(h,{title:o("div",{className:s.content,style:{overflowX:"scroll"},children:[e("div",{className:s.des_title,style:{marginTop:"0px"},children:p&&p.columns.map((t,a)=>e("span",{style:{padding:"0px 10px",whiteSpace:"nowrap"},children:t},+a))}),e("div",{children:p&&p.values.length?p.values.map((t,a)=>e("div",{style:{display:"flex"},children:t.map((u,i)=>e("span",{style:{padding:"0px 10px",whiteSpace:"nowrap"},children:u},+i))},+a)):e("div",{style:{textAlign:"center",padding:"10px"},children:"\u6682\u65E0\u6570\u636E"})})]})})},"2"),e(m.Item,{title:"\u5386\u53F2\u9690\u60A3\u8BB0\u5F55",children:g&&g.length?O(g).map((t,a)=>e(h,{className:s.list,onClick:()=>M(t),title:o("div",{className:s.content,children:[o("div",{children:["\u68C0\u67E5\u60C5\u51B5:\xA0",t.remark||"--"]}),o("div",{children:["\u6240\u5C5E\u9879\u76EE:\xA0",t.project_title||t.project_name||"--"]}),o("div",{children:["\u65F6\u95F4:\xA0",t.ctime||"--"]})]}),description:e("div",{className:s.seal,style:{color:y.Seal.RECORD_STATUS[t.reformStatus].color},children:e("div",{className:s.seal_son,children:e("div",{children:t.recordStatus==3?"\u4E0D\u9700\u8981\u6574\u6539":y.Seal.RECORD_STATUS[t.reformStatus].title})})})},+a)):e("div",{style:{width:"100%",textAlign:"center"},children:"\u6682\u65E0\u8BB0\u5F55"})},"3")]})}),e("div",{className:s.button_bar,children:e("div",{className:s.button_1,onClick:()=>D(),children:"\u4E0A\u62A5\u9690\u60A3"})})]})};var Y=K(P);export{Y as default};
