|
@@ -1,4 +1,4 @@
|
|
|
-import { useParams, Link } from "react-router-dom";
|
|
|
|
|
|
|
+import { Link } from "react-router-dom";
|
|
|
import { useIntl } from "react-intl";
|
|
import { useIntl } from "react-intl";
|
|
|
import {
|
|
import {
|
|
|
Button,
|
|
Button,
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
import { PublicityValueEnum } from "../../components/studio/table";
|
|
import { PublicityValueEnum } from "../../components/studio/table";
|
|
|
import { useEffect, useRef, useState } from "react";
|
|
import { useEffect, useRef, useState } from "react";
|
|
|
import ArticleTplMaker from "../../components/article/ArticleTplMaker";
|
|
import ArticleTplMaker from "../../components/article/ArticleTplMaker";
|
|
|
-import ShareModal from "../../components/share/ShareModal";
|
|
|
|
|
import Share, { EResType } from "../../components/share/Share";
|
|
import Share, { EResType } from "../../components/share/Share";
|
|
|
import AddToAnthology from "../../components/article/AddToAnthology";
|
|
import AddToAnthology from "../../components/article/AddToAnthology";
|
|
|
import AnthologySelect from "../../components/anthology/AnthologySelect";
|
|
import AnthologySelect from "../../components/anthology/AnthologySelect";
|
|
@@ -79,10 +78,12 @@ interface DataItem {
|
|
|
interface IWidget {
|
|
interface IWidget {
|
|
|
studioName?: string;
|
|
studioName?: string;
|
|
|
editable?: boolean;
|
|
editable?: boolean;
|
|
|
|
|
+ multiple?: boolean;
|
|
|
onSelect?: Function;
|
|
onSelect?: Function;
|
|
|
}
|
|
}
|
|
|
const ArticleListWidget = ({
|
|
const ArticleListWidget = ({
|
|
|
studioName,
|
|
studioName,
|
|
|
|
|
+ multiple = true,
|
|
|
editable = false,
|
|
editable = false,
|
|
|
onSelect,
|
|
onSelect,
|
|
|
}: IWidget) => {
|
|
}: IWidget) => {
|
|
@@ -340,11 +341,15 @@ const ArticleListWidget = ({
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
]}
|
|
]}
|
|
|
- rowSelection={{
|
|
|
|
|
- // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
|
|
|
|
|
- // 注释该行则默认不显示下拉选项
|
|
|
|
|
- selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ rowSelection={
|
|
|
|
|
+ multiple
|
|
|
|
|
+ ? {
|
|
|
|
|
+ // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
|
|
|
|
|
+ // 注释该行则默认不显示下拉选项
|
|
|
|
|
+ selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
|
|
|
|
|
+ }
|
|
|
|
|
+ : undefined
|
|
|
|
|
+ }
|
|
|
tableAlertRender={({
|
|
tableAlertRender={({
|
|
|
selectedRowKeys,
|
|
selectedRowKeys,
|
|
|
selectedRows,
|
|
selectedRows,
|
|
@@ -377,8 +382,6 @@ const ArticleListWidget = ({
|
|
|
);
|
|
);
|
|
|
}}
|
|
}}
|
|
|
request={async (params = {}, sorter, filter) => {
|
|
request={async (params = {}, sorter, filter) => {
|
|
|
- console.log(params, sorter, filter);
|
|
|
|
|
- console.log("anthology", anthologyId);
|
|
|
|
|
let url = `/v2/article?view=studio&view2=${activeKey}&name=${studioName}`;
|
|
let url = `/v2/article?view=studio&view2=${activeKey}&name=${studioName}`;
|
|
|
const offset =
|
|
const offset =
|
|
|
((params.current ? params.current : 1) - 1) *
|
|
((params.current ? params.current : 1) - 1) *
|
|
@@ -390,7 +393,6 @@ const ArticleListWidget = ({
|
|
|
url += "&anthology=" + anthologyId;
|
|
url += "&anthology=" + anthologyId;
|
|
|
}
|
|
}
|
|
|
const res = await get<IArticleListResponse>(url);
|
|
const res = await get<IArticleListResponse>(url);
|
|
|
- console.log("article list", res);
|
|
|
|
|
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);
|
|
const date = new Date(item.created_at);
|
|
|
return {
|
|
return {
|