|
|
@@ -2,12 +2,12 @@ import { ActionType, BetaSchemaForm, PageContainer, ProFormInstance } from "@ant
|
|
|
import { columns } from "./tableConfig"
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
import { useModel } from "@umijs/max"
|
|
|
-import { shortBookInfoList, shortBookInfoParagraphList, shortBookInfoBookConfig, shortBookInfoConfig, shortBookInfoParagraphAllList, sysRechargeGetInfo, sysRechargeAddOrEdit, shortBookInfoShelve } from "@/services/miniApp/bookManage"
|
|
|
+import { shortBookInfoList, shortBookInfoParagraphList, shortBookInfoBookConfig, shortBookInfoConfig, shortBookInfoParagraphAllList, sysRechargeGetInfo, sysRechargeAddOrEdit, shortBookInfoShelve, apiSubmitToTencent, apiRefreshSubmitResult } from "@/services/miniApp/bookManage"
|
|
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
|
import { Button, Card, Drawer, message, Popconfirm, Space, Tag } from "antd"
|
|
|
import ReadText from "../components/readText"
|
|
|
import formConfig from "./formConfig"
|
|
|
-import { ColumnHeightOutlined, EditFilled } from "@ant-design/icons"
|
|
|
+import { ColumnHeightOutlined, EditFilled, SendOutlined } from "@ant-design/icons"
|
|
|
import MyProTable from "@/components/MyProTable"
|
|
|
const wordCountRanges: any = {
|
|
|
"": { start: null, end: null }, // 全部
|
|
|
@@ -55,6 +55,9 @@ const Page: React.FC = (props: Props) => {
|
|
|
let globaleConfig = useAjax((params) => sysRechargeGetInfo(params))//获取全局配置信息
|
|
|
let globaleAddOrEdit = useAjax((params) => sysRechargeAddOrEdit(params))//全局配置信息修改
|
|
|
let ShortBookInfoShelve = useAjax((params) => shortBookInfoShelve(params))//短篇小说批量上下架
|
|
|
+ //批量提审到腾讯
|
|
|
+ let submitToTencent = useAjax((params) => apiSubmitToTencent(params));
|
|
|
+ let refreshSubmitResult =useAjax((params) => apiRefreshSubmitResult(params))
|
|
|
const formRef = useRef<ProFormInstance>();
|
|
|
const actionRef = useRef<ActionType>();
|
|
|
|
|
|
@@ -164,7 +167,7 @@ const Page: React.FC = (props: Props) => {
|
|
|
}
|
|
|
// 批量上下架
|
|
|
const shelveAll = (ids: any[], shelve: 0 | 1) => {
|
|
|
- ShortBookInfoShelve.run({ ...publicData, ids, shelve}).then((res) => {
|
|
|
+ ShortBookInfoShelve.run({ ...publicData, ids, shelve }).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
actionRef?.current?.reload();
|
|
|
message.success('批量' + (shelve === 0 ? '上架成功' : '下架成功'));
|
|
|
@@ -172,6 +175,28 @@ const Page: React.FC = (props: Props) => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+ // 批量提审到腾讯
|
|
|
+ const submitToTencentFn = () => {
|
|
|
+ let bookIds = editSelectedRow?.map(item => item.bookId)
|
|
|
+ let { appId, appType } = publicData
|
|
|
+ submitToTencent.run({ bookIds, appId, appType }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ actionRef?.current?.reload();
|
|
|
+ message.success('已提交到腾讯等待审核结果');
|
|
|
+ setEditSelectedRow([])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //刷新腾讯审核结果
|
|
|
+ const refreshSubmitResultFn = (bookIds: any) => {
|
|
|
+ let { appId, appType } = publicData
|
|
|
+ refreshSubmitResult.run({ bookIds, appId, appType }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ actionRef?.current?.reload();
|
|
|
+ message.success('已刷新');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return <PageContainer title={false}
|
|
|
tabProps={{ type: 'card' }}
|
|
|
loading={globaleConfig?.loading}
|
|
|
@@ -286,6 +311,20 @@ const Page: React.FC = (props: Props) => {
|
|
|
批量上下架
|
|
|
</Button>
|
|
|
</Popconfirm>
|
|
|
+ <Popconfirm
|
|
|
+ title={null}
|
|
|
+ icon={null}
|
|
|
+ onConfirm={() => {
|
|
|
+ submitToTencentFn()
|
|
|
+ }}
|
|
|
+ okText="全部审核"
|
|
|
+ cancelText="取消"
|
|
|
+ >
|
|
|
+ <Button type="primary" disabled={selectedRowKeys.length === 0}>
|
|
|
+ <SendOutlined />
|
|
|
+ 提交到腾讯审核
|
|
|
+ </Button>
|
|
|
+ </Popconfirm>
|
|
|
</Space>
|
|
|
);
|
|
|
}}
|
|
|
@@ -322,7 +361,7 @@ const Page: React.FC = (props: Props) => {
|
|
|
return res
|
|
|
})
|
|
|
}}
|
|
|
- columns={columns({ authList: state?.authList, labelList: state.labelList, categoryList: state.categoryList, enumList: state?.enumList, lookBook, closeForm, setWorkDirection, isModal: !!props?.onChange })}
|
|
|
+ columns={columns({ authList: state?.authList, labelList: state.labelList, categoryList: state.categoryList, enumList: state?.enumList, lookBook, closeForm, setWorkDirection, isModal: !!props?.onChange ,refreshSubmitResultFn})}
|
|
|
/>
|
|
|
{/* 付费配置 */}
|
|
|
<BetaSchemaForm<DataItem>
|