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