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