"use strict";var e=require("../common/vendor.js"),t=require("../api/disease.js"),s=require("../api/department.js"),o=require("../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js");require("../common/request.js");const a={mixins:[o.MescrollMixin],data:()=>({depts:[],deptId:0,keyword:"",mescroll:null,downOption:{use:!0,auto:!1},upOption:{onScroll:!1,use:!0,page:{pae:0,size:10},noMoreSize:10,textNoMore:"已经到底了",empty:{icon:"https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png",tip:"暂无数据"}},dataList:[]}),onShow(){this.getDepartmentList()},methods:{doSearch(){this.mescroll.resetUpScroll()},getDepartmentList(){s.getDepartmentList({}).then((t=>{200==t.code?this.depts=t.data:e.index.showToast({icon:"none",title:"请求失败"})}),(e=>{}))},mescrollInit(e){this.mescroll=e},downCallback(e){e.resetUpScroll()},upCallback(s){var o=this,a={keyword:this.keyword,deptId:this.deptId,pageNum:s.num,pageSize:s.size};t.getDiseaseList(a).then((t=>{200==t.code?(1==s.num?o.dataList=t.data.list:o.dataList=o.dataList.concat(t.data.list),o.mescroll.endBySize(t.data.list.length,t.data.total)):(e.index.showToast({icon:"none",title:"请求失败"}),o.dataList=null,o.mescroll.endErr())}))},choseDept(e){this.deptId=e.deptId,this.mescroll.resetUpScroll()},showDetail(t){e.index.navigateTo({url:"./diseaseDetails?diseaseId="+t.diseaseId})}}};if(!Array){e.resolveComponent("mescroll-body")()}Math;var i=e._export_sfc(a,[["render",function(t,s,o,a,i,d){return{a:e.o(((...e)=>d.doSearch&&d.doSearch(...e))),b:i.keyword,c:e.o((e=>i.keyword=e.detail.value)),d:e.f(i.depts,((t,s,o)=>({a:e.t(t.deptName),b:s,c:e.n(i.deptId==t.deptId?"item active":"item"),d:e.o((e=>d.choseDept(t)),s)}))),e:e.f(i.dataList,((t,s,o)=>({a:e.t(t.diseaseName),b:s,c:e.o((e=>d.showDetail(t)),s)}))),f:e.sr("mescrollRef","460639ee-0"),g:e.o(d.mescrollInit),h:e.o(d.downCallback),i:e.o(d.upCallback),j:e.p({top:"192rpx",down:i.downOption,up:i.upOption})}}]]);wx.createPage(i);
