"use strict";var s=require("../common/vendor.js"),g=require("../api/common.js"),d=require("../api/index.js");require("../common/request.js");const h={data(){return{tabIndex:1,vessel:"",region:"",title:"",pageNum:1,pageSize:20,vesselOptions:[],regionOptions:[],tabs:[{name:"\u6309\u7ECF\u7EDC\u67E5\u8BE2",id:"1"},{name:"\u6309\u90E8\u4F4D\u67E5\u8BE2",id:"2"}],keyword:"",dataList:[]}},onLoad(){this.getDictByKey("sys_vessel"),this.getDictByKey("sys_vessel_region"),this.getVesselList()},methods:{scrolltolower(e){this.pageNum++,this.getVesselList(),console.log(e)},regionClick(e){this.vessel="",this.region=e.dictLabel,this.title=e.dictLabel,this.pageNum=1,this.getVesselList()},vesselClick(e){this.region="",this.vessel=e.dictLabel,this.title=e.dictLabel,this.pageNum=1,this.getVesselList()},getDictByKey(e){var o={key:e};g.getDictByKey(o).then(l=>{l.code==200&&(e=="sys_vessel"&&(this.vesselOptions=l.data),e=="sys_vessel_region"&&(this.regionOptions=l.data))},l=>{})},tabChange(e){this.tabIndex=e.id,this.getVesselList()},doSearch(){this.pageNum=1,this.getVesselList()},getVesselList(){var e=this,o={vessel:this.vessel,region:this.region,keyword:this.keyword,pageNum:this.pageNum,pageSize:this.pageSize};d.getVesselList(o).then(l=>{l.code==200?this.pageNum==1?e.dataList=l.data.list:e.dataList=e.dataList.concat(l.data.list):(s.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"}),e.dataList=[])})},showDetail(e){s.index.navigateTo({url:"./vesselDetails?id="+e.id})}}};Array||s.resolveComponent("u-tabs")();const v=()=>"../uni_modules/uview-plus/components/u-tabs/u-tabs.js";Math||v();function u(e,o,l,b,t,a){return s.e({a:s.o((...i)=>a.doSearch&&a.doSearch(...i)),b:t.keyword,c:s.o(i=>t.keyword=i.detail.value),d:s.o(a.tabChange),e:s.p({scrollable:!1,list:t.tabs,lineColor:"#C39A58"}),f:t.tabIndex==1},t.tabIndex==1?{g:s.f(t.vesselOptions,(i,r,n)=>s.e({a:i.dictValue==t.vessel},i.dictValue==t.vessel?{}:{},{b:s.t(e.$parseText(i.dictLabel,4)),c:s.o(c=>a.vesselClick(i)),d:s.n(i.dictValue==t.vessel?"item ellipsis active":"item ellipsis")}))}:{},{h:t.tabIndex==2},t.tabIndex==2?{i:s.f(t.regionOptions,(i,r,n)=>s.e({a:i.dictLabel==t.region},i.dictLabel==t.region?{}:{},{b:s.t(e.$parseText(i.dictLabel,4)),c:s.o(c=>a.regionClick(i)),d:s.n(i.dictLabel==t.region?"item ellipsis active":"item ellipsis")}))}:{},{j:s.t(t.title),k:s.f(t.dataList,(i,r,n)=>({a:s.t(i.vesselName),b:s.o(c=>a.showDetail(i))})),l:s.o((...i)=>a.scrolltolower&&a.scrolltolower(...i))})}var p=s._export_sfc(h,[["render",u],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/vesselList.vue"]]);wx.createPage(p);
