"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[81],{38146:function(H,C,e){e.r(C);var B=e(25359),A=e.n(B),R=e(49811),T=e.n(R),I=e(54306),p=e.n(I),x=e(25367),K=e(34316),O=e(87474),U=e(12472),L=e(12817),j=e(64619),c=e(86195),S=e(833),W=e(46370),m=e(50959),l=e(11527),E="noReplyGroups";C.default=function(){var f,Z=(0,m.useState)([]),M=p()(Z,2),k=M[0],G=M[1],$=(0,m.useState)([{id:"empty"}]),g=p()($,2),d=g[0],v=g[1],J=(0,m.useState)("bottom"),h=p()(J,2),D=h[0],N=h[1],P=(0,c.useRequest)(function(){return(0,c.request)("/api/storage",{params:{keys:[E].join(",")}})}),y=P.data,z=P.error,V=P.loading;if(V)return(0,l.jsx)(x.Z,{});if(z)return(0,K.Z)(),null;if(((f=d[0])===null||f===void 0?void 0:f.id)=="empty"){var F=[],i=Object.keys(y).map(function(n){var a=n.split(".")[1];F.push("nickname."+a);try{n=JSON.parse(y[n])}catch(u){n={}}return n.id=a,n});(0,c.request)("/api/storage",{params:{keys:F.join(",")}}).then(function(n){if(n.data)for(var a in n.data){var u=a.split(".")[1];for(var t in i)if(i[t].id==u)try{var _=JSON.parse(n.data[a]),r=_.v,o=_.p;r&&(i[t].nickname=r,i[t].platform=o)}catch(s){}}v(i)})}var w=[{title:"\u7FA4\u53F7",dataIndex:"id",width:"15%"},{title:"\u7FA4\u79F0",dataIndex:"nickname",width:"15%",readonly:!0},{title:"\u5E73\u53F0",width:"15%",dataIndex:"platform",valueType:"select",readonly:!0},{title:"\u5907\u6CE8",dataIndex:"decs",fieldProps:function(a,u){var t=u.rowKey,_=u.rowIndex;return a.getFieldValue([t||"","title"])==="\u4E0D\u597D\u73A9"?{disabled:!0}:_>9?{disabled:!0}:{}}},{title:"\u72B6\u6001",dataIndex:"enable",valueType:"switch",width:"10%",render:function(a,u){var t;return(0,l.jsx)(S.Z,{disabled:!0,defaultChecked:(t=d.find(function(_){return _.id==u.id}))===null||t===void 0?void 0:t.enable})}},{title:"\u64CD\u4F5C",valueType:"option",width:200,render:function(a,u,t,_){return[(0,l.jsx)("a",{onClick:function(){var o;_==null||(o=_.startEditable)===null||o===void 0||o.call(_,u.id)},children:"\u7F16\u8F91"},"editable"),(0,l.jsx)("a",{onClick:function(){v(d.filter(function(s){return s.id!==u.id}));var o={};o[E+"."+u.id]="",(0,O.Z)(o)},children:"\u5220\u9664"},"delete")]}}];return(0,l.jsxs)(U._z,{children:[(0,l.jsx)(W.Z,{style:{marginBottom:"10px"},message:"\u9ED8\u8BA4\u6D88\u606F\u88AB\u5904\u7406\u662F\u53EF\u4EE5\u505A\u51FA\u56DE\u590D\u7684\uFF0C\u5982\u679C\u4F60\u5E0C\u671B\u673A\u5668\u4EBA\u53EA\u5728\u7FA4\u804A\u4E2D\u76D1\u542C\u6D88\u606F\uFF0C\u62C5\u5FC3\u5728\u7FA4\u91CC\u81EA\u52A8\u53D1\u8A00\u800C\u66B4\u9732\u88AB\u8E22\u5C31\u53EF\u4EE5\u628A\u7FA4\u804A\u52A0\u5165\u5230\u8FD9\u91CC\uFF0C\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5728\u7FA4\u804A\u4E2D\u4F7F\u7528reply\u548Cnoreply\u5F00\u542F\u548C\u5173\u95ED\u3002",type:"info",closeText:"\u5173\u95ED"}),(0,l.jsx)(L.Z,{rowKey:"id",maxLength:1005,scroll:{x:960},recordCreatorProps:D!=="hidden"?{position:D,record:function(){return{id:""+(Math.random()*1e6).toFixed(0)}}}:!1,loading:!1,toolBarRender:function(){return[(0,l.jsx)(j.Z.Group,{fieldProps:{value:D,onChange:function(u){N(u.target.value)}},options:[{label:"\u6DFB\u52A0\u5230\u9876\u90E8",value:"top"},{label:"\u6DFB\u52A0\u5230\u5E95\u90E8",value:"bottom"},{label:"\u9690\u85CF",value:"hidden"}]},"render")]},columns:w,value:d,onChange:v,editable:{type:"multiple",editableKeys:k,onSave:function(){var n=T()(A()().mark(function u(t,_){var r;return A()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:r={},t!=_.id&&(r[E+"."+t]=""),r[E+"."+_.id]=JSON.stringify(_),(0,O.Z)(r),v(d.map(function(b){return b.id==t?_:b}));case 5:case"end":return s.stop()}},u)}));function a(u,t){return n.apply(this,arguments)}return a}(),onChange:G}})]})}}}]);
