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