包含后厨 团餐 门店分支
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
26 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7657],{1966:function(st,V,l){"use strict";l.r(V),l.d(V,{default:function(){return Gt}});var $=l(71194),P=l(50146),E=l(58996),A=l(77933),U=l(62350),Y=l(24565),K=l(57663),k=l(71577),i=l(39428),lt=l(34792),T=l(48086),S=l(3182),D=l(2824),N=l(49101),w=l(67294),xe=l(28790),L=l(16894),Ve=l(49111),W=l(19650),b=l(48736),C=l(27049),I=l(43358),f=l(34041),M=l(9715),B=l(55843),qt=l(47673),z=l(4107),_=l(48971),R=l(96690);function ot(t){return ne.apply(this,arguments)}function ne(){return ne=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"/api/device/page",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),ne.apply(this,arguments)}function ct(){return ue.apply(this,arguments)}function ue(){return ue=(0,S.Z)((0,i.Z)().mark(function t(){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,_.WY)((0,R.w)()+"/api/product/list",{method:"Get"}));case 1:case"end":return u.stop()}},t)})),ue.apply(this,arguments)}function dt(t){return ie.apply(this,arguments)}function ie(){return ie=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"/api/device/add",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),ie.apply(this,arguments)}function er(t){return se.apply(this,arguments)}function se(){return se=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/PushDeviceGoods?DeviceId="+r,{method:"Get"}));case 1:case"end":return e.stop()}},t)})),se.apply(this,arguments)}function pt(t){return le.apply(this,arguments)}function le(){return le=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"/api/device/update",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),le.apply(this,arguments)}function tr(t){return oe.apply(this,arguments)}function oe(){return oe=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/CopyDevice",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),oe.apply(this,arguments)}function Ye(t){return ce.apply(this,arguments)}function ce(){return ce=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"\u200B\u200B/api/device/delete",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),ce.apply(this,arguments)}function ft(){return de.apply(this,arguments)}function de(){return de=(0,S.Z)((0,i.Z)().mark(function t(){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,_.WY)((0,R.w)()+"\u200B/api/device/getdevicetypelist",{method:"GET"}));case 1:case"end":return u.stop()}},t)})),de.apply(this,arguments)}function ht(t){return pe.apply(this,arguments)}function pe(){return pe=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"\u200B/api/device/adddevicetype",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),pe.apply(this,arguments)}function vt(){return fe.apply(this,arguments)}function fe(){return fe=(0,S.Z)((0,i.Z)().mark(function t(){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,_.WY)((0,R.w)()+"\u200B/api/devicevesion/getdevicevesionlist",{method:"GET"}));case 1:case"end":return u.stop()}},t)})),fe.apply(this,arguments)}function rr(t,r){return he.apply(this,arguments)}function he(){return he=_asyncToGenerator(_regeneratorRuntime().mark(function t(r,u){return _regeneratorRuntime().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.abrupt("return",request(getDataBaseUrl()+"/api/device/GetDeviceGoods",{method:"POST",data:_objectSpread({},r)}));case 1:case"end":return j.stop()}},t)})),he.apply(this,arguments)}function ar(t){return ve.apply(this,arguments)}function ve(){return ve=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/AddDeviceGood",{method:"POST",data:_objectSpread({},r)}));case 1:case"end":return e.stop()}},t)})),ve.apply(this,arguments)}function nr(t){return me.apply(this,arguments)}function me(){return me=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/\u200Bapi/device/GetGoods",{method:"POST",data:_objectSpread({},r)}));case 1:case"end":return e.stop()}},t)})),me.apply(this,arguments)}function ur(t){return ge.apply(this,arguments)}function ge(){return ge=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/\u200Bapi/device/GetByDeviceGoods",{method:"POST",data:_objectSpread({},r)}));case 1:case"end":return e.stop()}},t)})),ge.apply(this,arguments)}function ir(t){return ye.apply(this,arguments)}function ye(){return ye=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/GetDeviceStorePage",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),ye.apply(this,arguments)}function sr(t){return we.apply(this,arguments)}function we(){return we=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/DelStockAdjust?Id=".concat(r),{method:"DELETE"}));case 1:case"end":return e.stop()}},t)})),we.apply(this,arguments)}function lr(t){return Se.apply(this,arguments)}function Se(){return Se=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/AddUpdateDeviceStocAsync",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),Se.apply(this,arguments)}function or(t){return Ze.apply(this,arguments)}function Ze(){return Ze=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/AddUpdateDeviceStocAsync",{method:"put",data:r}));case 1:case"end":return e.stop()}},t)})),Ze.apply(this,arguments)}function cr(t){return De.apply(this,arguments)}function De(){return De=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/deviceconfig/getlocs?Code=".concat(r),{method:"GET"}));case 1:case"end":return e.stop()}},t)})),De.apply(this,arguments)}function dr(t){return be.apply(this,arguments)}function be(){return be=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/GetProductList",{method:"post",data:r}));case 1:case"end":return e.stop()}},t)})),be.apply(this,arguments)}function pr(t){return Te.apply(this,arguments)}function Te(){return Te=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/\u200Bapi/FoodMenu/tree",{data:_objectSpread({},r)}));case 1:case"end":return e.stop()}},t)})),Te.apply(this,arguments)}function fr(t){return Ge.apply(this,arguments)}function Ge(){return Ge=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/PushDevice?DeviceId=".concat(r),{method:"post"}));case 1:case"end":return e.stop()}},t)})),Ge.apply(this,arguments)}function hr(t){return Ce.apply(this,arguments)}function Ce(){return Ce=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(getDataBaseUrl()+"/api/device/CheckStockAdjust?DeviceId=".concat(r),{method:"POST"}));case 1:case"end":return e.stop()}},t)})),Ce.apply(this,arguments)}function Ke(t){return _e.apply(this,arguments)}function _e(){return _e=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"/api/DeviceVesion/GetDeviceVesion?productId=".concat(r),{method:"Get"}));case 1:case"end":return e.stop()}},t)})),_e.apply(this,arguments)}function mt(t){return Re.apply(this,arguments)}function Re(){return Re=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.w)()+"/api/goods/TechnologyTemplateExport?deviceId=".concat(r),{method:"post"}));case 1:case"end":return e.stop()}},t)})),Re.apply(this,arguments)}function gt(){return $e.apply(this,arguments)}function $e(){return $e=(0,S.Z)((0,i.Z)().mark(function t(){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,_.WY)((0,R.Wz)()+"/api/store/getstorelist",{method:"Get"}));case 1:case"end":return u.stop()}},t)})),$e.apply(this,arguments)}function yt(){return je.apply(this,arguments)}function je(){return je=(0,S.Z)((0,i.Z)().mark(function t(){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,_.WY)((0,R.w)()+"/api/goods/getgoodslist",{method:"Get"}));case 1:case"end":return u.stop()}},t)})),je.apply(this,arguments)}function vr(t){return Be.apply(this,arguments)}function Be(){return Be=_asyncToGenerator(_regeneratorRuntime().mark(function t(r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request(GetkitchbaseUrl()+"/api/devicepushrecode/getdevicegoods?deviceId="+r,{method:"post"}));case 1:case"end":return e.stop()}},t)})),Be.apply(this,arguments)}function wt(t){return Pe.apply(this,arguments)}function Pe(){return Pe=(0,S.Z)((0,i.Z)().mark(function t(r){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,_.WY)((0,R.Wz)()+"/api/devicepushrecode/editdevicegoods",{method:"post",data:r}));case 1:case"end":return e.stop()}},t)})),Pe.apply(this,arguments)}var o=l(85893),St=function(r){var u=(0,w.useState)(""),e=(0,D.Z)(u,2),j=e[0],H=e[1],J=(0,w.useState)([]),Q=(0,D.Z)(J,2),Ae=Q[0],ke=Q[1],X=(0,w.useState)([]),q=(0,D.Z)(X,2),Ie=q[0],Oe=q[1],ee=(0,w.useState)([]),Ee=(0,D.Z)(ee,2),Ue=Ee[0],te=Ee[1],re=(0,w.useRef)(null);(0,w.useEffect)(function(){var G;if(Object.keys(r.values).length>0)var h=r.deviceVersions.map(function(m){return{value:m.id,label:m.vesion}});te(h);var c=r.dicData.map(function(m){return{value:m.id,label:m.label}});ke(c);var s=(G=r.StopData)===null||G===void 0?void 0:G.map(function(m){return{value:m.id,label:m.name}});Oe(s)},[r]);var Fe=function(h){Ke(h).then(function(c){var s=c.data.map(function(m){return{value:m.id,label:m.vesion}});te(s)})},Le=function(h){H(h.target.value)},We=function(h){if(h.preventDefault(),j.length==0)T.default.error("\u8BF7\u8F93\u5165\u540D\u79F0");else{var c={name:j};ht(c).then(function(s){s.succeeded?(T.default.success("\u6DFB\u52A0\u6210\u529F"),r.initDeviceType(),H("")):T.default.error(s.errors)})}};return(0,o.jsx)(P.Z,{title:r.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,open:r.createModalVisible,maskClosable:!1,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){r.onCancel()},destroyOnClose:!0,children:(0,o.jsxs)(B.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,initialValues:r.values,onFinish:r.onFinish,children:[(0,o.jsx)(B.Z.Item,{name:"id",hidden:!0,children:(0,o.jsx)(z.Z,{})}),(0,o.jsx)(B.Z.Item,{label:"\u9009\u62E9\u573A\u666F",name:"stopId",rules:[{required:!0}],children:(0,o.jsx)(f.Z,{allowClear:!0,showSearch:!0,optionFilterProp:"children",filterOption:function(h,c){var s;return((s=c==null?void 0:c.label)!==null&&s!==void 0?s:"").includes(h)},filterSort:function(h,c){var s,m;return((s=h==null?void 0:h.label)!==null&&s!==void 0?s:"").toLowerCase().localeCompare(((m=c==null?void 0:c.label)!==null&&m!==void 0?m:"").toLowerCase())},options:Ie})}),(0,o.jsx)(B.Z.Item,{label:"\u4EA7\u54C1",name:"productId",rules:[{required:!0}],children:(0,o.jsx)(f.Z,{onChange:Fe,allowClear:!0,showSearch:!0,optionFilterProp:"children",filterOption:function(h,c){var s;return((s=c==null?void 0:c.label)!==null&&s!==void 0?s:"").includes(h)},filterSort:function(h,c){var s,m;return((s=h==null?void 0:h.label)!==null&&s!==void 0?s:"").toLowerCase().localeCompare(((m=c==null?void 0:c.label)!==null&&m!==void 0?m:"").toLowerCase())},options:Ae})}),(0,o.jsx)(B.Z.Item,{label:"\u4EA7\u54C1\u7248\u672C",name:"productVersionId",rules:[{required:!0}],children:(0,o.jsx)(f.Z,{allowClear:!0,showSearch:!0,optionFilterProp:"children",filterOption:function(h,c){var s;return((s=c==null?void 0:c.label)!==null&&s!==void 0?s:"").includes(h)},filterSort:function(h,c){var s,m;return((s=h==null?void 0:h.label)!==null&&s!==void 0?s:"").toLowerCase().localeCompare(((m=c==null?void 0:c.label)!==null&&m!==void 0?m:"").toLowerCase())},options:Ue})}),(0,o.jsx)(B.Z.Item,{label:"\u8BBE\u5907\u540D\u79F0",name:"deviceName",rules:[{required:!0,max:50}],children:(0,o.jsx)(z.Z,{})}),(0,o.jsx)(B.Z.Item,{label:"\u8BBE\u5907\u6807\u7B7E",name:"deviceTypeId",rules:[{required:!1}],children:(0,o.jsx)(f.Z,{style:{width:"100%"},placeholder:"\u8BF7\u9009\u8BBE\u5907\u6807\u7B7E",options:r.storeType,allowClear:!0,showSearch:!0,optionFilterProp:"children",filterOption:function(h,c){var s;return((s=c==null?void 0:c.label)!==null&&s!==void 0?s:"").includes(h)},filterSort:function(h,c){var s,m;return((s=h==null?void 0:h.label)!==null&&s!==void 0?s:"").toLowerCase().localeCompare(((m=c==null?void 0:c.label)!==null&&m!==void 0?m:"").toLowerCase())},dropdownRender:function(h){return(0,o.jsxs)(o.Fragment,{children:[h,(0,o.jsx)(C.Z,{style:{margin:"8px 0"}}),(0,o.jsxs)(W.Z,{style:{padding:"0 8px 4px"},children:[(0,o.jsx)(z.Z,{placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u6807\u7B7E",ref:re,value:j,onChange:Le,onKeyDown:function(s){return s.stopPropagation()}}),(0,o.jsx)(k.Z,{type:"text",icon:(0,o.jsx)(N.Z,{}),onClick:We,children:"\u65B0\u589E"})]})]})}})}),(0,o.jsx)(B.Z.Item,{label:"\u5730\u5740",name:"address",rules:[{max:50}],children:(0,o.jsx)(z.Z,{})}),(0,o.jsxs)(B.Z.Item,{children:[(0,o.jsx)(k.Z,{htmlType:"button",style:{float:"right"},onClick:r.onCancel,children:"\u53D6\u6D88"}),(0,o.jsx)(k.Z,{disabled:!r.codeList.includes("DeviceUp"),type:"primary",htmlType:"submit",style:{float:"right",marginRight:10},children:"\u4FDD\u5B58"})]})]})})},Zt=St,Dt=l(20173),bt=l(64172),Tt=function(){var r=(0,w.useState)(),u=(0,D.Z)(r,2),e=u[0],j=u[1],H=(0,w.useState)([]),J=(0,D.Z)(H,2),Q=J[0],Ae=J[1],ke=(0,w.useState)([]),X=(0,D.Z)(ke,2),q=X[0],Ie=X[1],Oe=(0,w.useState)([]),ee=(0,D.Z)(Oe,2),Ee=ee[0],Ue=ee[1],te=(0,w.useState)([]),re=(0,D.Z)(te,2),Fe=re[0],Le=re[1],We=(0,w.useState)([]),G=(0,D.Z)(We,2),h=G[0],c=G[1],s=(0,w.useState)([]),m=(0,D.Z)(s,2),Ct=m[0],Ne=m[1],_t=(0,w.useState)(!1),ze=(0,D.Z)(_t,2),Rt=ze[0],F=ze[1],O=(0,w.useRef)(),$t=(0,w.useState)(),He=(0,D.Z)($t,2),Me=He[0],Je=He[1],jt=(0,w.useState)([]),Qe=(0,D.Z)(jt,2),ae=Qe[0],Xe=Qe[1],Bt=(0,w.useState)([]),qe=(0,D.Z)(Bt,2),Pt=qe[0],At=qe[1],kt=(0,w.useState)(!1),et=(0,D.Z)(kt,2),It=et[0],tt=et[1],Ot=(0,w.useState)([]),rt=(0,D.Z)(Ot,2),Et=rt[0],Ut=rt[1],Ft=(0,w.useState)([]),at=(0,D.Z)(Ft,2),nt=at[0],Lt=at[1],Wt=(0,w.useState)([]),ut=(0,D.Z)(Wt,2),x=ut[0],Mt=ut[1];(0,w.useEffect)(function(){bt.Z.getRoleBasicMenu().then(function(a){a.data&&Mt(a.data)}),gt().then(function(a){At(a.data)}),yt().then(function(a){var g=a.data,n=[];g.forEach(function(p){n.push({key:p.id,title:p.name,description:p.name})}),Ut(n)});function y(){(0,Dt.FM)().then(function(a){g(a.data);function g(v){for(var Z in v)v[Z].type==2||v[Z].type==3?v[Z].disabled=!1:v[Z].disabled=!0,v[Z].children&&g(v[Z].children)}Ie(a.data);var n={};p(a.data);function p(v){for(var Z in v)n[v[Z].disabled]=!0,n[v[Z].value]={text:v[Z].title},v[Z].children&&p(v[Z].children)}Ue(n)})}y(),it();function d(){ct().then(function(a){var g=a.data,n={};if(a.succeeded){var p=[];g.forEach(function(v){n[v.name]={text:v.name},p.push({id:v.id,label:v.name,text:v.name})}),Le(n),c(p)}})}d(),xt()},[]);var it=function(){ft().then(function(d){var a={},g=[];d.data.forEach(function(n){g.push({label:n.name,text:n.name,value:n.id}),a[n.id]={text:n.name}}),Ae(g),j(a)})},xt=function(){var y=(0,S.Z)((0,i.Z)().mark(function d(){var a;return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,vt();case 2:a=n.sent,a.statusCode==200?Ne(a.data):T.default.error("\u83B7\u53D6\u8BBE\u5907\u7248\u672C\u5931\u8D25");case 4:case"end":return n.stop()}},d)}));return function(){return y.apply(this,arguments)}}(),Vt=function(){var y=(0,S.Z)((0,i.Z)().mark(function d(a){var g;return(0,i.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,Ke(a==null?void 0:a.productId);case 2:g=p.sent,g.statusCode==200?Ne(g.data):T.default.error("\u83B7\u53D6\u8BBE\u5907\u7248\u672C\u5931\u8D25");case 4:case"end":return p.stop()}},d)}));return function(a){return y.apply(this,arguments)}}(),Yt=function(){return(ae==null?void 0:ae.length)>0&&(0,o.jsx)(Y.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",onConfirm:Kt,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,o.jsx)(k.Z,{type:"primary",children:"\u6279\u91CF\u5220\u9664"})})},Kt=function(){var d,a;Nt(ae),Xe([]),(d=O.current)===null||d===void 0||(a=d.reloadAndRest)===null||a===void 0||a.call(d)},Nt=function(){var y=(0,S.Z)((0,i.Z)().mark(function d(a){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a){n.next=2;break}return n.abrupt("return",!0);case 2:return n.next=4,Ye(a.map(function(p){return p.id})).then(function(p){p.data?(T.default.success("\u5220\u9664\u6210\u529F"),O.current.reload()):T.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 4:return n.abrupt("return",!0);case 5:case"end":return n.stop()}},d)}));return function(a){return y.apply(this,arguments)}}(),zt=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u8BBE\u5907\u540D\u79F0",dataIndex:"deviceName",valueType:"textarea"},{title:"\u4EA7\u54C1",dataIndex:"productName",valueEnum:Fe,hideInSearch:!0},{title:"\u4EA7\u54C1\u7248\u672C",dataIndex:"productVersionName",search:!1},{title:"\u6240\u5C5E\u573A\u666F",dataIndex:"stopName",search:!1},{title:"\u5730\u5740",dataIndex:"address",search:!1},{title:"\u8BBE\u5907\u6807\u7B7E",dataIndex:"deviceTypeId",valueEnum:e},{title:"\u8BBE\u5907\u552F\u4E00key",dataIndex:"autoKey",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:300,render:function(d,a){return[(0,o.jsx)("a",{onClick:function(){Vt(a),F(!0),Je(a)},children:"\u66F4\u65B0"},"update"),x.includes("DeviceDel")&&(0,o.jsx)(Y.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,S.Z)((0,i.Z)().mark(function g(){return(0,i.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,Ye([a.id]).then(function(v){v.data?(T.default.success("\u5220\u9664\u6210\u529F"),O.current.reload()):T.default.error(v.errors)});case 2:case"end":return p.stop()}},g)})),children:(0,o.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary"),x.includes("DeviceDown")&&(0,o.jsx)("a",{onClick:(0,S.Z)((0,i.Z)().mark(function g(){var n,p;return(0,i.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,mt(a.id);case 2:if(n=Z.sent,n!=""){Z.next=6;break}return T.default.error("\u5F53\u524D\u6A21\u677F\u4E0D\u5B58\u5728\uFF01"),Z.abrupt("return");case 6:p=document.createElement("a"),p.href=n,p.click();case 9:case"end":return Z.stop()}},g)})),children:"\u5BFC\u51FA\u5DE5\u827A\u6A21\u7248"},"add")]}}],Ht=function(){var y=(0,S.Z)((0,i.Z)().mark(function d(a){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,dt(JSON.stringify(a)).then(function(p){if(p.succeeded)T.default.success("\u6DFB\u52A0\u6210\u529F"),F(!1),O.current.reload();else return T.default.error(p.errors),!1});case 2:case"end":return n.stop()}},d)}));return function(a){return y.apply(this,arguments)}}(),Jt=function(){var y=(0,S.Z)((0,i.Z)().mark(function d(a){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,pt(JSON.stringify(a)).then(function(p){if(p.succeeded)T.default.success("\u66F4\u65B0\u6210\u529F"),F(!1),O.current.reload();else return T.default.error(p.errors),!1});case 2:case"end":return n.stop()}},d)}));return function(a){return y.apply(this,arguments)}}(),Qt=function(){var y=(0,S.Z)((0,i.Z)().mark(function d(){var a,g;return(0,i.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:a=[],nt.forEach(function(v,Z,mr){a.push({goodsId:v,goodsName:""})}),g={deviceId:Me.id,goodsList:a,autoKey:Me.autoKey},wt(g).then(function(v){if(v.succeeded)T.default.success("\u7F16\u8F91\u6210\u529F"),F(!1),O.current.reload();else return T.default.error(v.errors),!1}),tt(!1);case 5:case"end":return p.stop()}},d)}));return function(){return y.apply(this,arguments)}}(),Xt=function(d){Lt(d)};return(0,o.jsxs)(xe.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,o.jsx)(L.ZP,{headerTitle:"\u8BBE\u5907\u4FE1\u606F",actionRef:O,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},scroll:{x:2e3},toolBarRender:function(){return[x.includes("DeviceAdd")&&(0,o.jsxs)(k.Z,{type:"primary",onClick:function(){F(!0)},children:[(0,o.jsx)(N.Z,{})," \u65B0\u5EFA"]},"primary"),x.includes("DeviceDel")&&(0,o.jsx)(Yt,{})]},request:function(){var y=(0,S.Z)((0,i.Z)().mark(function d(a){var g,n;return(0,i.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return g=[],n=0,v.next=4,ot(a).then(function(Z){g=Z.data.data,n=Z.data.total});case 4:return v.abrupt("return",{data:g,success:!0,total:n});case 5:case"end":return v.stop()}},d)}));return function(d){return y.apply(this,arguments)}}(),columns:zt,rowSelection:{onChange:function(d,a){Xe(a)}}}),(0,o.jsx)(Zt,{codeList:x,storeType:Q,OrgData:q,dicData:h,initDeviceType:it,onFinish:function(){var y=(0,S.Z)((0,i.Z)().mark(function d(a){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a.id?Jt(a):Ht(a);case 1:case"end":return n.stop()}},d)}));return function(d){return y.apply(this,arguments)}}(),onCancel:function(){F(!1),Je(void 0)},createModalVisible:Rt,deviceVersions:Ct,values:Me||{},StopData:Pt}),(0,o.jsx)(P.Z,{width:600,title:"\u9009\u62E9\u5546\u54C1",open:It,onOk:function(){Qt()},onCancel:function(){tt(!1)},children:(0,o.jsx)(A.Z,{className:"tree-transfer",dataSource:Et,targetKeys:nt,onChange:Xt,onSearch:function(){},render:function(d){return d.title}})})]})},Gt=Tt},20173:function(st,V,l){"use strict";l.d(V,{lM:function(){return Y},IH:function(){return k},mm:function(){return S},eP:function(){return N},FM:function(){return Ve}});var $=l(39428),P=l(11849),E=l(3182),A=l(48971),U=l(96690);function Y(b,C){return K.apply(this,arguments)}function K(){return K=(0,E.Z)((0,$.Z)().mark(function b(C,I){return(0,$.Z)().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.abrupt("return",(0,A.WY)((0,U.w)()+"/api/organize/page",{method:"POST",data:(0,P.Z)({},C)}));case 1:case"end":return M.stop()}},b)})),K.apply(this,arguments)}function k(b){return i.apply(this,arguments)}function i(){return i=(0,E.Z)((0,$.Z)().mark(function b(C){return(0,$.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",(0,A.WY)((0,U.w)()+"/api/organize/addorg",{method:"POST",data:(0,P.Z)({},C)}));case 1:case"end":return f.stop()}},b)})),i.apply(this,arguments)}function lt(b){return T.apply(this,arguments)}function T(){return T=_asyncToGenerator(_regeneratorRuntime().mark(function b(C){return _regeneratorRuntime().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",request(getDataBaseUrl()+"\u200B/api\u200B/organize/getorglist",{method:"POST",data:_objectSpread({},C)}));case 1:case"end":return f.stop()}},b)})),T.apply(this,arguments)}function S(b){return D.apply(this,arguments)}function D(){return D=(0,E.Z)((0,$.Z)().mark(function b(C){return(0,$.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",(0,A.WY)((0,U.w)()+"\u200B/api\u200B/organize/deleteorg?id="+C,{method:"GET"}));case 1:case"end":return f.stop()}},b)})),D.apply(this,arguments)}function N(b){return w.apply(this,arguments)}function w(){return w=(0,E.Z)((0,$.Z)().mark(function b(C){return(0,$.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",(0,A.WY)((0,U.w)()+"\u200B/api\u200B/organize/updateorg",{method:"POST",data:(0,P.Z)({},C)}));case 1:case"end":return f.stop()}},b)})),w.apply(this,arguments)}function xe(b){return L.apply(this,arguments)}function L(){return L=_asyncToGenerator(_regeneratorRuntime().mark(function b(C){return _regeneratorRuntime().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",request(getDataBaseUrl()+"/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},C)}));case 1:case"end":return f.stop()}},b)})),L.apply(this,arguments)}function Ve(b){return W.apply(this,arguments)}function W(){return W=(0,E.Z)((0,$.Z)().mark(function b(C){return(0,$.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",(0,A.WY)((0,U.w)()+"\u200B/api\u200B/organize/tree",{method:"GET",data:(0,P.Z)({},C)}));case 1:case"end":return f.stop()}},b)})),W.apply(this,arguments)}}}]);