"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2871],{85968:function(b,D,a){var P=a(23674),u=a(62086),O=function(v){var d=(0,P.useModel)("@@initialState"),h=d.initialState,R=d.loading,C=d.error,j=d.refresh,A=d.setInitialState,p=h==null?void 0:h.authPermissionAction;if(!p)return(0,u.jsx)("span",{children:v.children});var f=p.indexOf(v.action);return f>=0?(0,u.jsx)("span",{children:v.children}):(0,u.jsx)(u.Fragment,{})};D.Z=O},76020:function(b,D,a){a.r(D);var P=a(57213),u=a.n(P),O=a(25359),o=a.n(O),v=a(49811),d=a.n(v),h=a(54306),R=a.n(h),C=a(93236),j=a(23674),A=a(71516),p=a(61385),f=a(14649),g=a(51676),L=a(50336),W=a(87708),I=a(85968),S=a(90627),r=a(62086),M=S.Z.ArticleController,$=M.articleItems,Z=M.articleCreate,F=M.articleDelete,w=M.articleUpdate;D.default=function(){var E=(0,C.useRef)(),x={id:"",cid:1,is_up:1,title:"",cover:"",video:"",note:null},z=(0,C.useState)(x),T=R()(z,2),Q=T[0],U=T[1],G=(0,C.useState)(),K=R()(G,2),y=K[0],H=K[1],J=function(){var i=d()(o()().mark(function t(e){var l,s,_;return o()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,F(e);case 2:l=n.sent,s=l.success,s&&(E.current.clearSelected(),(_=E.current)===null||_===void 0||_.reload());case 5:case"end":return n.stop()}},t)}));return function(e){return i.apply(this,arguments)}}(),V=function(){var i=d()(o()().mark(function t(e){var l,s,_;return o()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return U(e),n.next=3,Z(u()({},e));case 3:l=n.sent,s=l.success,s&&(U(x),(_=E.current)===null||_===void 0||_.reload(),setCreateFormModal(!1));case 6:case"end":return n.stop()}},t)}));return function(e){return i.apply(this,arguments)}}(),X=function(){var i=d()(o()().mark(function t(e){var l,s,_;return o()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,w(u()({},e));case 2:l=n.sent,s=l.success,s&&((_=E.current)===null||_===void 0||_.reload(),setUpdateFormModal(!1));case 5:case"end":return n.stop()}},t)}));return function(e){return i.apply(this,arguments)}}(),N=[{title:"ID",dataIndex:"id",search:!1},{title:"\u5206\u7C7B",dataIndex:"c",search:!1,render:function(t,e){var l;return e!=null&&e.c?e==null||(l=e.c)===null||l===void 0?void 0:l.name:""}},{title:"\u6807\u9898",dataIndex:"title",search:!1},{title:"\u5C01\u9762\u56FE",dataIndex:"cover",valueType:"avatar",search:!1,render:function(t,e){return e!=null&&e.cover?(0,r.jsx)(A.Z,{width:100,src:e==null?void 0:e.cover}):""}},{title:"\u89C6\u9891",dataIndex:"video",search:!1,render:function(t,e){return e!=null&&e.video?(0,r.jsx)("video",{width:"200px",controls:"controls",src:e==null?void 0:e.video,direction:"90"}):""}},{title:"\u53D1\u5E03\u72B6\u6001",dataIndex:"is_up",search:!1,render:function(t,e){return(0,r.jsx)(r.Fragment,{children:y==null?void 0:y.is_up[e==null?void 0:e.is_up]})}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"created_at",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(t,e){return(0,r.jsxs)(p.Z,{children:[(0,r.jsx)(I.Z,{action:"admin/article/update",children:(0,r.jsx)(f.ZP,{type:"link",onClick:function(){j.history.push("article/".concat(e.id,"/update"))},children:"\u7F16\u8F91"})},"admin/article/update"),(0,r.jsx)(I.Z,{action:"admin/article/delete",children:(0,r.jsx)(g.Z,{title:"\u786E\u8BA4\u5220\u9664\uFF1F",onConfirm:function(){J({id:e.id})},children:(0,r.jsx)(f.ZP,{type:"link",danger:!0,children:"\u5220\u9664"})})},"admin/article/delete")]})}}];return(0,r.jsx)(L._z,{ghost:!0,children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(W.Z,{actionRef:E,rowKey:"id",search:{defaultCollapsed:!1},toolBarRender:function(){return[(0,r.jsx)(I.Z,{action:"admin/article/create",children:(0,r.jsx)(f.ZP,{type:"primary",onClick:function(){j.history.push("article/0/create")},children:"\u6DFB\u52A0"})},"admin/article/create")]},request:function(){var i=d()(o()().mark(function t(e,l,s){var _,c,n,B;return o()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,$(u()(u()({},e),{},{sorter:l,filter:s}));case 2:return c=m.sent,n=c.data,B=c.success,H(n==null?void 0:n.config),m.abrupt("return",{data:(n==null||(_=n.items)===null||_===void 0?void 0:_.data)||[],total:n==null?void 0:n.total,success:B});case 7:case"end":return m.stop()}},t)}));return function(t,e,l){return i.apply(this,arguments)}}(),columns:N,tableAlertRender:function(t){var e=t.selectedRowKeys,l=t.selectedRows,s=t.onCleanSelected;return(0,r.jsxs)(p.Z,{size:24,children:[(0,r.jsxs)("span",{children:["\u5DF2\u9009 ",e.length," \u9879"]}),(0,r.jsx)("span",{children:(0,r.jsx)("a",{style:{marginInlineStart:8},onClick:s,children:"\u53D6\u6D88\u9009\u62E9"})})]})},tableAlertOptionRender:function(t){var e=t.selectedRowKeys,l=t.selectedRows,s=t.onCleanSelected},pagination:{showSizeChanger:!0}})})})}}}]);
