"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[402],{3176:function(se,j,n){var F=n(75782),y=n(58733),L=n(50959),K=n(72961),w=n(11527),l=["fieldProps","proFieldProps"],N=function(A,T){var G=A.fieldProps,Z=A.proFieldProps,H=(0,y.Z)(A,l);return(0,w.jsx)(K.Z,(0,F.Z)({ref:T,valueType:"textarea",fieldProps:G,proFieldProps:Z},H))};j.Z=L.forwardRef(N)},6849:function(se,j,n){var F=n(24572),y=n(91600),L=n(58733),K=n(99932),w=n(78450),l=n(75782),N=n(27693),q=n(55585),A=n(31479),T=n(35276),G=n(88648),Z=n(18518),H=n(88938),z=n(89839),re=n(26572),x=n(40870),D=n(95027),le=n(53068),ee=n(38365),P=n(50959),ve=n(15797),s=n(11527),ne=["onTableChange","maxLength","formItemProps","recordCreatorProps","rowKey","controlled","defaultValue","onChange","editableFormRef"],oe=["record","position","creatorButtonText","newRecordType","parentKey","style"],te=P.createContext(void 0);function p(e){var h=e.children,B=e.record,S=e.position,Y=e.newRecordType,U=e.parentKey,$=(0,P.useContext)(te);return P.cloneElement(h,(0,l.Z)((0,l.Z)({},h.props),{},{onClick:function(){var I=(0,w.Z)((0,K.Z)().mark(function Q(X){var E,f,d,C;return(0,K.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(E=(f=h.props).onClick)===null||E===void 0?void 0:E.call(f,X);case 2:if(C=t.sent,C!==!1){t.next=5;break}return t.abrupt("return");case 5:$==null||(d=$.current)===null||d===void 0||d.addEditRecord(B,{position:S,newRecordType:Y,parentKey:U});case 6:case"end":return t.stop()}},Q)}));function R(Q){return I.apply(this,arguments)}return R}()}))}function ae(e){var h,B,S=(0,T.YB)(),Y=e.onTableChange,U=e.maxLength,$=e.formItemProps,I=e.recordCreatorProps,R=e.rowKey,Q=e.controlled,X=e.defaultValue,E=e.onChange,f=e.editableFormRef,d=(0,L.Z)(e,ne),C=(0,G.D)(e.value),m=(0,P.useRef)(),t=(0,P.useRef)();(0,P.useImperativeHandle)(d.actionRef,function(){return m.current});var O=(0,D.Z)(function(){return e.value||X||[]},{value:e.value,onChange:e.onChange}),M=(0,y.Z)(O,2),_=M[0],V=M[1],g=P.useMemo(function(){return typeof R=="function"?R:function(v,a){return v[R]||a}},[R]),ce=function(a){if(typeof a=="number"&&!e.name){if(a>=_.length)return a;var r=_&&_[a];return g==null?void 0:g(r,a)}if((typeof a=="string"||a>=_.length)&&e.name){var o=_.findIndex(function(i,u){var c;return(g==null||(c=g(i,u))===null||c===void 0?void 0:c.toString())===(a==null?void 0:a.toString())});return o}return a};(0,P.useImperativeHandle)(f,function(){var v=function(o){var i,u;if(o==null)throw new Error("rowIndex is required");var c=ce(o),b=[e.name,(i=c==null?void 0:c.toString())!==null&&i!==void 0?i:""].flat(1).filter(Boolean);return(u=t.current)===null||u===void 0?void 0:u.getFieldValue(b)},a=function(){var o,i=[e.name].flat(1).filter(Boolean);if(Array.isArray(i)&&i.length===0){var u,c=(u=t.current)===null||u===void 0?void 0:u.getFieldsValue();return Array.isArray(c)?c:Object.keys(c).map(function(b){return c[b]})}return(o=t.current)===null||o===void 0?void 0:o.getFieldValue(i)};return(0,l.Z)((0,l.Z)({},t.current),{},{getRowData:v,getRowsData:a,setRowData:function(o,i){var u,c,b,de;if(o==null)throw new Error("rowIndex is required");var ue=ce(o),Oe=[e.name,(u=ue==null?void 0:ue.toString())!==null&&u!==void 0?u:""].flat(1).filter(Boolean),Re=((c=t.current)===null||c===void 0||(b=c.getFieldsValue)===null||b===void 0?void 0:b.call(c))||{},be=(0,ee.Z)(Re,Oe,(0,l.Z)((0,l.Z)({},v(o)),i||{}));return(de=t.current)===null||de===void 0||de.setFieldsValue(be),!0}})}),(0,P.useEffect)(function(){e.controlled&&_.forEach(function(v,a){var r;(r=t.current)===null||r===void 0||r.setFieldsValue((0,F.Z)({},g(v,a),v))},{})},[_,e.controlled]),(0,P.useEffect)(function(){if(e.name){var v;t.current=e==null||(v=e.editable)===null||v===void 0?void 0:v.form}},[(h=e.editable)===null||h===void 0?void 0:h.form,e.name]);var W=I||{},fe=W.record,_e=W.position,Ee=W.creatorButtonText,Pe=W.newRecordType,he=W.parentKey,De=W.style,Ce=(0,L.Z)(W,oe),me=_e==="top",k=(0,P.useMemo)(function(){return typeof U=="number"&&U<=(_==null?void 0:_.length)?!1:I!==!1&&(0,s.jsx)(p,{record:(0,Z.h)(fe,_==null?void 0:_.length,_)||{},position:_e,parentKey:(0,Z.h)(he,_==null?void 0:_.length,_),newRecordType:Pe,children:(0,s.jsx)(re.ZP,(0,l.Z)((0,l.Z)({type:"dashed",style:(0,l.Z)({display:"block",margin:"10px 0",width:"100%"},De),icon:(0,s.jsx)(N.Z,{})},Ce),{},{children:Ee||S.getMessage("editableTable.action.add","\u6DFB\u52A0\u4E00\u884C\u6570\u636E")}))})},[I,U,_==null?void 0:_.length]),Me=(0,P.useMemo)(function(){return k?me?{components:{header:{wrapper:function(a){var r,o=a.className,i=a.children;return(0,s.jsxs)("thead",{className:o,children:[i,(0,s.jsxs)("tr",{style:{position:"relative"},children:[(0,s.jsx)("td",{colSpan:0,style:{visibility:"hidden"},children:k}),(0,s.jsx)("td",{style:{position:"absolute",left:0,width:"100%"},colSpan:(r=d.columns)===null||r===void 0?void 0:r.length,children:k})]})]})}}}}:{tableViewRender:function(a,r){var o,i;return(0,s.jsxs)(s.Fragment,{children:[(o=(i=e.tableViewRender)===null||i===void 0?void 0:i.call(e,a,r))!==null&&o!==void 0?o:r,k]})}}:{}},[me,k]),ie=(0,l.Z)({},e.editable),ge=(0,H.J)(function(v,a){var r,o,i;if((r=e.editable)===null||r===void 0||(o=r.onValuesChange)===null||o===void 0||o.call(r,v,a),(i=e.onValuesChange)===null||i===void 0||i.call(e,a,v),e.controlled){var u;e==null||(u=e.onChange)===null||u===void 0||u.call(e,a)}});return(e!=null&&e.onValuesChange||(B=e.editable)!==null&&B!==void 0&&B.onValuesChange||e.controlled&&e!==null&&e!==void 0&&e.onChange)&&(ie.onValuesChange=ge),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(te.Provider,{value:m,children:(0,s.jsx)(ve.Z,(0,l.Z)((0,l.Z)((0,l.Z)({search:!1,options:!1,pagination:!1,rowKey:R,revalidateOnFocus:!1},d),Me),{},{tableLayout:"fixed",actionRef:m,onChange:Y,editable:(0,l.Z)((0,l.Z)({},ie),{},{formProps:(0,l.Z)({formRef:t},ie.formProps)}),dataSource:_,onDataSourceChange:function(a){if(V(a),e.name&&_e==="top"){var r,o=(0,ee.Z)({},[e.name].flat(1).filter(Boolean),a);(r=t.current)===null||r===void 0||r.setFieldsValue(o)}}}))}),e.name?(0,s.jsx)(q.Z,{name:[e.name],children:function(a){var r,o,i=(0,le.Z)(a,[e.name].flat(1)),u=i==null?void 0:i.find(function(c,b){return!(0,z.A)(c,C==null?void 0:C[b])});return u&&C&&(e==null||(r=e.editable)===null||r===void 0||(o=r.onValuesChange)===null||o===void 0||o.call(r,u,i)),null}}):null]})}function J(e){var h=A.ZP.useFormInstance();return e.name?(0,s.jsx)(x.Z.Item,(0,l.Z)((0,l.Z)({style:{maxWidth:"100%"}},e==null?void 0:e.formItemProps),{},{name:e.name,children:(0,s.jsx)(ae,(0,l.Z)((0,l.Z)({},e),{},{editable:(0,l.Z)((0,l.Z)({},e.editable),{},{form:h})}))})):(0,s.jsx)(ae,(0,l.Z)({},e))}J.RecordCreator=p,j.Z=J},41300:function(se,j,n){n.r(j);var F=n(25359),y=n.n(F),L=n(49811),K=n.n(L),w=n(57213),l=n.n(w),N=n(12342),q=n.n(N),A=n(54306),T=n.n(A),G=n(12472),Z=n(3176),H=n(6849),z=n(86195),re=n(79112),x=n(50959),D=n(11527),le=["rowData"];j.default=function(){return(0,D.jsx)(G._z,{content:"\u56DE\u590D\u5217\u8868",children:(0,D.jsx)(ee,{})})};var ee=function(ve){var s=(0,x.useState)([]),ne=T()(s,2),oe=ne[0],te=ne[1],p=(0,x.useRef)(),ae=(0,x.useState)(!1),J=T()(ae,2),e=J[0],h=J[1],B=(0,x.useState)(""),S=T()(B,2),Y=S[0],U=S[1],$=(0,x.useState)([]),I=T()($,2),R=I[0],Q=I[1],X=[{title:"\u5E8F\u53F7",dataIndex:"index",key:"index",editable:!1,readonly:!0,width:"5%"},{title:"ID",dataIndex:"id",key:"id",editable:!1,readonly:!0,hideInTable:!0},{title:"\u6635\u79F0",dataIndex:"nickname",key:"nickname"},{title:"\u5E73\u53F0",dataIndex:"platforms",key:"platforms",fieldProps:{mode:"multiple",options:R},valueType:"select"},{title:"\u53F7\u7801",dataIndex:"number",key:"number",width:"13%"},{title:"\u89E6\u53D1\u8BCD",tooltip:"\u652F\u6301\u6B63\u5219\u8868\u8FBE\u5F0F\u3002",dataIndex:"keyword",key:"keyword",width:"15%"},{title:"\u81EA\u52A8\u56DE\u590D\u5185\u5BB9",tooltip:"\u652F\u6301\u4F7F\u7528${b.\u6876.\u952E}\u65B9\u5F0F\u8BBF\u95EE\u5B58\u50A8\uFF0C\u4F8B\uFF1A\u50BB\u599E\u7AEF\u53E3\u662F${b.app.name}\u3002",dataIndex:"value",key:"value",render:function(f){return f.length>30?(0,D.jsx)("a",{onClick:function(){U(f),h(!0)},children:"".concat(f.slice(0,30),"...")}):f},valueType:"textarea",renderFormItem:function(f,d){var C=d.rowData,m=q()(d,le);return(0,D.jsx)(Z.Z,l()(l()({},m),{},{defaultValue:f}))},width:"18%"},{title:"\u4F18\u5148",tooltip:"\u4F18\u5148\u7EA7\uFF0C\u8D8A\u9AD8\u8D8A\u9760\u524D\u5339\u914D\u3002",dataIndex:"priority",key:"priority",valueType:"digit"},{title:"\u64CD\u4F5C",valueType:"option",width:200,render:function(f,d,C,m){return[(0,D.jsx)("a",{onClick:function(){var O;m==null||(O=m.startEditable)===null||O===void 0||O.call(m,d.id)},children:"\u7F16\u8F91"},"editable"),(0,D.jsx)("a",{onClick:function(){(0,z.request)("/api/reply?id="+d.id,{method:"delete"}).then(function(O){var M,_;(M=p.current)===null||M===void 0||(_=M.reloadAndRest)===null||_===void 0||_.call(M)})},children:"\u5220\u9664"},"delete")]}}];return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(re.Z,{title:"",open:e,footer:[],onOk:function(){h(!1)},onCancel:function(){h(!1)},children:Y}),(0,D.jsx)(H.Z,{actionRef:p,pagination:{},rowKey:"id",columns:X,recordCreatorProps:{position:"top",record:function(){return{id:-1,index:0,class:"0"}}},editable:{type:"single",editableKeys:oe,onSave:function(){var E=K()(y()().mark(function d(C,m){var t;return y()().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:t=m,t.class&&(t.class=+t.class),(0,z.request)("/api/reply",{method:"post",data:t}).then(function(_){var V,g;(V=p.current)===null||V===void 0||(g=V.reloadAndRest)===null||g===void 0||g.call(V)});case 3:case"end":return M.stop()}},d)}));function f(d,C){return E.apply(this,arguments)}return f}(),onChange:te},request:K()(y()().mark(function E(){var f,d=arguments;return y()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return f=d.length>0&&d[0]!==void 0?d[0]:{},m.abrupt("return",(0,z.request)("/api/reply/list",{params:f}).then(function(t){if(t.data)for(var O in t.data)t.data[O].class=""+t.data[O].class;return t.platforms&&Q(t.platforms),t}));case 2:case"end":return m.stop()}},E)}))})]})}}}]);