|
@@ -1,7 +1,7 @@
|
|
|
import { ActionType, ProTable } from "@ant-design/pro-components";
|
|
import { ActionType, ProTable } from "@ant-design/pro-components";
|
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
|
import { Link } from "react-router-dom";
|
|
import { Link } from "react-router-dom";
|
|
|
-import { Alert, Badge, message, Modal, Typography } from "antd";
|
|
|
|
|
|
|
+import { Alert, Badge, message, Modal, Progress, Typography } from "antd";
|
|
|
import { Button, Dropdown, Popover } from "antd";
|
|
import { Button, Dropdown, Popover } from "antd";
|
|
|
import {
|
|
import {
|
|
|
PlusOutlined,
|
|
PlusOutlined,
|
|
@@ -77,7 +77,7 @@ export const renderBadge = (count: number, active = false) => {
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-interface IChapter {
|
|
|
|
|
|
|
+export interface IChapter {
|
|
|
book: number;
|
|
book: number;
|
|
|
paragraph: number;
|
|
paragraph: number;
|
|
|
}
|
|
}
|
|
@@ -91,6 +91,7 @@ interface IChannelItem {
|
|
|
role?: TRole;
|
|
role?: TRole;
|
|
|
studio?: IStudio;
|
|
studio?: IStudio;
|
|
|
publicity: number;
|
|
publicity: number;
|
|
|
|
|
+ progress?: number;
|
|
|
created_at: string;
|
|
created_at: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -243,6 +244,22 @@ const ChannelTableWidget = ({
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: intl.formatMessage({
|
|
|
|
|
+ id: "dict.fields.createdAt.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ key: "progress",
|
|
|
|
|
+ hideInTable: typeof chapter === "undefined",
|
|
|
|
|
+ render(dom, entity, index, action, schema) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <Progress
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ percent={Math.floor((entity.progress ?? 0) * 100)}
|
|
|
|
|
+ style={{ width: 150 }}
|
|
|
|
|
+ />
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
title: intl.formatMessage({
|
|
title: intl.formatMessage({
|
|
|
id: "forms.fields.summary.label",
|
|
id: "forms.fields.summary.label",
|
|
@@ -404,7 +421,7 @@ const ChannelTableWidget = ({
|
|
|
url += `view=studio&view2=${activeKey}&name=${studioName}`;
|
|
url += `view=studio&view2=${activeKey}&name=${studioName}`;
|
|
|
}
|
|
}
|
|
|
if (chapter) {
|
|
if (chapter) {
|
|
|
- url += `&chapter=${chapter.book}-${chapter.paragraph}`;
|
|
|
|
|
|
|
+ url += `&book=${chapter.book}¶graph=${chapter.paragraph}`;
|
|
|
}
|
|
}
|
|
|
const offset =
|
|
const offset =
|
|
|
((params.current ? params.current : 1) - 1) *
|
|
((params.current ? params.current : 1) - 1) *
|
|
@@ -414,7 +431,12 @@ const ChannelTableWidget = ({
|
|
|
url += collaborator ? "&collaborator=" + collaborator : "";
|
|
url += collaborator ? "&collaborator=" + collaborator : "";
|
|
|
url += params.keyword ? "&search=" + params.keyword : "";
|
|
url += params.keyword ? "&search=" + params.keyword : "";
|
|
|
url += channelType ? "&type=" + channelType : "";
|
|
url += channelType ? "&type=" + channelType : "";
|
|
|
- url += getSorterUrl(sorter);
|
|
|
|
|
|
|
+ if (chapter && activeKey === "community") {
|
|
|
|
|
+ url += "&order=progress";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ url += getSorterUrl(sorter);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
console.log("url", url);
|
|
console.log("url", url);
|
|
|
const res: IApiResponseChannelList = await get(url);
|
|
const res: IApiResponseChannelList = await get(url);
|
|
|
const items: IChannelItem[] = res.data.rows.map((item, id) => {
|
|
const items: IChannelItem[] = res.data.rows.map((item, id) => {
|
|
@@ -425,6 +447,7 @@ const ChannelTableWidget = ({
|
|
|
summary: item.summary,
|
|
summary: item.summary,
|
|
|
type: item.type,
|
|
type: item.type,
|
|
|
role: item.role,
|
|
role: item.role,
|
|
|
|
|
+ progress: item.progress,
|
|
|
studio: item.studio,
|
|
studio: item.studio,
|
|
|
publicity: item.status,
|
|
publicity: item.status,
|
|
|
created_at: item.created_at,
|
|
created_at: item.created_at,
|