選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

p__device__deviceInfo.8b592f8d.async.js 15 KiB

1年前
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7657,7975,1322],{1966:function(ve,M,n){"use strict";n.r(M),n.d(M,{default:function(){return Ae}});var I=n(57663),O=n(71577),g=n(2824),r=n(39428),re=n(34792),m=n(48086),Z=n(3182),A=n(49101),j=n(67294),P=n(78009),Y=n(85224),k=n(16894),ne=n(71194),F=n(50146),me=n(77883),$=n(85986),ae=n(62999),B=n(54680),v=n(9715),l=n(71257),b=n(47673),a=n(4107),R=n(43358),C=n(34041),t=n(85893),ye=function(i){var o=C.Z.Option,e=C.Z.OptGroup;return(0,t.jsx)(F.Z,{title:i.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:i.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){i.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(l.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,initialValues:i.values,onFinish:i.onFinish,children:[(0,t.jsx)(l.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(a.Z,{})}),(0,t.jsx)(l.Z.Item,{label:"\u8BBE\u5907\u540D\u79F0",name:"deviceName",rules:[{required:!0,max:50}],children:(0,t.jsx)(a.Z,{})}),(0,t.jsx)(l.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceTypeKey",rules:[{required:!0}],children:(0,t.jsx)(C.Z,{children:i.dicData.map(function(u,p){return(0,t.jsx)(C.Z.Option,{index:p,value:u.code,children:u.value},u.code)})})}),(0,t.jsx)(l.Z.Item,{name:"orgId",label:"\u5F52\u5C5E\u95E8\u5E97",rules:[{required:!0}],children:(0,t.jsx)(B.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:i.OrgData,placeholder:"\u5F52\u5C5E\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,t.jsx)(l.Z.Item,{label:"\u8BBE\u5907\u5206\u7C7B",name:"deviceTypeId",rules:[{required:!0}],children:(0,t.jsx)(C.Z,{children:i.storeType.map(function(u,p){return(0,t.jsx)(C.Z.Option,{index:p,value:u.id,children:u.text},u.id)})})}),(0,t.jsx)(l.Z.Item,{noStyle:!0,shouldUpdate:function(p,T){return p.deviceTypeKey!==T.deviceTypeKey},children:function(p){var T,q=p.getFieldValue;return q("deviceTypeKey")==="TMC"?(0,t.jsx)(l.Z.Item,{name:"deviceVersion",label:"\u8BBE\u5907\u7248\u672C",initialValue:"WorryFreeEdition",children:(0,t.jsx)(C.Z,{children:(T=i.deviceVersions)===null||T===void 0?void 0:T.map(function(W,ee){return(0,t.jsx)(C.Z.Option,{index:ee,value:W.code,children:W.name},W.code)})})}):null}}),(0,t.jsx)(l.Z.Item,{label:"\u8BBE\u5907\u5750\u6807",name:"deviceLoc",children:(0,t.jsx)(a.Z,{placeholder:"104.070734,30.575041"})}),(0,t.jsx)(l.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)(l.Z.Item,{label:"\u8BBE\u5907\u901A\u9053\u6570\u91CF",name:"materialQuantity",children:(0,t.jsx)($.Z,{})}),(0,t.jsx)(l.Z.Item,{label:"\u8BBE\u5907\u8BE6\u7EC6\u5730\u5740",name:"deviceAddr",children:(0,t.jsx)(a.Z,{placeholder:"\u6210\u90FD\u5E02\u6B66\u4FAF\u533A\u6842\u6EAA\u8857\u9053\u73AF\u7403\u4E2D\u5FC3N5-9111C"})}),(0,t.jsx)(l.Z.Item,{children:(0,t.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Ze=ye,E=n(48971);function ge(s){return U.apply(this,arguments)}function U(){return U=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("/kitchen/api/Device/GetDeviceInfoPage",{method:"POST",data:i}));case 1:case"end":return e.stop()}},s)})),U.apply(this,arguments)}function De(s){return N.apply(this,arguments)}function N(){return N=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("/kitchen/api/dict-data/dic-list/".concat(i),{method:"Get"}));case 1:case"end":return e.stop()}},s)})),N.apply(this,arguments)}function Se(s){return H.apply(this,arguments)}function H(){return H=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("/kitchen/api/Device/AddDeviceInfo",{method:"POST",data:i}));case 1:case"end":return e.stop()}},s)})),H.apply(this,arguments)}function ue(s){return J.apply(this,arguments)}function J(){return J=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("/kitchen/api/Device/UpdateDeviceInfo",{method:"POST",data:i}));case 1:case"end":return e.stop()}},s)})),J.apply(this,arguments)}function je(s){return Q.apply(this,arguments)}function Q(){return Q=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("/kitchen/api/Device/CopyDevice",{method:"POST",data:i}));case 1:case"end":return e.stop()}},s)})),Q.apply(this,arguments)}function Te(s){return z.apply(this,arguments)}function z(){return z=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("\u200B\u200B/kitchen/api/Device/DelDeviceInfo",{method:"POST",data:i}));case 1:case"end":return e.stop()}},s)})),z.apply(this,arguments)}function we(s){return X.apply(this,arguments)}function X(){return X=(0,Z.Z)((0,r.Z)().mark(function s(i){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,E.WY)("\u200B/kitchen/api/Device/GetDeviceType",{method:"GET"}));case 1:case"end":return e.stop()}},s)})),X.apply(this,arguments)}function Ie(){return _.apply(this,arguments)}function _(){return _=(0,Z.Z)((0,r.Z)().mark(function s(){return(0,r.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",(0,E.WY)("\u200B/kitchen/api/Device/GetDeviceVersions",{method:"post"}));case 1:case"end":return o.stop()}},s)})),_.apply(this,arguments)}var Ce=n(3408),K="message",xe=function(){var s=(0,Z.Z)((0,r.Z)().mark(function i(o){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,m.default.loading("\u6B63\u5728\u6DFB\u52A0",K),u.next=4,Se(JSON.stringify(o)).then(function(p){return m.default.destroy(K),p.data?(m.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(m.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:u.next=10;break;case 6:return u.prev=6,u.t0=u.catch(0),m.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 10:case"end":return u.stop()}},i,null,[[0,6]])}));return function(o){return s.apply(this,arguments)}}(),Oe=function(){var s=(0,Z.Z)((0,r.Z)().mark(function i(o){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,m.default.loading("\u6B63\u5728\u4FEE\u6539",K),u.next=4,ue(JSON.stringify(o)).then(function(p){return m.default.destroy(K),p.data?(m.default.success("\u4FEE\u6539\u6210\u529F"),!0):(m.default.success("\u4FEE\u6539\u5931\u8D25"),!1)});case 4:u.next=10;break;case 6:return u.prev=6,u.t0=u.catch(0),m.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 10:case"end":return u.stop()}},i,null,[[0,6]])}));return function(o){return s.apply(this,arguments)}}(),Ee=function(){var s=(0,Z.Z)((0,r.Z)().mark(function i(o){var e;return(0,r.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.prev=0,m.default.loading("\u6B63\u5728\u5220\u9664"),e=[],o.forEach(function(T){e.push(T.id)}),p.next=6,Te(e).then(function(T){return T.data?(m.default.success("\u5220\u9664\u6210\u529F"),!0):(m.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 6:p.next=12;break;case 8:return p.prev=8,p.t0=p.catch(0),m.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),p.abrupt("return",!1);case 12:case"end":return p.stop()}},i,null,[[0,8]])}));return function(o){return s.apply(this,arguments)}}(),be=function(){var i=(0,j.useState)(),o=(0,g.Z)(i,2),e=o[0],u=o[1],p=(0,j.useState)([]),T=(0,g.Z)(p,2),q=T[0],W=T[1],ee=(0,j.useState)([]),ie=(0,g.Z)(ee,2),Pe=ie[0],ke=ie[1],Fe=(0,j.useState)([]),se=(0,g.Z)(Fe,2),$e=se[0],Be=se[1],Re=(0,j.useState)([]),le=(0,g.Z)(Re,2),We=le[0],Ge=le[1],Ve=(0,j.useState)([]),ce=(0,g.Z)(Ve,2),Me=ce[0],Ke=ce[1],Le=(0,j.useState)([]),de=(0,g.Z)(Le,2),Ye=de[0],Ue=de[1];(0,j.useEffect)(function(){var x=function(){we().then(function(h){var y={},S=[];h.data.forEach(function(c){S.push({text:c.name,id:c.id}),y[c.id]={text:c.name}}),W(S),u(y)})};function D(){(0,Ce.FM)().then(function(f){h(f.data);function h(c){for(var w in c)c[w].type==2||c[w].type==3?c[w].disabled=!1:c[w].disabled=!0,c[w].children&&h(c[w].children)}ke(f.data);var y={};S(f.data);function S(c){for(var w in c)y[c[w].disabled]=!0,y[c[w].value]={text:c[w].title},c[w].children&&S(c[w].children)}Be(y)})}D(),x();function d(){De("DeviceClientType").then(function(f){var h=f.data,y={};if(f.succeeded){var S=[];h.forEach(function(c){y[c.code]={text:c.code},S.push({code:c.code,value:c.code})}),Ge(y),Ke(S)}})}d(),Ne()},[]);var Ne=function(){var x=(0,Z.Z)((0,r.Z)().mark(function D(){var d;return(0,r.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Ie();case 2:d=h.sent,d.statusCode==200?Ue(d.data):m.default.error("\u83B7\u53D6\u8BBE\u5907\u7248\u672C\u5931\u8D25");case 4:case"end":return h.stop()}},D)}));return function(){return x.apply(this,arguments)}}(),He=(0,j.useState)(!1),oe=(0,g.Z)(He,2),Je=oe[0],L=oe[1],G=(0,j.useRef)(),Qe=(0,j.useState)(),pe=(0,g.Z)(Qe,2),ze=pe[0],te=pe[1],Xe=(0,j.useState)([]),fe=(0,g.Z)(Xe,2),V=fe[0],he=fe[1],_e=[{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:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceTypeKey",valueEnum:We,hideInSearch:!0},{title:"\u5F52\u5C5E\u95E8\u5E97",dataIndex:"orgId",search:!1,valueEnum:$e},{title:"\u8BBE\u5907\u5206\u7C7B",dataIndex:"deviceTypeId",valueEnum:e},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}},hideInSearch:!0},{title:"\u8BBE\u5907\u5730\u5740",dataIndex:"deviceAddr",search:!1,valueType:"textarea"},{title:"\u5750\u6807",dataIndex:"deviceLoc",valueType:"textarea",search:!1},{title:"\u8BBE\u5907\u901A\u9053\u6570\u91CF",dataIndex:"materialQuantity",valueType:"textarea",search:!1},{title:"\u8BBE\u5907\u552F\u4E00key",dataIndex:"autoKey",search:!1},{title:"\u5F52\u5C5E\u95E8\u5E97\u552F\u4E00key",dataIndex:"orgKey",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(D,d){return[(0,t.jsxs)("a",{onClick:function(){L(!0),te(d)},children:[" ","\u66F4\u65B0"]},"primary"),(0,t.jsxs)("a",{onClick:function(){d.status=d.status==0?1:0,ue(d).then(function(h){h.data&&G.current.reload()})},children:[" ",d.status==0?"\u505C\u7528":"\u6B63\u5E38"]},"primary2"),(0,t.jsxs)("a",{onClick:function(){je({id:d.id}).then(function(h){h.data&&G.current.reload()})},children:[" ","\u590D\u5236"]},"primary")]}}];return(0,t.jsxs)(P.ZP,{children:[(0,t.jsx)(k.ZP,{headerTitle:"\u8BBE\u5907\u4FE1\u606F",actionRef:G,rowKey:"id",search:{labelWidth:120},scroll:{x:2e3},toolBarRender:function(){return[(0,t.jsxs)(O.Z,{type:"primary",onClick:function(){L(!0)},children:[(0,t.jsx)(A.Z,{})," \u65B0\u5EFA"]},"primary"),(0,t.jsx)(O.Z,{onClick:(0,Z.Z)((0,r.Z)().mark(function D(){var d,f;return(0,r.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Ee(V);case 2:he([]),(d=G.current)===null||d===void 0||(f=d.reloadAndRest)===null||f===void 0||f.call(d);case 4:case"end":return y.stop()}},D)})),children:"\u5220\u9664"})]},request:function(){var x=(0,Z.Z)((0,r.Z)().mark(function D(d){var f,h;return(0,r.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return f=[],h=0,S.next=4,ge(d).then(function(c){f=c.data.data,h=c.data.total});case 4:return S.abrupt("return",{data:f,success:!0,total:h});case 5:case"end":return S.stop()}},D)}));return function(D){return x.apply(this,arguments)}}(),columns:_e,rowSelection:{onChange:function(D,d){he(d)}}}),(V==null?void 0:V.length)>0&&(0,t.jsx)(Y.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:V.length})," ","\u9879 \xA0\xA0"]})}),(0,t.jsx)(Ze,{storeType:q,OrgData:Pe,dicData:Me,onFinish:function(){var x=(0,Z.Z)((0,r.Z)().mark(function D(d){var f;return(0,r.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:f=!1,d.id?f=Oe(d):f=xe(d),f&&(L(!1),te(void 0),G.current.reload());case 3:case"end":return y.stop()}},D)}));return function(D){return x.apply(this,arguments)}}(),onCancel:function(){L(!1),te(void 0)},createModalVisible:Je,deviceVersions:Ye,values:ze||{}})]})},Ae=be},3408:function(ve,M,n){"use strict";n.d(M,{lM:function(){return re},IH:function(){return Z},mm:function(){return Y},eP:function(){return ne},FM:function(){return ae}});var I=n(39428),O=n(11849),g=n(3182),r=n(48971);function re(v,l){return m.apply(this,arguments)}function m(){return m=(0,g.Z)((0,I.Z)().mark(function v(l,b){return(0,I.Z)().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.abrupt("return",(0,r.WY)("/kitchen/api/sysOrg\u200B/page",{method:"GET",params:(0,O.Z)({},l)}));case 1:case"end":return R.stop()}},v)})),m.apply(this,arguments)}function Z(v){return A.apply(this,arguments)}function A(){return A=(0,g.Z)((0,I.Z)().mark(function v(l){return(0,I.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,r.WY)("/kitchen/api/sysOrg/add",{method:"POST",data:(0,O.Z)({},l)}));case 1:case"end":return a.stop()}},v)})),A.apply(this,arguments)}function j(v){return P.apply(this,arguments)}function P(){return P=_asyncToGenerator(_regeneratorRuntime().mark(function v(l){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("\u200B/kitchen/api\u200B/sysOrg\u200B/list",{method:"POST",data:_objectSpread({},l)}));case 1:case"end":return a.stop()}},v)})),P.apply(this,arguments)}function Y(v){return k.apply(this,arguments)}function k(){return k=(0,g.Z)((0,I.Z)().mark(function v(l){return(0,I.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,r.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/delete",{method:"POST",data:(0,O.Z)({},l)}));case 1:case"end":return a.stop()}},v)})),k.apply(this,arguments)}function ne(v){return F.apply(this,arguments)}function F(){return F=(0,g.Z)((0,I.Z)().mark(function v(l){return(0,I.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,r.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/edit",{method:"POST",data:(0,O.Z)({},l)}));case 1:case"end":return a.stop()}},v)})),F.apply(this,arguments)}function me(v){return $.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark(function v(l){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/kitchen\u200B/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},l)}));case 1:case"end":return a.stop()}},v)})),$.apply(this,arguments)}function ae(v){return B.apply(this,arguments)}function B(){return B=(0,g.Z)((0,I.Z)().mark(function v(l){return(0,I.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,r.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,O.Z)({},l)}));case 1:case"end":return a.stop()}},v)})),B.apply(this,arguments)}}}]);