import{o as l,c,a as M,d as L,q as n,V as j,B as A,r as w,g as t,e as r,f as p,x as V,ay as R,F as T,C as Z,j as x,h as S,E as b,W as q,aw as N,az as F,ak as O,al as W,_ as G}from "./index-f5e1fd05.js";import J from "./CaseInfoDialog-74ae9880.js";import{b as K,d as Q}from "./session-8b690360.js";import{u as _}from "./home-420faaf8.js";import"./login-bottom-ec7c87ff.js";const X={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none"},Y=M('<g stroke="#fff" stroke-linejoin="round" clip-path="url(#a)"><path d="M7 12.833A5.833 5.833 0 1 0 7 1.167a5.833 5.833 0 0 0 0 11.666Z"></path><path stroke-linecap="round" d="M7 4.667v4.666M4.667 7h4.666"></path></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h14v14H0z"></path></clipPath></defs>',2),ee=[Y];function se(d, h){return l(),c("svg",X,ee)}const ae={render:se},te={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},oe=M('<g stroke="#E80D0D" stroke-linejoin="round" stroke-width="1.5" clip-path="url(#a)"><path d="M3 3.333v11.334h10V3.333H3Z"></path><path stroke-linecap="round" d="M6.667 6.667V11M9.333 6.667V11M1.333 3.333h13.333"></path><path d="m5.333 3.333 1.096-2h3.163l1.074 2H5.333Z"></path></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"></path></clipPath></defs>',2),ne=[oe];function le(d, h){return l(),c("svg",te,ne)}const ce={render:le},de=""+new URL("../png/empty-1fd08c2b.png",import.meta.url).href,H= d=>(O("data-v-6d31a8fb"),d=d(),W(),d),ie={class:"CaseHistory"},re={class:"add"},he=H(()=>t("span",null,"新建对话",-1)),ue={key:0,class:"empty_content"},pe={class:"empty_main"},_e=["src"],fe=H(()=>t("span",null,"暂无历史对话~",-1)),ve={key:1,class:"content"},me={class:"case_list"},ge=["onClick"],ke={class:"case_bottom"},Ce={class:"del"},ye=L({__name:"CaseHistory",setup(d){const h=n(""),g=n(),o=n([]),f=n(""),i=n([]),v=n(!1),m=n(!1),E= e=>{e?o.value.forEach(s=>{s.checked=!0}):o.value.forEach(s=>{s.checked=!1}),m.value=!1},$=()=>(i.value=[],o.value.forEach(e=>{e.checked&&i.value.push(e.id)}),i.value.length),k=()=>{const e=$();v.value=e===o.value.length,m.value=e>0&&e<o.value.length},D=()=>{g.value.open()},C= e=>{f.value=e.id,_().changeSelectCaseInfo({sessionId:e.id,sessionName:e.sessionName,sessionState:e.sessionState})},z= e=>{u(),C(e)},u=async()=>{const e=await K({sessionName:h.value,pageNum:1,pageSize:99999});e.code===200&&(o.value=e.data.records,o.value.forEach(s=>{s.checked=!1}),k())},B=()=>{i.value.length===0?N("至少选择一条数据",{type:"error"}):F.confirm("删除将无法撤销，您确定要继续吗？","提示",{type:"warning"}).then(async()=>{i.value.forEach(s=>{s===_().selectCaseInfo.sessionId&&_().changeSelectCaseInfo({sessionName:"",sessionId:"",sessionState:1})}),(await Q(i.value)).code===200&&(u(),N("删除成功",{type:"success"}))}).catch(()=>{})};return j(()=>_().selectCaseInfo.sessionId, e=>{e||(f.value="")}),A(()=>{u()}),(e, s)=>{const P=w("el-input"),y=w("el-checkbox");return l(),c("div",ie,[t("div",re,[t("div",{class:"add_btn",onClick:D},[r(p(ae)),he])]),o.value.length===0?(l(),c("div",ue,[t("div",pe,[t("img",{src:p(de),alt:""},null,8,_e),fe])])):V("",!0),o.value.length>0?(l(),c("div",ve,[r(P,{class:"borderless-input",modelValue:h.value,"onUpdate:modelValue":s[0]||(s[0]= a=>h.value=a),onInput:u,style:{border:"none"},placeholder:"请输入案件信息","prefix-icon":p(R)},null,8,["modelValue","prefix-icon"]),t("div",me,[(l(!0),c(T,null,Z(o.value,(a, U)=>(l(),c("div",{class:"case_item",key:U},[r(y,{onChange:k,modelValue:a.checked,"onUpdate:modelValue": I=>a.checked=I,label:a.id,value:a.id},{default:x(()=>[S(b(" "))]),_:2},1032,["modelValue","onUpdate:modelValue","label","value"]),t("div",{class:q([[f.value===a.id?"actived":""],"name"]),onClick: I=>C(a)},b(a.sessionName),11,ge)]))),128))]),t("div",ke,[r(y,{modelValue:v.value,"onUpdate:modelValue":s[1]||(s[1]= a=>v.value=a),indeterminate:m.value,onChange:E},{default:x(()=>[S("全选")]),_:1},8,["modelValue","indeterminate"]),t("div",Ce,[r(p(ce)),t("span",{onClick:B},"删除")])])])):V("",!0),r(J,{onSave:z,ref_key:"CaseInfoDialogRef",ref:g},null,512)])}}});const be=G(ye,[["__scopeId","data-v-6d31a8fb"]]);export{be as default};
