|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3946],{40553:function(ke,te,t){"use strict";t.r(te),t.d(te,{default:function(){return Re}});var We=t(57338),de=t(83107),Fe=t(57663),ae=t(71577),a=t(39428),Ye=t(34792),w=t(48086),m=t(3182),ze=t(402),ne=t(56256),S=t(2824),ce=t(49101),pe=t(99165),v=t(67294),he=t(28790),ve=t(85224),re=t(16894),G=t(12826),Ne=t(71194),fe=t(50146),Ve=t(13062),ue=t(71230),He=t(89032),se=t(15746),Ke=t(43358),me=t(34041),ge=t(11849),x=t(48971),I=t(96690);function Ze(s){return N.apply(this,arguments)}function N(){return N=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.zr)()+"/api/devicepushrecode/page",{method:"POST",data:o}));case 1:case"end":return e.stop()}},s)})),N.apply(this,arguments)}function ye(s){return V.apply(this,arguments)}function V(){return V=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.zr)()+"/api/devicepushrecode/add",{method:"POST",data:o}));case 1:case"end":return e.stop()}},s)})),V.apply(this,arguments)}function Se(s){return H.apply(this,arguments)}function H(){return H=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.zr)()+"/api/devicepushrecode/update?id="+o,{method:"GET"}));case 1:case"end":return e.stop()}},s)})),H.apply(this,arguments)}function Ce(s){return K.apply(this,arguments)}function K(){return K=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.zr)()+"/api/devicepushrecode/delete",{method:"POST",data:o}));case 1:case"end":return e.stop()}},s)})),K.apply(this,arguments)}function we(){return U.apply(this,arguments)}function U(){return U=(0,m.Z)((0,a.Z)().mark(function s(){return(0,a.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",(0,x.WY)((0,I.w)()+"/api/device/list",{method:"GET"}));case 1:case"end":return f.stop()}},s)})),U.apply(this,arguments)}function De(s){return M.apply(this,arguments)}function M(){return M=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.w)()+"\u200B/api\u200B/goodstype/tree",{method:"GET",data:(0,ge.Z)({},o)}));case 1:case"end":return e.stop()}},s)})),M.apply(this,arguments)}function le(s){return L.apply(this,arguments)}function L(){return L=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.w)()+"/api/goods/page",{method:"Post",data:o}));case 1:case"end":return e.stop()}},s)})),L.apply(this,arguments)}function Te(s){return X.apply(this,arguments)}function X(){return X=(0,m.Z)((0,a.Z)().mark(function s(o){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)((0,I.w)()+"/api/producttopics/list",{method:"Post",data:o}));case 1:case"end":return e.stop()}},s)})),X.apply(this,arguments)}var n=t(85893),Pe=function(o){var f=(0,v.useState)([]),e=(0,S.Z)(f,2),B=e[0],J=e[1],W=(0,v.useState)([]),F=(0,S.Z)(W,2),$=F[0],T=F[1],Q=(0,v.useState)([]),O=(0,S.Z)(Q,2),p=O[0],j=O[1],q=(0,v.useState)(),A=(0,S.Z)(q,2),R=A[0],Y=A[1],ie=(0,v.useState)(),_=(0,S.Z)(ie,2),b=_[0],k=_[1],ee=(0,v.useState)([]),c=(0,S.Z)(ee,2),r=c[0],l=c[1],g=(0,v.useState)(!1),d=(0,S.Z)(g,2),P=d[0],C=d[1],z=(0,v.useState)([]),oe=(0,S.Z)(z,2),Ee=oe[0],Ge=oe[1],Be=(0,v.useRef)();(0,v.useEffect)(function(){console.log(o.values),we().then(function(Z){l(Z.data);var i=Z.data.map(function(h){return{value:h.id,label:h.name}});J(i)}),De().then(function(Z){Y(Z.data)})},[o.values]);var $e=function(i){le(i).then(function(h){j(h.data.data)})},Oe=function(i){k(i);var h={current:1,pageSize:10,deviceId:i};$e(h);var y=r.find(function(u){return u.id==i});console.log("ddddd",y),Te({productId:y==null?void 0:y.productId,productVesionId:y==null?void 0:y.productVersionId,IsDefault:!0}).then(function(u){Ge(u.data)})},Ue=function(i){b?C(i):w.default.error("\u8BF7\u5148\u9009\u62E9\u8BBE\u5907")},Ae=function(){var Z=(0,m.Z)((0,a.Z)().mark(function i(h){return(0,a.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,ye(h).then(function(D){D.data?(w.default.success("\u64CD\u4F5C\u6210\u529F"),T([]),k()):w.default.error(D.errors),o.HandleOk(D.data)});case 2:case"end":return u.stop()}},i)}));return function(h){return Z.apply(this,arguments)}}(),be=[{title:"\u7F16\u7801",dataIndex:"code",valueType:"textarea",hideInTable:!0,hideInSearch:!0},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeName",valueType:"treeSelect",fieldProps:{showSearch:!0,allowClear:!0,options:R}}];return(0,n.jsxs)(fe.Z,{title:"\u4E0B\u53D1\u6570\u636E",width:1040,visible:o.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",maskClosable:!1,onOk:function(){if(!b)w.default.error("\u8BF7\u9009\u62E9\u8BBE\u5907");else{var i=r.find(function(u){return u.id==b}),h=[];if($.map(function(u){var D={id:u.id,code:u.code,goodsTypeId:u.goodsTypeId,goodsTypeName:u.goodsTypeName,goodsUintId:u.goodsUintId,imgUrl:u.imgUrl,isAttrubute:u.isAttrubute,name:u.name,price:u.price,design:u.design,remark:u.remark};h.push(D)}),h.length==0)w.default.error("\u8BF7\u5148\u9009\u62E9\u5546\u54C1");else{var y={deviceId:i.id,deviceName:i.name,deviceAutoKey:i.autoKey,type:1,data:h,productVersion:i.vesion,productKey:i.prductKey,topicsData:Ee};Ae(y),console.log(i)}}},onCancel:function(){o.onCancel(),T([]),k()},destroyOnClose:!0,children:[(0,n.jsx)(ue.Z,{gutter:26,style:{marginBottom:20},children:(0,n.jsxs)(se.Z,{lg:24,md:24,sm:24,children:["\u9009\u62E9\u8BBE\u5907\uFF1A",(0,n.jsx)(me.Z,{allowClear:!0,style:{width:"60%"},placeholder:"\u8BF7\u9009\u62E9\u8981\u4E0B\u53D1\u8BBE\u5907",onChange:Oe,options:B})]})}),(0,n.jsx)(ue.Z,{gutter:26,children:(0,n.jsxs)(se.Z,{span:24,children:["\u9009\u62E9\u6570\u636E\uFF1A",(0,n.jsx)(re.ZP,{headerTitle:"",actionRef:Be,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},columns:be,request:function(){var Z=(0,m.Z)((0,a.Z)().mark(function i(h){var y,u,D;return(0,a.Z)().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return y=0,u=[],E.next=4,le(h);case 4:return D=E.sent,D.statusCode==200&&(j(D.data.data),u=D.data.data,y=D.data.total),E.abrupt("return",{data:u,success:!0,total:y});case 7:case"end":return E.stop()}},i)}));return function(i){return Z.apply(this,arguments)}}(),rowSelection:{onChange:function(i,h){T(h)}}})]})})]})},xe=Pe,Ie=t(59914),je=function(){var o=(0,v.useState)(!1),f=(0,S.Z)(o,2),e=f[0],B=f[1],J=(0,v.useState)(!1),W=(0,S.Z)(J,2),F=W[0],$=W[1],T=(0,v.useRef)(),Q=(0,v.useState)(),O=(0,S.Z)(Q,2),p=O[0],j=O[1],q=(0,v.useState)([]),A=(0,S.Z)(q,2),R=A[0],Y=A[1],ie=ne.Z.Paragraph,_=ne.Z.Text;(0,v.useEffect)(function(){},[]);var b=function(){var c=(0,m.Z)((0,a.Z)().mark(function r(l){var g;return(0,a.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(g=w.default.loading("\u6B63\u5728\u5220\u9664"),l){P.next=3;break}return P.abrupt("return",!0);case 3:return P.next=5,Ce(l.map(function(C){return C.id})).then(function(C){C.succeeded?(w.default.success("\u5220\u9664\u6210\u529F"),T.current.reload()):w.default.error(C.errors)});case 5:return g(),P.abrupt("return",!0);case 7:case"end":return P.stop()}},r)}));return function(l){return c.apply(this,arguments)}}(),k=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",render:function(r,l){return(0,n.jsx)("a",{onClick:function(){j(l),$(!0)},children:r})}},{title:"\u4E0B\u53D1\u8BBE\u5907",dataIndex:"deviceName",valueType:"textarea",ellipsis:!0},{title:"\u4E0B\u53D1\u72B6\u6001",dataIndex:"status",ellipsis:!0,valueEnum:{1:{text:"\u6210\u529F",status:"Success"},2:{text:"\u5931\u8D25",status:"Processing"}}},{title:"\u4E0B\u53D1\u65F6\u95F4",dataIndex:"createAt",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(r,l){return[(0,n.jsx)("a",{onClick:function(){$(!0),j(l)},children:"\u4E0B\u53D1\u8BE6\u60C5"},"config"),(0,n.jsx)("a",{onClick:function(){Se(l.id).then(function(d){d.data?(w.default.success("\u64CD\u4F5C\u6210\u529F"),T.current.reload()):w.default.error("\u64CD\u4F5C\u5931\u8D25")})},children:"\u91CD\u53D1"},"config")]}}],ee=function(){var c=(0,m.Z)((0,a.Z)().mark(function r(l){return(0,a.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:B(!l),T.current.reload();case 2:case"end":return d.stop()}},r)}));return function(l){return c.apply(this,arguments)}}();return(0,n.jsxs)(he.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,n.jsx)(re.ZP,{headerTitle:"",actionRef:T,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,n.jsxs)(ae.Z,{type:"primary",onClick:function(){B(!0)},children:[(0,n.jsx)(ce.Z,{})," \u4E0B\u53D1\u6570\u636E"]},"primary")]},request:function(){var c=(0,m.Z)((0,a.Z)().mark(function r(l){var g,d;return(0,a.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return g=[],d=0,l.type=1,C.next=5,Ze(l).then(function(z){g=z.data.data,d=z.data.total});case 5:return C.abrupt("return",{data:g,success:!0,total:d});case 6:case"end":return C.stop()}},r)}));return function(r){return c.apply(this,arguments)}}(),columns:k,rowSelection:{onChange:function(r,l){Y(l)}}}),(R==null?void 0:R.length)>0&&(0,n.jsx)(ve.Z,{extra:(0,n.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,n.jsx)("a",{style:{fontWeight:600},children:R.length})," ","\u9879 \xA0\xA0"]}),children:(0,n.jsx)(ae.Z,{onClick:(0,m.Z)((0,a.Z)().mark(function c(){var r,l;return(0,a.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,b(R);case 2:Y([]),(r=T.current)===null||r===void 0||(l=r.reloadAndRest)===null||l===void 0||l.call(r);case 4:case"end":return d.stop()}},c)})),children:"\u5220\u9664"})}),(0,n.jsx)(xe,{onFinish:function(){var c=(0,m.Z)((0,a.Z)().mark(function r(l){return(0,a.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:case"end":return d.stop()}},r)}));return function(r){return c.apply(this,arguments)}}(),onCancel:function(){B(!1),j(void 0)},createModalVisible:e,HandleOk:ee,values:p||{}}),(0,n.jsx)(de.Z,{width:600,visible:F,onClose:function(){j(void 0),$(!1)},closable:!1,children:(p==null?void 0:p.deviceName)&&(0,n.jsxs)(G.ZP,{column:1,title:"\u4E0B\u53D1\u8BE6\u60C5",children:[(0,n.jsx)(G.ZP.Item,{label:"\u4E0B\u53D1\u8BBE\u5907",valueType:"text",children:p==null?void 0:p.deviceName}),(0,n.jsx)(G.ZP.Item,{label:"topic",copyable:!0,valueType:"text",children:p==null?void 0:p.topic}),(0,n.jsx)(G.ZP.Item,{label:"\u4E0B\u53D1\u72B6\u6001",valueType:"text",children:p==null?void 0:p.description}),(0,n.jsx)(G.ZP.Item,{contentStyle:{maxWidth:"85%"},label:"\u4E0B\u53D1\u6570\u636E",children:(0,n.jsxs)("a",{onClick:function(){var r=document.createElement("input");r.value=p.dataResore,document.body.appendChild(r),r.select(),document.execCommand("Copy"),w.default.success("\u590D\u5236\u6210\u529F"),r.remove()},children:[(0,n.jsx)(pe.Z,{}),(0,n.jsx)("div",{style:{width:"500px",overflow:"scroll",overflowX:"auto"},children:(0,n.jsx)(Ie.ZP,{text:p==null?void 0:p.dataResore,valueType:"jsonCode"})})]})})]})})]})},Re=je}}]);
|