var h=(l,n,d)=>new Promise((f,m)=>{var F=r=>{try{t(d.next(r))}catch(p){m(p)}},w=r=>{try{t(d.throw(r))}catch(p){m(p)}},t=r=>r.done?f(r.value):Promise.resolve(r.value).then(F,w);t((d=d.apply(l,n)).next())});import{d as V,f as g,r as U,e as M,n as X,U as v,a2 as G,ad as J,af as o,k as s,ag as T,u as b}from"./vue-vendor-CxLCUzY4.js";import{h as x,u as O,c as z,_ as H}from"./index-CLZzJyTP.js";import{l as L}from"./JDictSelectTag-CfF54ALX.js";import{a5 as $}from"./antd-vue-vendor-CahNzUUa.js";import{J as q}from"./JFormContainer-DtOUXTy5.js";const{createConfirm:K}=O();const la="/agv/agvTask/exportXls",ra="/agv/agvTask/importExcel",na=l=>x.get({url:"/agv/agvTask/list",params:l}),da=(l,n)=>x.delete({url:"/agv/agvTask/delete",params:l},{joinParamsToUrl:!0}).then(()=>{n()}),ua=(l,n)=>{K({iconType:"warning",title:"确认删除",content:"是否删除选中数据",okText:"确认",cancelText:"取消",onOk:()=>x.delete({url:"/agv/agvTask/deleteBatch",data:l},{joinParamsToUrl:!0}).then(()=>{n()})})},Q=(l,n)=>{let d=n?"/agv/agvTask/edit":"/agv/agvTask/add";return x.post({url:d,params:l},{isTransformResponse:!1})},W=V({__name:"AgvTaskForm",props:{formDisabled:{type:Boolean,default:!1},formData:{type:Object,default:()=>({})},formBpm:{type:Boolean,default:!0}},emits:["register","ok"],setup(l,{expose:n,emit:d}){const f=l,m=g(),F=$.useForm,w=d,t=U({id:"",agvId:"",taskNo:"",taskStatus:void 0,taskTarget:""}),{createMessage:r}=O(),p=g({xs:{span:24},sm:{span:5}}),j=g({xs:{span:24},sm:{span:16}}),y=g(!1),B=U({}),{resetFields:I,validate:S,validateInfos:k}=F(t,B,{immediate:!1}),D=M(()=>f.formBpm===!0?f.formData.disabled!==!1:f.formDisabled);function N(){C({})}function C(c){X(()=>{I();const e={};Object.keys(t).forEach(a=>{c.hasOwnProperty(a)&&(e[a]=c[a])}),Object.assign(t,e)})}function P(){return h(this,null,function*(){try{yield S()}catch({errorFields:a}){if(a){const u=a[0];u&&m.value.scrollToField(u.name,{behavior:"smooth",block:"center"})}return Promise.reject(a)}y.value=!0;const c=g(!1);let e=t;e.id&&(c.value=!0);for(let a in e)e[a]instanceof Array&&z(m.value.getProps,a)==="string"&&(e[a]=e[a].join(","));yield Q(e,c.value).then(a=>{a.success?(r.success(a.message),w("ok")):r.warning(a.message)}).finally(()=>{y.value=!1})})}return n({add:N,edit:C,submitForm:P}),(c,e)=>{const a=v("a-input"),u=v("a-form-item"),_=v("a-col"),A=v("a-row"),E=v("a-form"),R=v("a-spin");return G(),J(R,{spinning:y.value},{default:o(()=>[s(q,{disabled:D.value},{detail:o(()=>[s(E,{ref_key:"formRef",ref:m,class:"antd-modal-form",labelCol:p.value,wrapperCol:j.value,name:"AgvTaskForm"},{default:o(()=>[s(A,null,{default:o(()=>[s(_,{span:24},{default:o(()=>[s(u,T({label:"AGV编号"},b(k).agvId,{id:"AgvTaskForm-agvId",name:"agvId"}),{default:o(()=>[s(a,{value:t.agvId,"onUpdate:value":e[0]||(e[0]=i=>t.agvId=i),placeholder:"请输入AGV编号","allow-clear":""},null,8,["value"])]),_:1},16)]),_:1}),s(_,{span:24},{default:o(()=>[s(u,T({label:"任务编号"},b(k).taskNo,{id:"AgvTaskForm-taskNo",name:"taskNo"}),{default:o(()=>[s(a,{value:t.taskNo,"onUpdate:value":e[1]||(e[1]=i=>t.taskNo=i),placeholder:"请输入任务编号","allow-clear":""},null,8,["value"])]),_:1},16)]),_:1}),s(_,{span:24},{default:o(()=>[s(u,T({label:"任务状态"},b(k).taskStatus,{id:"AgvTaskForm-taskStatus",name:"taskStatus"}),{default:o(()=>[s(L,{value:t.taskStatus,"onUpdate:value":e[2]||(e[2]=i=>t.taskStatus=i),dictCode:"agv_task_status",placeholder:"请选择任务状态","allow-clear":""},null,8,["value"])]),_:1},16)]),_:1}),s(_,{span:24},{default:o(()=>[s(u,T({label:"任务终点"},b(k).taskTarget,{id:"AgvTaskForm-taskTarget",name:"taskTarget"}),{default:o(()=>[s(a,{value:t.taskTarget,"onUpdate:value":e[3]||(e[3]=i=>t.taskTarget=i),placeholder:"请输入任务终点","allow-clear":""},null,8,["value"])]),_:1},16)]),_:1})]),_:1})]),_:1},8,["labelCol","wrapperCol"])]),_:1},8,["disabled"])]),_:1},8,["spinning"])}}}),Y=H(W,[["__scopeId","data-v-72ec25df"]]),ia=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"}));export{Y as A,la as a,ua as b,ia as c,da as d,ra as g,na as l};
