"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5714],{75087:function(x,D,e){e.r(D);var f=e(25359),t=e.n(f),j=e(57213),v=e.n(j),C=e(49811),m=e.n(C),b=e(54306),A=e.n(b),P=e(93236),I=e(50336),d=e(40882),c=e(61786),i=e(72226),R=e(52586),U=e(23674),B=e(48182),F=e(87533),M=e(90627),_=e(62086),p=M.Z.DeviceStoreController,T=p.deviceStoreCreate,y=p.deviceStoreUpdate,K=p.deviceStoreItem,Z=M.Z.UserController.userItems;D.default=function(){var L=(0,U.useParams)(),$=(0,P.useRef)(),E={id:"",name:"",addr:"",device_num:0,power:"",p_price:"",lon:"",lat:"",dian_price:"",fee:"",note:"",location:null},W=(0,P.useState)(E),O=A()(W,2),g=O[0],h=O[1],G=function(){var l=m()(t()().mark(function r(s){var u,o;return t()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return h(s),n.next=3,T(v()({},s));case 3:u=n.sent,o=u.success,o&&(h(E),history.back());case 6:case"end":return n.stop()}},r)}));return function(s){return l.apply(this,arguments)}}(),S=function(){var l=m()(t()().mark(function r(s){var u,o;return t()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,y(v()({},s));case 2:u=n.sent,o=u.success,o&&(h(E),history.back());case 5:case"end":return n.stop()}},r)}));return function(s){return l.apply(this,arguments)}}();return(0,_.jsx)(I._z,{header:{title:"\u95E8\u5E97\u7F16\u8F91"},ghost:!0,children:(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(d.A,{initialValues:g,request:m()(t()().mark(function l(){var r,s,u;return t()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,K(L);case 2:if(r=a.sent,s=r.data,u=r.success,!u){a.next=7;break}return a.abrupt("return",s);case 7:case"end":return a.stop()}},l)})),onFinish:function(r){S(r)},children:[(0,_.jsx)(c.Z,{hidden:!0,width:"md",name:"id"}),(0,_.jsxs)(d.A.Group,{children:[(0,_.jsx)(c.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"name",label:"\u95E8\u5E97\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165"}),(0,_.jsx)(c.Z,{width:"md",name:"p_price",label:"\u505C\u8F66\u8D39",placeholder:"\u8BF7\u8F93\u5165"})]}),(0,_.jsxs)(d.A.Group,{children:[(0,_.jsx)(i.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],fieldProps:{prefix:"\uFFE5"},label:"\u7535\u8D39/\u5EA6",name:"dian_price"}),(0,_.jsx)(i.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],fieldProps:{prefix:"\uFFE5"},label:"\u670D\u52A1\u8D39/\u5EA6",name:"fee"})]}),(0,_.jsxs)(d.A.Group,{children:[(0,_.jsx)(i.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],fieldProps:{precision:0},label:"\u751F\u6210\u5145\u7535\u6869",name:"device_num",min:0}),(0,_.jsx)(i.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],fieldProps:{precision:0},label:"\u6700\u5FEB\u5145\u7535 KM",name:"power",min:1})]}),(0,_.jsx)(R.Z,{name:"note",label:"\u5907\u6CE8",placeholder:"\u5907\u6CE8"}),(0,_.jsx)(d.A.Item,{style:{width:"100%"},rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"location",label:"\u5730\u5740",placeholder:"\u8BF7\u8F93\u5165",children:(0,_.jsx)(B.Z,{})})]})})})}}}]);
