import{q as g,r as N}from"./index-oCd6JdpL.js";import{_ as S,r as u,o as L,b as s,c as l,d as T,e as c,f as V,w as n,g as w,q as _,x as B,y as i,F as C,n as E,i as p,t as M}from"./index-DjgxJhni.js";import"./request-B06qJ2Sm.js";const F={class:"LinePatrolMain"},q={class:"checkMain"},D={class:"settingUp"},U={class:"maintain"},G={__name:"Troubleshoot",props:["ExamId"],setup(m){const t=u([]),r=u([]),{ExamId:h}=m;let v=localStorage.getItem("rowStatus");L(()=>{I()});const d={ExamId:h,Type:"排故"},I=async()=>{const e=await g(d);r.value=e.data.ToolList,t.value=e.data.SelectToolList,t.value=e.data.ToolList.map(o=>{if(e.data.SelectToolList.includes(o.ToolId))return{ToolId:o.ToolId,ToolType:o.ToolType,ToolName:o.ToolName,ThreeToolId:o.ThreeToolId}}).filter(o=>o)},f=async()=>{console.log(t.value,"handleSave--");const e=await N({...d,Data:t.value});e.code===0?i({message:"操作成功.",type:"success"}):i.error((e==null?void 0:e.data)||"操作失敗")};return(e,o)=>{const b=s("el-checkbox"),k=s("el-checkbox-group"),x=s("el-button");return l(),T("div",F,[c("div",q,[V(k,{modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=a=>t.value=a)},{default:n(()=>[(l(!0),T(C,null,E(r.value,(a,y)=>(l(),_(b,{key:y,label:a.ToolId,value:{ToolId:a.ToolId,ToolType:a.ToolType,ToolName:a.ToolName,ThreeToolId:a.ThreeToolId}},{default:n(()=>[p(M(a.ToolName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),c("div",D,[c("div",U,[w(v)=="未发布"?(l(),_(x,{key:0,onClick:f},{default:n(()=>[p("保存")]),_:1})):B("",!0)])])])}}},A=S(G,[["__scopeId","data-v-96b0ecee"]]);export{A as default};