|
@@ -33,12 +33,14 @@ interface IWidget {
|
|
|
onEdit?: Function;
|
|
onEdit?: Function;
|
|
|
onSelect?: Function;
|
|
onSelect?: Function;
|
|
|
onDelete?: Function;
|
|
onDelete?: Function;
|
|
|
|
|
+ onReply?: Function;
|
|
|
}
|
|
}
|
|
|
const DiscussionShowWidget = ({
|
|
const DiscussionShowWidget = ({
|
|
|
data,
|
|
data,
|
|
|
onEdit,
|
|
onEdit,
|
|
|
onSelect,
|
|
onSelect,
|
|
|
onDelete,
|
|
onDelete,
|
|
|
|
|
+ onReply,
|
|
|
}: IWidget) => {
|
|
}: IWidget) => {
|
|
|
const intl = useIntl();
|
|
const intl = useIntl();
|
|
|
const showDeleteConfirm = (id: string, title: string) => {
|
|
const showDeleteConfirm = (id: string, title: string) => {
|
|
@@ -91,6 +93,11 @@ const DiscussionShowWidget = ({
|
|
|
message.success("链接地址已经拷贝到剪贴板");
|
|
message.success("链接地址已经拷贝到剪贴板");
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "reply":
|
|
|
|
|
+ if (typeof onReply !== "undefined") {
|
|
|
|
|
+ onReply();
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
case "edit":
|
|
case "edit":
|
|
|
if (typeof onEdit !== "undefined") {
|
|
if (typeof onEdit !== "undefined") {
|
|
|
onEdit();
|
|
onEdit();
|
|
@@ -109,12 +116,16 @@ const DiscussionShowWidget = ({
|
|
|
const items: MenuProps["items"] = [
|
|
const items: MenuProps["items"] = [
|
|
|
{
|
|
{
|
|
|
key: "copy-link",
|
|
key: "copy-link",
|
|
|
- label: "复制链接",
|
|
|
|
|
|
|
+ label: intl.formatMessage({
|
|
|
|
|
+ id: "buttons.copy.link",
|
|
|
|
|
+ }),
|
|
|
icon: <LinkOutlined />,
|
|
icon: <LinkOutlined />,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
key: "reply",
|
|
key: "reply",
|
|
|
- label: "回复",
|
|
|
|
|
|
|
+ label: intl.formatMessage({
|
|
|
|
|
+ id: "buttons.reply",
|
|
|
|
|
+ }),
|
|
|
icon: <CommentOutlined />,
|
|
icon: <CommentOutlined />,
|
|
|
disabled: data.parent ? true : false,
|
|
disabled: data.parent ? true : false,
|
|
|
},
|
|
},
|
|
@@ -123,12 +134,16 @@ const DiscussionShowWidget = ({
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
key: "edit",
|
|
key: "edit",
|
|
|
- label: "编辑",
|
|
|
|
|
|
|
+ label: intl.formatMessage({
|
|
|
|
|
+ id: "buttons.edit",
|
|
|
|
|
+ }),
|
|
|
icon: <EditOutlined />,
|
|
icon: <EditOutlined />,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
key: "delete",
|
|
key: "delete",
|
|
|
- label: "删除",
|
|
|
|
|
|
|
+ label: intl.formatMessage({
|
|
|
|
|
+ id: "buttons.delete",
|
|
|
|
|
+ }),
|
|
|
icon: <DeleteOutlined />,
|
|
icon: <DeleteOutlined />,
|
|
|
danger: true,
|
|
danger: true,
|
|
|
disabled: data.childrenCount ? true : false,
|
|
disabled: data.childrenCount ? true : false,
|
|
@@ -151,7 +166,7 @@ const DiscussionShowWidget = ({
|
|
|
strong
|
|
strong
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
|
if (typeof onSelect !== "undefined") {
|
|
if (typeof onSelect !== "undefined") {
|
|
|
- onSelect(e, data);
|
|
|
|
|
|
|
+ onSelect(e);
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|