import{_ as w,h as g,bp as a}from"./index-CLZzJyTP.js";import{U as p,a2 as b,ad as m,af as c,k as s}from"./vue-vendor-CxLCUzY4.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";const S={name:"Template2",data(){return{table1:{loading:!1,pagination:{current:1,pageSize:200,pageSizeOptions:["10","20","30","100","200"],total:0},lastRow:null,selectedRows:[],dataSource:[],columns:[{key:"num",title:"序号",width:"80px"},{key:"ship_name",title:"船名",width:"180px",type:a.input},{key:"call",title:"呼叫",width:"80px",type:a.input},{key:"len",title:"长",width:"80px",type:a.input},{key:"ton",title:"吨",width:"120px",type:a.input},{key:"payer",title:"付款方",width:"120px",type:a.input},{key:"count",title:"数",width:"40px"},{key:"company",title:"公司",minWidth:"180px",type:a.input},{key:"trend",title:"动向",width:"120px",type:a.input}]},table2:{loading:!1,pagination:{current:1,pageSize:200,pageSizeOptions:["100","200"],total:0},selectedRows:[],dataSource:[],columns:[{key:"dd_num",title:"调度序号",width:"120px"},{key:"tug",title:"拖轮",width:"180px",type:a.input},{key:"work_start_time",title:"作业开始时间",width:"180px",type:a.input},{key:"work_stop_time",title:"作业结束时间",width:"180px",type:a.input},{key:"type",title:"船舶分类",width:"120px",type:a.input},{key:"port_area",title:"所属港区",width:"120px",type:a.input}]},url:{getData:"/mock/vxe/getData"}}},watch:{"table1.lastRow"(){this.loadTable2Data()}},created(){this.loadTable1Data()},methods:{loadTable1Data(){let e={pageNo:this.table1.pagination.current,pageSize:this.table1.pagination.pageSize};this.table1.loading=!0,g.get({url:this.url.getData,params:e}).then(l=>{this.table1.pagination.total=l.total,this.table1.dataSource=l.records,this.table1.selectedRows=[]}).finally(()=>{this.table1.loading=!1})},loadTable2Data(){let e=this.table1.selectedRows;if(!e||e.length===0){this.table2.pagination.total=0,this.table2.dataSource=[],this.table2.selectedRows=[];return}else this.table1.lastRow==null&&(this.table1.lastRow=e[e.length-1]);let l={parentId:this.table1.lastRow.id,pageNo:this.table2.pagination.current,pageSize:this.table2.pagination.pageSize};this.table2.loading=!0,g.get({url:this.url.getData,params:l}).then(o=>{this.table2.pagination.total=o.total,this.table2.dataSource=o.records,this.table2.selectedRows=[]}).finally(()=>{this.table2.loading=!1})},handleTable1SelectRowChange(e){this.handleTableSelectRowChange(this.table1,e)},handleTable2SelectRowChange(e){this.table2.selectedRows=e.selectedRows},handleTable1PageChange(e){this.table1.pagination.current=e.current,this.table1.pagination.pageSize=e.pageSize,this.loadTable1Data()},handleTable2PageChange(e){this.table2.pagination.current=e.current,this.table2.pagination.pageSize=e.pageSize,this.loadTable2Data()},handleTableSelectRowChange(e,l){let{row:o,action:h,selectedRows:t,$table:i}=l,n=t[t.length-1];h==="selected"?e.lastRow=o:h==="selected-all"?t.length===0?e.lastRow=null:e.lastRow||(e.lastRow=n):h==="unselected"&&o===e.lastRow&&(e.lastRow=n),i.setCurrentRow(e.lastRow),e.selectedRows=t}}};function R(e,l,o,h,t,i){const n=p("JVxeTable"),r=p("a-col"),d=p("a-row"),u=p("a-card");return b(),m(u,{bordered:!1},{default:c(()=>[s(d,{gutter:8},{default:c(()=>[s(r,{span:12},{default:c(()=>[s(n,{toolbar:"",rowNumber:"",rowSelection:"",clickSelectRow:"",highlightCurrentRow:"",radioConfig:{highlight:!1},checkboxConfig:{highlight:!1},height:790,loading:t.table1.loading,columns:t.table1.columns,dataSource:t.table1.dataSource,pagination:t.table1.pagination,onPageChange:i.handleTable1PageChange,onSelectRowChange:i.handleTable1SelectRowChange},null,8,["loading","columns","dataSource","pagination","onPageChange","onSelectRowChange"])]),_:1}),s(r,{span:12},{default:c(()=>[s(n,{rowNumber:"",height:375,columns:t.table1.columns,dataSource:t.table1.selectedRows,style:{margin:"52px 0 8px"}},null,8,["columns","dataSource"]),s(n,{toolbar:"",rowNumber:"",rowSelection:"",clickSelectRow:"",height:355,loading:t.table2.loading,columns:t.table2.columns,dataSource:t.table2.dataSource,pagination:t.table2.pagination,onPageChange:i.handleTable2PageChange,onSelectRowChange:i.handleTable2SelectRowChange},null,8,["loading","columns","dataSource","pagination","onPageChange","onSelectRowChange"])]),_:1})]),_:1})]),_:1})}const k=w(S,[["render",R]]);export{k as default};
