|
@@ -35,6 +35,7 @@ import AddToAnthology from "../../components/article/AddToAnthology";
|
|
|
import AnthologySelect from "../../components/anthology/AnthologySelect";
|
|
import AnthologySelect from "../../components/anthology/AnthologySelect";
|
|
|
import StudioName, { IStudio } from "../../components/auth/StudioName";
|
|
import StudioName, { IStudio } from "../../components/auth/StudioName";
|
|
|
import { IUser } from "../../components/auth/User";
|
|
import { IUser } from "../../components/auth/User";
|
|
|
|
|
+import { getSorterUrl } from "../../utils";
|
|
|
|
|
|
|
|
const { Text } = Typography;
|
|
const { Text } = Typography;
|
|
|
|
|
|
|
@@ -70,9 +71,9 @@ interface DataItem {
|
|
|
anthologyCount?: number;
|
|
anthologyCount?: number;
|
|
|
anthologyTitle?: string;
|
|
anthologyTitle?: string;
|
|
|
publicity: number;
|
|
publicity: number;
|
|
|
- createdAt: number;
|
|
|
|
|
studio?: IStudio;
|
|
studio?: IStudio;
|
|
|
editor?: IUser;
|
|
editor?: IUser;
|
|
|
|
|
+ updated_at?: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface IWidget {
|
|
interface IWidget {
|
|
@@ -251,14 +252,14 @@ const ArticleListWidget = ({
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: intl.formatMessage({
|
|
title: intl.formatMessage({
|
|
|
- id: "forms.fields.created-at.label",
|
|
|
|
|
|
|
+ id: "forms.fields.updated-at.label",
|
|
|
}),
|
|
}),
|
|
|
- key: "created-at",
|
|
|
|
|
|
|
+ key: "updated_at",
|
|
|
width: 100,
|
|
width: 100,
|
|
|
search: false,
|
|
search: false,
|
|
|
- dataIndex: "createdAt",
|
|
|
|
|
|
|
+ dataIndex: "updated_at",
|
|
|
valueType: "date",
|
|
valueType: "date",
|
|
|
- sorter: (a, b) => a.createdAt - b.createdAt,
|
|
|
|
|
|
|
+ sorter: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: intl.formatMessage({ id: "buttons.option" }),
|
|
title: intl.formatMessage({ id: "buttons.option" }),
|
|
@@ -386,17 +387,20 @@ const ArticleListWidget = ({
|
|
|
const offset =
|
|
const offset =
|
|
|
((params.current ? params.current : 1) - 1) *
|
|
((params.current ? params.current : 1) - 1) *
|
|
|
(params.pageSize ? params.pageSize : 10);
|
|
(params.pageSize ? params.pageSize : 10);
|
|
|
|
|
+
|
|
|
url += `&limit=${params.pageSize}&offset=${offset}`;
|
|
url += `&limit=${params.pageSize}&offset=${offset}`;
|
|
|
url += params.keyword ? "&search=" + params.keyword : "";
|
|
url += params.keyword ? "&search=" + params.keyword : "";
|
|
|
|
|
|
|
|
if (typeof anthologyId !== "undefined") {
|
|
if (typeof anthologyId !== "undefined") {
|
|
|
url += "&anthology=" + anthologyId;
|
|
url += "&anthology=" + anthologyId;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ url += getSorterUrl(sorter);
|
|
|
|
|
+
|
|
|
const res = await get<IArticleListResponse>(url);
|
|
const res = await get<IArticleListResponse>(url);
|
|
|
const items: DataItem[] = res.data.rows.map((item, id) => {
|
|
const items: DataItem[] = res.data.rows.map((item, id) => {
|
|
|
- const date = new Date(item.created_at);
|
|
|
|
|
return {
|
|
return {
|
|
|
- sn: id + 1,
|
|
|
|
|
|
|
+ sn: id + offset + 1,
|
|
|
id: item.uid,
|
|
id: item.uid,
|
|
|
title: item.title,
|
|
title: item.title,
|
|
|
subtitle: item.subtitle,
|
|
subtitle: item.subtitle,
|
|
@@ -404,7 +408,7 @@ const ArticleListWidget = ({
|
|
|
anthologyCount: item.anthology_count,
|
|
anthologyCount: item.anthology_count,
|
|
|
anthologyTitle: item.anthology_first?.title,
|
|
anthologyTitle: item.anthology_first?.title,
|
|
|
publicity: item.status,
|
|
publicity: item.status,
|
|
|
- createdAt: date.getTime(),
|
|
|
|
|
|
|
+ updated_at: item.updated_at,
|
|
|
studio: item.studio,
|
|
studio: item.studio,
|
|
|
editor: item.editor,
|
|
editor: item.editor,
|
|
|
};
|
|
};
|