import{_ as a,r as e,a as l,z as t,b as s,c as o,l as d,w as r,T as u,U as n,i as c,f as i,h as p,e as _,d as m,k as h,F as v,j as f,t as g,u as y}from"./index-EvGXnWAc.js";import{_ as b}from"./z-paging.Bt-ikrKR.js";import{n as j}from"./navBarSearch.C961ERUC.js";import{a as k}from"./api.C18nFD5U.js";import{d as w}from"./dayjs.min.C73DX6gN.js";import{n as x}from"./navTo.BcQXR3vU.js";import{a as Y}from"./arrowright.BzSXc355.js";import"./headImg.D8PzAUux.js";import"./logo.Cf3Z9Qoj.js";const D=a({__name:"searchList",setup(a){const D=e(null),V=e(null),z=e([]),C=e(0);e("");const M=e("");e(!0);const $=e("doctor"),U=e("医生临床病例库"),W=e([{label:"正序",value:"asc"},{label:"倒序",value:"desc"}]),I=l({read_num:"",push_date:""});t((a=>{"hospital"==a.type&&($.value="hospital"),M.value=a.name,a.name&&(U.value=a.name+"临床病例库"),(a.name="医生")&&!a.id&&(M.value=""),"new"==a.order&&(I.push_date="asc"),"read"==a.order&&(I.read_num="desc")}));const N=a=>{D.value.reload()},T=(a,e)=>{const l={page:a,page_size:e};"hospital"==$.value?(async a=>{let e={hospital_name:M.value};I.read_num||delete I.read_num,I.push_date||delete I.push_date,(I.read_num||I.push_date)&&(e.order=I),k.searchHospital({...e,...a}).then((a=>{D.value.complete(a.data.data.data),C.value=a.data.data.total})).catch((a=>{D.value.complete(!1)}))})(l):(async a=>{let e={doctor_name:M.value};I.read_num||delete I.read_num,I.push_date||delete I.push_date,(I.read_num||I.push_date)&&(e.order=I),k.searchDoctor({...e,...a}).then((a=>{D.value.complete(a.data.data.data),C.value=a.data.data.total})).catch((a=>{D.value.complete(!1)}))})(l)},B=(a,e)=>{let l="";l="doctor"==$.value?`/pages/search/search?doctor_id=${a}&doctor_name=${e}`:`/pages/search/search?hospital_id=${a}&hospital_name=${e}`,x({url:l})},F=a=>{console.log(a),a&&(U.value=a+"临床病例库",M.value=a,z.value=[],I.read_num="",I.push_date="",D.value.reload())};return(a,e)=>{const l=s(o("up-dropdown-item"),u),t=s(o("up-dropdown"),n),k=c,x=s(o("up--image"),i),C=s(o("z-paging"),b);return p(),d(k,{class:"u-page"},{default:r((()=>[_(C,{ref_key:"paging",ref:D,"inside-more":"","loading-more-no-more-text":"咱也是有底线的！","auto-show-back-to-top":!0,modelValue:z.value,"onUpdate:modelValue":e[1]||(e[1]=a=>z.value=a),onQuery:T},{top:r((()=>[_(j,{searchWord:M.value,navName:U.value,type:$.value,onChangeWord:F},null,8,["searchWord","navName","type"]),_(k,{class:"filterbox"},{default:r((()=>[_(t,{class:"u-dropdown",ref_key:"uDropdownRef",ref:V},{default:r((()=>[_(l,{modelValue:I.push_date,"onUpdate:modelValue":e[0]||(e[0]=a=>I.push_date=a),title:"发布时间",onChange:N,options:W.value},null,8,["modelValue","options"])])),_:1},512)])),_:1})])),default:r((()=>[_(k,{class:"listbox"},{default:r((()=>[(p(!0),m(v,null,h(z.value,((a,e)=>(p(),d(k,{class:"item",key:e,onClick:e=>"hospital"==$.value?B(a.basic_hospital.hospital_id,a.basic_hospital.hospital_name):B(a.case_clinical_doctor.doctor_id,a.case_clinical_doctor.doctor_name)},{default:r((()=>["hospital"==$.value?(p(),d(k,{key:0,class:"title ellipsis"},{default:r((()=>[f(g(a.basic_hospital.hospital_name),1)])),_:2},1024)):(p(),d(k,{key:1,class:"title ellipsis"},{default:r((()=>[f(g(a.case_clinical_doctor.doctor_name)+"("+g(a.case_clinical_doctor.hospital_name)+")",1)])),_:2},1024)),_(k,{class:"tagsbox"},{default:r((()=>[(p(!0),m(v,null,h(a.author,(a=>(p(),d(k,{class:"tag",key:a.author_id},{default:r((()=>[f(g(a.doctor_name),1)])),_:2},1024)))),128))])),_:2},1024),_(k,{class:"deal"},{default:r((()=>[_(k,{class:"left"},{default:r((()=>[_(k,{class:"count"},{default:r((()=>[f(" 病例数："+g(a.video_num+a.article_num),1),_(x,{src:y(Y),width:"32rpx",height:"32rpx"},null,8,["src"])])),_:2},1024)])),_:2},1024),_(k,{class:"time"},{default:r((()=>[_(k,{class:"num"},{default:r((()=>{return[f("更新时间："+g((e=a.last_push_date,e?w(e).format("YYYY-MM-DD"):w().format("YYYY-MM-DD"))),1)];var e})),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1},8,["modelValue"])])),_:1})}}},[["__scopeId","data-v-3a59b837"]]);export{D as default};
