import{b as A,u as F,a as R,r as _,J as B,o as i,y as h,q as l,v as f,p as s,P as k,x as y,n,c as D,F as x,A as I,s as L,d0 as P,bM as v,c5 as S,c0 as U,k as H,j as J,m as O,l as T,bv as j}from"./index.8d733f79.js";import{s as G}from"./faultType.8bb3732b.js";const z={class:"content-wrap"},K={class:"dialog-footer"},Y={__name:"selectCaseHandleMode",setup(Q,{expose:b}){A();const g=F(),r=R(),d=_(!1),M=B.session.getJSON("enums").faultCaseDataHandleMode,o=_({handleMode:"add",remark:""}),V=()=>{d.value=!0},w=()=>{const e=P.service({lock:!0,background:"rgba(0, 0, 0, 0.7)"}),t=`${r.query.caseActiveName}Period`,u=`${r.query.caseActiveName}Remark`,c={id:r.query.caseId,[t]:v().periodData||[],[u]:o.value.remark,handleMode:o.value.handleMode};G(c).then(()=>{e.close(),v().clearCheckListAndPeriodData(),g.push({path:"/knowledgeBase/faultLib/edit",query:{id:r.query.caseId,caseActiveName:r.query.caseActiveName}})}).catch(()=>{e.close()})},C=()=>{d.value=!1},E=()=>{o.value={handleMode:"add",remark:""}};return b({showModal:V}),(e,t)=>{const u=S,c=U,m=H,q=J,N=O,p=T,$=j;return i(),h($,{title:e.$t("addCaseLib"),modelValue:n(d),"onUpdate:modelValue":t[2]||(t[2]=a=>L(d)?d.value=a:null),width:"500px","align-center":!0,onClosed:E,"append-to-body":""},{footer:l(()=>[f("div",K,[s(p,{onClick:C},{default:l(()=>[k(y(e.$t("cancel")),1)]),_:1}),s(p,{type:"primary",onClick:w},{default:l(()=>[k(y(e.$t("confirm")),1)]),_:1})])]),default:l(()=>[f("div",z,[s(N,{ref:"haveFormRef",model:n(o)},{default:l(()=>[s(m,{rules:[{required:!0}],label:e.$t("handleModeTit"),prop:"handleMode",style:{height:"auto"}},{default:l(()=>[s(c,{modelValue:n(o).handleMode,"onUpdate:modelValue":t[0]||(t[0]=a=>n(o).handleMode=a)},{default:l(()=>[(i(!0),D(x,null,I(n(M),a=>(i(),h(u,{key:a.key,value:a.key,label:a.desc},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),s(m,{label:e.$t("explain"),prop:"remark",style:{height:"auto","margin-bottom":"14px"}},{default:l(()=>[s(q,{modelValue:n(o).remark,"onUpdate:modelValue":t[1]||(t[1]=a=>n(o).remark=a),rows:2,type:"textarea",placeholder:e.$t("explainP"),maxlength:"2000","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1},8,["title","modelValue"])}}};export{Y as default};
