No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

2 líneas
14 KiB

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