"use strict";var i=require("../common/vendor.js"),b=require("../api/common.js"),p=require("../api/index.js");require("../common/request.js");const d={data(){return{tabIndex:1,indication:"",belongBook:"",title:"",prescribeType:0,pageNum:1,pageSize:20,typeOptions:[],bookOptions:[],indicationOptions:[],tabs:[{name:"\u6309\u7C7B\u578B",id:"1"},{name:"\u6309\u75BE\u75C5",id:"2"},{name:"\u6309\u4E66\u7C4D",id:"3"}],keyword:"",dataList:[]}},onLoad(){this.getDictByKey("sys_famous_prescribe_type"),this.getDictByKey("sys_famous_prescribe_indication"),this.getDictByKey("sys_famous_prescribe_book")},methods:{scrolltolower(e){this.pageNum++,this.getFamousPrescribeList(),console.log(e)},typeClick(e){this.indication="",this.belongBook="",this.prescribeType=parseInt(e.dictValue),console.log(this.prescribeType),this.title=e.dictLabel,this.pageNum=1,this.getFamousPrescribeList()},bookClick(e){this.indication="",this.prescribeType=0,this.belongBook=e.dictLabel,this.title=e.dictLabel,this.pageNum=1,this.getFamousPrescribeList()},indicationClick(e){console.log(e),this.belongBook="",this.prescribeType=0,this.indication=e.dictLabel,this.title=e.dictLabel,this.pageNum=1,this.getFamousPrescribeList()},getDictByKey(e){var r={key:e};b.getDictByKey(r).then(o=>{o.code==200&&(e=="sys_famous_prescribe_type"&&(this.typeOptions=o.data,this.typeOptions!=null&&this.typeOptions.length>0&&this.typeClick(this.typeOptions[0])),e=="sys_famous_prescribe_indication"&&(this.indicationOptions=o.data),e=="sys_famous_prescribe_book"&&(this.bookOptions=o.data))},o=>{})},tabChange(e){this.tabIndex=e.id,this.getFamousPrescribeList()},doSearch(){this.pageNum=1,this.getFamousPrescribeList()},getFamousPrescribeList(){var e=this,r={indication:this.indication,belongBook:this.belongBook,prescribeType:this.prescribeType,keyword:this.keyword,pageNum:this.pageNum,pageSize:this.pageSize};p.getFamousPrescribeList(r).then(o=>{o.code==200?this.pageNum==1?e.dataList=o.data.list:e.dataList=e.dataList.concat(o.data.list):(i.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"}),e.dataList=[])})},showDetail(e){i.index.navigateTo({url:"./famousPrescribeDetails?id="+e.id})}}};Array||i.resolveComponent("u-tabs")();const h=()=>"../uni_modules/uview-plus/components/u-tabs/u-tabs.js";Math||h();function u(e,r,o,y,s,a){return i.e({a:i.o((...t)=>a.doSearch&&a.doSearch(...t)),b:s.keyword,c:i.o(t=>s.keyword=t.detail.value),d:i.o(a.tabChange),e:i.p({scrollable:!1,list:s.tabs,lineColor:"#C39A58"}),f:s.tabIndex==1},s.tabIndex==1?{g:i.f(s.typeOptions,(t,c,n)=>i.e({a:t.dictValue==s.prescribeType},t.dictValue==s.prescribeType?{}:{},{b:i.t(e.$parseText(t.dictLabel,4)),c:i.o(l=>a.typeClick(t)),d:i.n(t.dictValue==s.prescribeType?"item ellipsis active":"item ellipsis")}))}:{},{h:s.tabIndex==2},s.tabIndex==2?{i:i.f(s.indicationOptions,(t,c,n)=>i.e({a:t.dictLabel==s.indication},t.dictLabel==s.indication?{}:{},{b:i.t(e.$parseText(t.dictLabel,4)),c:i.o(l=>a.indicationClick(t)),d:i.n(t.dictLabel==s.indication?"item ellipsis active":"item ellipsis")}))}:{},{j:s.tabIndex==3},s.tabIndex==3?{k:i.f(s.bookOptions,(t,c,n)=>i.e({a:t.dictLabel==s.belongBook},t.dictLabel==s.belongBook?{}:{},{b:i.t(e.$parseText(t.dictLabel,4)),c:i.o(l=>a.bookClick(t)),d:i.n(t.dictLabel==s.belongBook?"item ellipsis active":"item ellipsis")}))}:{},{l:i.t(s.title),m:i.f(s.dataList,(t,c,n)=>({a:i.t(t.prescribeName),b:i.o(l=>a.showDetail(t))})),n:i.o((...t)=>a.scrolltolower&&a.scrolltolower(...t))})}var g=i._export_sfc(d,[["render",u],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/famousPrescribeList.vue"]]);wx.createPage(g);
