Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

2 řádky
11 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4424],{58211:function(Fe,q,n){"use strict";n.r(q),n.d(q,{default:function(){return xe}});var Se=n(71194),_=n(50146),w=n(11849),Ae=n(57663),R=n(71577),Ee=n(43185),b=n(93009),Te=n(9715),y=n(55843),j=n(2824),i=n(39428),Re=n(34792),o=n(48086),m=n(3182),D=n(67294),te=n(78009),ae=n(85224),ne=n(49101),re=n(16894),Ve=n(47673),M=n(4107),Pe=n(43358),C=n(34041),ue=n(84391),F=n(48971);function se(s){return L.apply(this,arguments)}function L(){return L=(0,m.Z)((0,i.Z)().mark(function s(a){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/kitchen/api/DeviceVesion/GetDeviceVesionPage",{method:"POST",data:a}));case 1:case"end":return e.stop()}},s)})),L.apply(this,arguments)}function le(s){return W.apply(this,arguments)}function W(){return W=(0,m.Z)((0,i.Z)().mark(function s(a){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/kitchen/api/DeviceVesion/AddDeviceVesion",{method:"POST",data:a}));case 1:case"end":return e.stop()}},s)})),W.apply(this,arguments)}function ie(s){return k.apply(this,arguments)}function k(){return k=(0,m.Z)((0,i.Z)().mark(function s(a){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("\u200B/kitchen/api/DeviceVesion/DelDeviceVesion",{method:"POST",data:a}));case 1:case"end":return e.stop()}},s)})),k.apply(this,arguments)}function oe(s){return Y.apply(this,arguments)}function Y(){return Y=(0,m.Z)((0,i.Z)().mark(function s(a){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("\u200B/kitchen/api/DeviceVesion/UpdateDeviceVesion",{method:"POST",data:a}));case 1:case"end":return e.stop()}},s)})),Y.apply(this,arguments)}function ce(s){return K.apply(this,arguments)}function K(){return K=(0,m.Z)((0,i.Z)().mark(function s(a){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/kitchen/api/dict-data/dic-list/".concat(a),{method:"Get"}));case 1:case"end":return e.stop()}},s)})),K.apply(this,arguments)}function de(s){return N.apply(this,arguments)}function N(){return N=(0,m.Z)((0,i.Z)().mark(function s(a){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:a}));case 1:case"end":return e.stop()}},s)})),N.apply(this,arguments)}var fe=n(9669),he=n.n(fe),t=n(85893),pe=function(a){a.form.setFieldsValue(a.values);var c=C.Z.Option,e=C.Z.OptGroup,r={name:"file",showUploadList:!1,multiple:!1,accept:".xlsx, .xls",headers:{"Content-Type":"application/octet-stream"},customRequest:function(f){var P=f.action,g=f.file,J=f.headers,z=f.onError,I=f.onProgress,Z=f.onSuccess,S=f.withCredentials;console.log("\u4E0A\u4F20\u56FE\u7247",g);var H=g.name.lastIndexOf("."),U=g.name.substr(H+1),x=null;return de({directory:"goods",fileExtension:U,method:"PUT"}).then(function(A){P=A.allUrl;var $=new FileReader;$.readAsArrayBuffer(g),$.onload=function(B){x=B.target.result,he().put(P,x,{withCredentials:S,headers:J,onUploadProgress:function(T){var Q=T.total,X=T.loaded;I({percent:Math.round(X/Q*100).toFixed(2)},g)}}).then(function(E){console.log("onSuccess",E,g),(E.status==200||E.statusText=="OK")&&a.form.setFieldsValue({templatePath:A.seeUrl})}).catch(z)}}),{abort:function(){console.log("upload progress is aborted.")}}}};return(0,t.jsx)(_.Z,{title:a.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:a.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){a.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(y.Z,{layout:"vertical",preserve:!1,form:a.form,onFinish:a.onFinish,children:[(0,t.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(M.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u7248\u672C\u53F7",name:"vesion",rules:[{required:!0,max:50}],children:(0,t.jsx)(M.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceTypeKey",rules:[{required:!0,max:50}],children:(0,t.jsx)(C.Z,{children:a.dicData.map(function(l,f){return(0,t.jsx)(C.Z.Option,{index:f,value:l.code,children:l.value},l.code)})})}),(0,t.jsx)(y.Z.Item,{label:"\u6A21\u677F\u8DEF\u5F84",name:"templatePath",children:(0,t.jsx)(M.Z,{})}),(0,t.jsx)(y.Z.Item,{name:"templatePath1",label:"\u6A21\u677F",children:(0,t.jsx)(b.Z,(0,w.Z)((0,w.Z)({},r),{},{children:(0,t.jsx)(R.Z,{icon:(0,t.jsx)(ue.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,t.jsx)(y.Z.Item,{label:"\u72B6\u6001",name:"status",rules:[{required:!0}],children:(0,t.jsx)(C.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,t.jsxs)(e,{children:[(0,t.jsx)(C.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,t.jsx)(C.Z.Option,{value:1,children:"\u505C\u7528"})]})})}),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)(R.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ve=pe,V="message",me=function(){var s=(0,m.Z)((0,i.Z)().mark(function a(c){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o.default.loading("\u6B63\u5728\u6DFB\u52A0",V),r.next=4,le(JSON.stringify(c)).then(function(l){return o.default.destroy(V),l.data?(o.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(o.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:r.next=10;break;case 6:return r.prev=6,r.t0=r.catch(0),o.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},a,null,[[0,6]])}));return function(c){return s.apply(this,arguments)}}(),Ze=function(){var s=(0,m.Z)((0,i.Z)().mark(function a(c){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o.default.loading("\u6B63\u5728\u4FEE\u6539",V),o.default.destroy(V),r.next=5,oe(JSON.stringify(c)).then(function(l){return o.default.destroy(V),l.data?(o.default.success("\u4FEE\u6539\u6210\u529F"),!0):(o.default.success("\u4FEE\u6539\u5931\u8D25"),!1)});case 5:r.next=11;break;case 7:return r.prev=7,r.t0=r.catch(0),o.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 11:case"end":return r.stop()}},a,null,[[0,7]])}));return function(c){return s.apply(this,arguments)}}(),ye=function(){var s=(0,m.Z)((0,i.Z)().mark(function a(c){var e;return(0,i.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,o.default.loading("\u6B63\u5728\u5220\u9664"),e=[],c.forEach(function(f){e.push(f.id)}),l.next=6,ie(e).then(function(f){return f.data?(o.default.success("\u5220\u9664\u6210\u529F"),!0):(o.default.error(f.errors),!1)});case 6:l.next=12;break;case 8:return l.prev=8,l.t0=l.catch(0),o.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 12:case"end":return l.stop()}},a,null,[[0,8]])}));return function(c){return s.apply(this,arguments)}}(),ge=function(){var a=(0,D.useState)(!1),c=(0,j.Z)(a,2),e=c[0],r=c[1],l=(0,D.useRef)(),f=(0,D.useState)([]),P=(0,j.Z)(f,2),g=P[0],J=P[1],z=(0,D.useState)(),I=(0,j.Z)(z,2),Z=I[0],S=I[1],H=(0,D.useState)([]),U=(0,j.Z)(H,2),x=U[0],A=U[1],$=(0,D.useState)(!1),B=(0,j.Z)($,2),E=B[0],T=B[1],Q=y.Z.useForm(),X=(0,j.Z)(Q,1),De=X[0],Ce={beforeUpload:function(u){return u.type!=="application/vnd.ms-excel"&&u.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&o.default.error("".concat(u.name," \u4E0D\u662F exelce \u6587\u4EF6")),u.type=="application/vnd.ms-excel"||u.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:b.Z.LIST_IGNORE},name:"file",data:{id:Z==null?void 0:Z.id,deviceClientType:Z==null?void 0:Z.deviceTypeKey,version:Z==null?void 0:Z.vesion},action:"/kitchen/api/goodes/DeviceVersionTemplateImport",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(u){u.file.status!=="uploading"&&console.log(u.file,u.fileList),u.file.status==="done"?(T(!1),l.current.reload(),o.default.success("".concat(u.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F."))):u.file.status==="error"&&o.default.error("".concat(u.file.name," \u6587\u4EF6\u4E0A\u8F7D\u5931\u8D25."))}},je=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u7248\u672C\u53F7",dataIndex:"vesion",valueType:"textarea"},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceTypeKey",valueType:"textarea"},{title:"\u6A21\u677F\u5730\u5740",dataIndex:"templatePath",valueType:"textarea"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(u,d){return[(0,t.jsx)("a",{onClick:function(){r(!0),S(d)},children:" \u66F4\u65B0"},"config"),(0,t.jsx)("a",{onClick:function(){S(d),T(!0)},children:" \u4E0A\u4F20\u7248\u672C\u5DE5\u827A\u6A21\u7248"},"config"),(0,t.jsx)("a",{href:d.templatePath,children:" \u4E0B\u8F7D\u5DE5\u827A\u6A21\u677F"},"config")]}}];return(0,D.useEffect)(function(){ce("DeviceClientType").then(function(h){var u=h.data,d={};if(h.succeeded){var p=[];u.forEach(function(v){d[v.code]={text:v.code},p.push({code:v.code,value:v.code})}),J(p)}})},[]),(0,t.jsxs)(te.ZP,{children:[(0,t.jsx)(re.ZP,{headerTitle:"\u8BBE\u5907\u7248\u672C",actionRef:l,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(R.Z,{type:"primary",onClick:function(){r(!0)},children:[(0,t.jsx)(ne.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var h=(0,m.Z)((0,i.Z)().mark(function u(d){var p,v;return(0,i.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return p=[],v=0,O.next=4,se(d).then(function(ee){p=ee.data.data,v=ee.data.total});case 4:return O.abrupt("return",{data:p,success:!0,total:v});case 5:case"end":return O.stop()}},u)}));return function(u){return h.apply(this,arguments)}}(),columns:je,rowSelection:{onChange:function(u,d){A(d)}}}),(x==null?void 0:x.length)>0&&(0,t.jsx)(ae.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:x.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)(R.Z,{onClick:(0,m.Z)((0,i.Z)().mark(function h(){var u,d;return(0,i.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,ye(x);case 2:A([]),(u=l.current)===null||u===void 0||(d=u.reloadAndRest)===null||d===void 0||d.call(u);case 4:case"end":return v.stop()}},h)})),children:"\u5220\u9664"})}),(0,t.jsx)(ve,{onFinish:function(){var h=(0,m.Z)((0,i.Z)().mark(function u(d){var p;return(0,i.Z)().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:p=!1,d.id?p=Ze(d):p=me(d),p&&(r(!1),S(void 0)),l.current.reload();case 4:case"end":return G.stop()}},u)}));return function(u){return h.apply(this,arguments)}}(),onCancel:function(){r(!1),S(void 0)},createModalVisible:e,values:Z||{},form:De,dicData:g}),(0,t.jsx)(_.Z,{title:"\u4E0A\u4F20\u5DE5\u827A\u6A21\u7248",open:E,footer:null,onCancel:function(){T(!1)},children:(0,t.jsx)(b.Z,(0,w.Z)((0,w.Z)({},Ce),{},{maxCount:1,children:(0,t.jsx)(R.Z,{children:"\u5BFC\u5165\u5DE5\u827A\u6A21\u7248"})}))})]})},xe=ge}}]);