|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4978,7975,1322,5284,1915,9130,5081],{3408:function(N,I,t){"use strict";t.d(I,{lM:function(){return R},IH:function(){return G},mm:function(){return C},eP:function(){return W},FM:function(){return j}});var h=t(39428),D=t(11849),i=t(3182),f=t(48971);function R(a,u){return E.apply(this,arguments)}function E(){return E=(0,i.Z)((0,h.Z)().mark(function a(u,w){return(0,h.Z)().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.abrupt("return",(0,f.WY)("/kitchen/api/sysOrg\u200B/page",{method:"GET",params:(0,D.Z)({},u)}));case 1:case"end":return _.stop()}},a)})),E.apply(this,arguments)}function G(a){return v.apply(this,arguments)}function v(){return v=(0,i.Z)((0,h.Z)().mark(function a(u){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,f.WY)("/kitchen/api/sysOrg/add",{method:"POST",data:(0,D.Z)({},u)}));case 1:case"end":return e.stop()}},a)})),v.apply(this,arguments)}function Q(a){return P.apply(this,arguments)}function P(){return P=_asyncToGenerator(_regeneratorRuntime().mark(function a(u){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("\u200B/kitchen/api\u200B/sysOrg\u200B/list",{method:"POST",data:_objectSpread({},u)}));case 1:case"end":return e.stop()}},a)})),P.apply(this,arguments)}function C(a){return p.apply(this,arguments)}function p(){return p=(0,i.Z)((0,h.Z)().mark(function a(u){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/delete",{method:"POST",data:(0,D.Z)({},u)}));case 1:case"end":return e.stop()}},a)})),p.apply(this,arguments)}function W(a){return T.apply(this,arguments)}function T(){return T=(0,i.Z)((0,h.Z)().mark(function a(u){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/edit",{method:"POST",data:(0,D.Z)({},u)}));case 1:case"end":return e.stop()}},a)})),T.apply(this,arguments)}function K(a){return O.apply(this,arguments)}function O(){return O=_asyncToGenerator(_regeneratorRuntime().mark(function a(u){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/kitchen\u200B/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},u)}));case 1:case"end":return e.stop()}},a)})),O.apply(this,arguments)}function j(a){return b.apply(this,arguments)}function b(){return b=(0,i.Z)((0,h.Z)().mark(function a(u){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,D.Z)({},u)}));case 1:case"end":return e.stop()}},a)})),b.apply(this,arguments)}},6025:function(N,I,t){"use strict";t.r(I),t.d(I,{default:function(){return J}});var h=t(58024),D=t(91894),i=t(39428),f=t(3182),R=t(34792),E=t(48086),G=t(11849),v=t(2824),Q=t(43358),P=t(34041),C=t(78009),p=t(67294),W=t(53779),T=t(48971);function K(o){return O.apply(this,arguments)}function O(){return O=(0,f.Z)((0,i.Z)().mark(function o(Z){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,T.WY)("/kitchen/api/Device/GetDeviceInfoPage",{method:"POST",data:Z}));case 1:case"end":return r.stop()}},o)})),O.apply(this,arguments)}function j(o){return b.apply(this,arguments)}function b(){return b=(0,f.Z)((0,i.Z)().mark(function o(Z){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,T.WY)("/kitchen/api/dict-data/dic-list/".concat(Z),{method:"Get"}));case 1:case"end":return r.stop()}},o)})),b.apply(this,arguments)}function a(o){return u.apply(this,arguments)}function u(){return u=(0,f.Z)((0,i.Z)().mark(function o(Z){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,T.WY)("\u200B/kitchen/api/Device/GetDeviceType",{method:"GET"}));case 1:case"end":return r.stop()}},o)})),u.apply(this,arguments)}function w(){return e.apply(this,arguments)}function e(){return e=_asyncToGenerator(_regeneratorRuntime().mark(function o(){return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.abrupt("return",request("/kitchen/api/Device/StoreDeviceTree",{method:"GET"}));case 1:case"end":return m.stop()}},o)})),e.apply(this,arguments)}function _(o){return L.apply(this,arguments)}function L(){return L=(0,f.Z)((0,i.Z)().mark(function o(Z){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,T.WY)("/kitchen/api/Device/UpdateDeviceInfo",{method:"POST",data:Z}));case 1:case"end":return r.stop()}},o)})),L.apply(this,arguments)}var V=t(3408),A=t(85893),Se=P.Z.Option,De=P.Z.OptGroup,z=function(Z){console.log(1),console.log(Z);var m=(0,p.useRef)(),r=(0,p.useState)(),$=(0,v.Z)(r,2),X=$[0],q=$[1],ee=(0,p.useState)([]),M=(0,v.Z)(ee,2),Oe=M[0],te=M[1],ae=(0,p.useState)([]),x=(0,v.Z)(ae,2),be=x[0],re=x[1],ne=(0,p.useState)([]),B=(0,v.Z)(ne,2),ue=B[0],se=B[1],ie=(0,p.useState)([]),Y=(0,v.Z)(ie,2),ce=Y[0],le=Y[1],oe=(0,p.useState)([]),U=(0,v.Z)(oe,2),we=U[0],pe=U[1];(0,p.useEffect)(function(){var S=function(){a().then(function(s){var l={},d=[];s.data.forEach(function(n){d.push({text:n.name,id:n.id}),l[n.id]={text:n.name}}),te(d),q(l)})};function g(){(0,V.FM)().then(function(c){re(c.data);var s={};l(c.data);function l(d){for(var n in d)s[d[n].value]={text:d[n].title},d[n].children&&l(d[n].children)}se(s)})}g(),S();function y(){j("DeviceClientType").then(function(c){var s=c.data,l={};if(c.succeeded){var d=[];s.forEach(function(n){l[n.code]={text:n.code},d.push({code:n.code,value:n.code})}),le(l),pe(d)}})}y()},[]);var de=(0,p.useState)({operationKey:"basis",tabActiveKey:"basis"}),F=(0,v.Z)(de,2),H=F[0],he=F[1],fe=function(g){he((0,G.Z)((0,G.Z)({},H),{},{operationKey:g}))},ve=[{key:"basis",tab:"\u5E97\u94FA\u7BA1\u7406"}],me=[{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:ce},{title:"\u5F52\u5C5E\u95E8\u5E97",dataIndex:"orgId",search:!1,valueEnum:ue},{title:"\u8BBE\u5907\u5730\u5740",dataIndex:"deviceAddr",search:!1,valueType:"textarea"},{title:"\u8BBE\u5907\u5206\u7C7B",dataIndex:"deviceTypeId",valueEnum:X},{title:"\u5750\u6807",dataIndex:"deviceLoc",valueType:"textarea",search:!1},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(g,y){return[(0,A.jsx)("a",{type:"primary",onClick:function(){y.status=y.status==0?1:0,_(y).then(function(s){s.data?m.current.reload():E.default.error("\u66F4\u65B0\u5931\u8D25")})},children:y.status==1?"\u542F\u7528":"\u7981\u7528"},"primary")]}}],ge={basis:(0,A.jsx)(D.Z,{title:"\u5E97\u94FA\u7BA1\u7406",style:{marginBottom:24},bordered:!1,children:(0,A.jsx)(W.ZP,{actionRef:m,rowKey:"id",search:!1,request:function(){var S=(0,f.Z)((0,i.Z)().mark(function g(y){var c,s,l;return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return c=[],s=[],l=0,n.next=5,K(y).then(function(Ze){var Te=ye(window.location.search,"values");c=Ze.data.data;for(var k=0;k<c.length;k++)c[k].orgId==Te&&s.push(c[k]);l=s.length});case 5:return n.abrupt("return",{data:s,success:!0,total:l});case 6:case"end":return n.stop()}},g)}));return function(g){return S.apply(this,arguments)}}(),columns:me})})};function ye(S,g){if(!S||!g)return null;for(var y=S.substring(1),c=y.split("&"),s=0;s<c.length;s++){var l=c[s].split("=");if(l[0]===g)return l[1]}return null}return(0,A.jsx)(C.ZP,{title:"\u5E97\u94FA\u7BA1\u7406",onTabChange:fe,tabList:ve,children:ge[H.operationKey]})},J=z}}]);
|