1 line
2.3 KiB
JavaScript
1 line
2.3 KiB
JavaScript
import{t as e}from"./tag-Bn-IyYw0.js";import{Ca as t,Ea as n,c as r,hn as i,rt as a,s as o,t as s}from"./index-DThTpSPU.js";import{t as c}from"./XinTable-D_6_7i3V.js";t();var l=n(i(),1),u=n(s(),1),d=o(),{Title:f,Text:p}=a;l.default.extend(u.default);var m=()=>{let{t}=r(),n={api:`/forum/comment`,columns:[{title:t(`forum.comment.id`),dataIndex:`id`,hideInForm:!0,sorter:!0,align:`center`,width:80},{title:t(`forum.comment.post_id`),dataIndex:`post_id`,valueType:`text`,align:`center`,required:!0},{title:t(`forum.comment.user_id`),dataIndex:`user_id`,valueType:`text`,align:`center`,required:!0,hideInSearch:!0},{title:t(`forum.comment.parent_id`),dataIndex:`parent_id`,valueType:`text`,align:`center`,hideInSearch:!0},{title:t(`forum.comment.reply_to`),dataIndex:`reply_to`,valueType:`text`,align:`center`,hideInSearch:!0},{title:t(`forum.comment.content`),dataIndex:`content`,valueType:`text`,hideInTable:!0,hideInSearch:!0,required:!0,rules:[{required:!0,message:t(`forum.comment.content.required`)}]},{title:t(`forum.comment.like_count`),dataIndex:`like_count`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:t(`forum.comment.status`),dataIndex:`status`,valueType:`radioButton`,fieldProps:{options:[{value:0,label:t(`forum.comment.status.0`)},{value:1,label:t(`forum.comment.status.1`)}]},render:n=>n===1?(0,d.jsx)(e,{color:`success`,children:t(`forum.comment.status.1`)}):(0,d.jsx)(e,{color:`error`,children:t(`forum.comment.status.0`)}),filters:[{text:t(`forum.comment.status.0`),value:0},{text:t(`forum.comment.status.1`),value:1}],align:`center`},{title:t(`forum.comment.created_at`),hideInForm:!0,hideInSearch:!0,dataIndex:`created_at`,align:`center`,render:e=>e?(0,l.default)(e).fromNow():`-`},{title:t(`forum.comment.updated_at`),hideInForm:!0,hideInSearch:!0,dataIndex:`updated_at`,align:`center`,render:e=>e?(0,l.default)(e).fromNow():`-`}],rowKey:`id`,accessName:`forum.comment`,scroll:{x:1200},formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:[30,0]},layout:`vertical`},modalProps:{width:700},cardProps:{variant:`borderless`},pagination:{size:`small`,style:{marginBottom:0}}};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`mb-5`,children:[(0,d.jsx)(f,{level:3,children:t(`forum.comment.page.title`)}),(0,d.jsx)(p,{type:`secondary`,children:t(`forum.comment.page.description`)})]}),(0,d.jsx)(c,{...n})]})};export{m as default}; |