"use strict";var e=require("../common/vendor.js"),i=require("../api/common.js"),t=require("../api/index.js");require("../common/request.js");const s={data:()=>({tabIndex:1,indication:"",belongBook:"",title:"",prescribeType:0,pageNum:1,pageSize:20,typeOptions:[],bookOptions:[],indicationOptions:[],tabs:[{name:"按类型",id:"1"},{name:"按疾病",id:"2"},{name:"按书籍",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 t={key:e};i.getDictByKey(t).then((i=>{200==i.code&&("sys_famous_prescribe_type"==e&&(this.typeOptions=i.data,null!=this.typeOptions&&this.typeOptions.length>0&&this.typeClick(this.typeOptions[0])),"sys_famous_prescribe_indication"==e&&(this.indicationOptions=i.data),"sys_famous_prescribe_book"==e&&(this.bookOptions=i.data))}),(e=>{}))},tabChange(e){this.tabIndex=e.id,this.getFamousPrescribeList()},doSearch(){this.pageNum=1,this.getFamousPrescribeList()},getFamousPrescribeList(){var i=this,s={indication:this.indication,belongBook:this.belongBook,prescribeType:this.prescribeType,keyword:this.keyword,pageNum:this.pageNum,pageSize:this.pageSize};t.getFamousPrescribeList(s).then((t=>{200==t.code?1==this.pageNum?i.dataList=t.data.list:i.dataList=i.dataList.concat(t.data.list):(e.index.showToast({icon:"none",title:"请求失败"}),i.dataList=[])}))},showDetail(i){e.index.navigateTo({url:"./famousPrescribeDetails?id="+i.id})}}};if(!Array){e.resolveComponent("u-tabs")()}Math;var o=e._export_sfc(s,[["render",function(i,t,s,o,a,c){return e.e({a:e.o(((...e)=>c.doSearch&&c.doSearch(...e))),b:a.keyword,c:e.o((e=>a.keyword=e.detail.value)),d:e.o(c.tabChange),e:e.p({scrollable:!1,list:a.tabs,lineColor:"#C39A58"}),f:1==a.tabIndex},1==a.tabIndex?{g:e.f(a.typeOptions,((t,s,o)=>e.e({a:t.dictValue==a.prescribeType},(t.dictValue,a.prescribeType,{}),{b:e.t(i.$parseText(t.dictLabel,4)),c:e.o((e=>c.typeClick(t))),d:e.n(t.dictValue==a.prescribeType?"item ellipsis active":"item ellipsis")})))}:{},{h:2==a.tabIndex},2==a.tabIndex?{i:e.f(a.indicationOptions,((t,s,o)=>e.e({a:t.dictLabel==a.indication},(t.dictLabel,a.indication,{}),{b:e.t(i.$parseText(t.dictLabel,4)),c:e.o((e=>c.indicationClick(t))),d:e.n(t.dictLabel==a.indication?"item ellipsis active":"item ellipsis")})))}:{},{j:3==a.tabIndex},3==a.tabIndex?{k:e.f(a.bookOptions,((t,s,o)=>e.e({a:t.dictLabel==a.belongBook},(t.dictLabel,a.belongBook,{}),{b:e.t(i.$parseText(t.dictLabel,4)),c:e.o((e=>c.bookClick(t))),d:e.n(t.dictLabel==a.belongBook?"item ellipsis active":"item ellipsis")})))}:{},{l:e.t(a.title),m:e.f(a.dataList,((i,t,s)=>({a:e.t(i.prescribeName),b:e.o((e=>c.showDetail(i)))}))),n:e.o(((...e)=>c.scrolltolower&&c.scrolltolower(...e)))})}]]);wx.createPage(o);
