Files
qhmes/deploy-qhmes/frontend/js/JSBCDemo-B8_hktJv.js
2026-05-15 11:34:12 +08:00

2 lines
2.6 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var w=(h,c,r)=>new Promise((o,l)=>{var p=t=>{try{u(r.next(t))}catch(d){l(d)}},m=t=>{try{u(r.throw(t))}catch(d){l(d)}},u=t=>t.done?o(t.value):Promise.resolve(t.value).then(p,m);u((r=r.apply(h,c)).next())});import{d as D,f as v,r as S,ah as k,aC as T,as as z,aF as V,k as B}from"./vue-vendor-C7Zq48Yl.js";import{f as g,bC as i,u as J}from"./index-BI6CMai0.js";import"./antd-vue-vendor-BPnV8VqP.js";import"./vxe-table-vendor-B88kchpX.js";const F=D({__name:"JSBCDemo",setup(h){const{createMessage:c}=J(),r=S({btn:["add","save","remove","clearSelection"]}),o=v(!1),l=S({current:1,pageSize:200,pageSizeOptions:["10","20","30","100","200"],total:0}),p=v([]),m=v([]),u=v([{key:"num",title:"序号",width:80,type:i.normal},{key:"ship_name",title:"船名",width:180,type:i.input},{key:"call",title:"呼叫",width:80,type:i.input},{key:"len",title:"",width:80,type:i.input},{key:"ton",title:"",width:120,defaultValue:233,type:i.input},{key:"payer",title:"付款方",width:120,defaultValue:"张三",type:i.input},{key:"count",title:"",width:40,type:i.normal},{key:"company",title:"公司",minWidth:180,type:i.input},{key:"trend",title:"动向",width:120,type:i.input}]);t();function t(){return w(this,null,function*(){o.value=!0,yield g.get({url:"/mock/vxe/getData",params:{pageNo:l.current,pageSize:l.pageSize}}).then(e=>{l.total=e.total,m.value=e.records,p.value=[]}).finally(()=>{o.value=!1})})}function d({$table:e,target:n}){e.validate().then(a=>{if(!a){let s=n.getTableData(),f=n.getNewData(),y=n.getDeleteData();o.value=!0,g.post({url:"/mock/vxe/immediateSaveAll",params:s}).then(()=>{c.success("保存成功!")}).finally(()=>{o.value=!1})}})}function _(e){let n=e.deleteRows.map(a=>a.id);o.value=!0,window.setTimeout(()=>{o.value=!1,c.success("删除成功"),e.confirmRemove()},1e3)}function b(e){let{$table:n,row:a,column:s}=e,f=s.property;n.isUpdateByRow(a,f)&&n.validate(a).then(y=>{if(!y){let x=c.loading(`正在保存"${s.title}"`,0);g.put({url:"/mock/vxe/immediateSaveRow",params:a}).then(N=>{c.success(`"${s.title}"保存成功`),n.reloadRow(a,null,f)}).finally(()=>{x()})}})}function C(e){l.current=e.current,l.pageSize=e.pageSize,t()}function R(e){p.value=e.selectedRows}return(e,n)=>{const a=k("JVxeTable"),s=k("a-card");return z(),T(s,{title:"即时保存示例",bordered:!1},{default:V(()=>[B(a,{toolbar:"",toolbarConfig:r,rowNumber:"",rowSelection:"",keepSource:"",asyncRemove:"",height:340,loading:o.value,columns:u.value,dataSource:m.value,pagination:l,onSave:d,onRemoved:_,onEditClosed:b,onPageChange:C,onSelectRowChange:R},null,8,["toolbarConfig","loading","columns","dataSource","pagination"])]),_:1})}}});export{F as default};