import{_ as a,r as e,a as l,B as t,o,b as s,c as u,l as d,w as n,i as r,a7 as c,a8 as v,g as i,h as m,e as p,j as f,t as _,y as g,d as y,k as h,F as k,n as b}from"./index-q2k2ACYe.js";import{_ as j}from"./z-paging.ZutRQgGs.js";import{n as w}from"./navBarSearch.CYdUINiq.js";import{a as x}from"./api.DzVGbGbs.js";import{d as V}from"./dayjs.min.C73DX6gN.js";import{n as z}from"./navTo.BuQuWXQa.js";import"./headImg.D8PzAUux.js";import"./navbg.DtxIXihV.js";const C=a({__name:"myCollect",setup(a){const C=e(null),B=e(null),W=e([]),M=e(0);e("");const Y=e("");e(!0);const D=e(!1),U=e("肝胆相照临床病例库"),I=e(0),N=e(1),R=e("文章病例库"),$=e([{label:"收藏",value:0},{label:"浏览",value:1}]),q=e([{label:"文章病例库",value:1},{label:"视频病例库",value:2},{label:"病例交流",value:3}]);l({read_num:"",push_date:""}),t((a=>{a.keyWord&&(Y.value=a.keyWord)})),o((()=>{var a;null==(a=C.value)||a.refresh()}));const F=a=>{I.value=a,C.value.reload()},Q=a=>{N.value=a,R.value=q.value[a-1].label,C.value.reload()},S=a=>{D.value=!0,Y.value=a,C.value.reload()},T=(a,e)=>{const l={page:a,page_size:e};1==I.value?(async a=>{let e={keyword:Y.value,type:N.value};x.getMyRead({...e,...a}).then((a=>{C.value.complete(a.data.data.data),M.value=a.data.data.total})).catch((a=>{C.value.complete(!1)}))})(l):(a=>{let e={keyword:Y.value,type:N.value};x.getMyCollect({...e,...a}).then((a=>{C.value.complete(a.data.data.data),M.value=a.data.data.total})).catch((a=>{C.value.complete(!1)}))})(l)};return(a,e)=>{const l=b,t=r,o=s(u("up-dropdown-item"),c),x=s(u("up-dropdown"),v),A=s(u("up-icon"),i),E=s(u("z-paging"),j);return m(),d(t,{class:"u-page"},{default:n((()=>[p(E,{ref_key:"paging",ref:C,"inside-more":"","loading-more-no-more-text":"咱也是有底线的！","auto-show-back-to-top":!0,modelValue:W.value,"onUpdate:modelValue":e[2]||(e[2]=a=>W.value=a),onQuery:T},{top:n((()=>[p(w,{searchWord:Y.value,navName:U.value,onChangeWord:S},null,8,["searchWord","navName"]),D.value?(m(),d(t,{key:0,class:"detail"},{default:n((()=>[p(t,{class:"desc"},{default:n((()=>[f("检索到："),p(l,{class:"red"},{default:n((()=>[f(_(M.value)+"篇",1)])),_:1})])),_:1}),Y.value?(m(),d(t,{key:0,class:"desc"},{default:n((()=>[f("检索词："),p(l,{class:"red"},{default:n((()=>[f(_(Y.value),1)])),_:1})])),_:1})):g("",!0)])),_:1})):g("",!0),p(t,{class:"filterbox"},{default:n((()=>[p(x,{class:"u-dropdown",ref_key:"uDropdownRef",ref:B},{default:n((()=>[p(o,{modelValue:I.value,"onUpdate:modelValue":e[0]||(e[0]=a=>I.value=a),title:0==I.value?"收藏":"浏览",onChange:F,options:$.value},null,8,["modelValue","title","options"]),p(o,{modelValue:N.value,"onUpdate:modelValue":e[1]||(e[1]=a=>N.value=a),title:R.value,onChange:Q,options:q.value},null,8,["modelValue","title","options"])])),_:1},512)])),_:1})])),default:n((()=>[(m(!0),y(k,null,h(W.value,((a,e)=>(m(),d(t,{class:"item",onClick:e=>(a=>{console.log(I.value),console.log(a);let e="article";1==N.value?e="article":2==N.value?e="video":3==N.value&&(e="exchange"),z({url:`/pages/detail/detail?id=${a}&type=${e}`})})(a.data.id),key:a.collect_id},{default:n((()=>[p(t,{class:"title ellipsis-two-lines"},{default:n((()=>[f(_(a.data.title),1)])),_:2},1024),p(t,{class:"tagsbox"},{default:n((()=>[(m(!0),y(k,null,h(a.data.author,(a=>(m(),d(t,{class:"tag",key:a.author_id},{default:n((()=>[f(_(a.doctor_name),1)])),_:2},1024)))),128))])),_:2},1024),p(t,{class:"deal"},{default:n((()=>[p(t,{class:"left"},{default:n((()=>[p(t,{class:"eyebox"},{default:n((()=>[p(A,{name:"eye",color:"#6B7280",size:"28rpx"}),p(t,{class:"num"},{default:n((()=>[f(_(a.data.read_num),1)])),_:2},1024)])),_:2},1024),p(t,{class:"collect"},{default:n((()=>[p(A,{name:"heart",color:"#6B7280",size:"28rpx"}),p(t,{class:"num"},{default:n((()=>[f(_(a.data.collect_num),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),p(t,{class:"time"},{default:n((()=>[p(A,{name:"clock",color:"#6B7280",size:"28rpx"}),p(t,{class:"num"},{default:n((()=>{return[f(_((e=a.data.push_date,V(e).format("YYYY-MM-DD"))),1)];var e})),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1},8,["modelValue"])])),_:1})}}},[["__scopeId","data-v-4c4a83bf"]]);export{C as default};
