|
@@ -3,6 +3,7 @@ import { getDescriptions } from "@/utils";
|
|
|
import { ProColumns } from "@ant-design/pro-components";
|
|
|
import { Badge, Col, Image, Row, Space, Tag } from "antd";
|
|
|
import { createStyles } from "antd-style";
|
|
|
+import BookExtend from "../components/extend";
|
|
|
const useStyles = createStyles(({ token }) => {
|
|
|
return {
|
|
|
bookLabel: {
|
|
@@ -22,8 +23,8 @@ const brightColors = [
|
|
|
"#FF69B4", // 热粉红色
|
|
|
"#FF1493" // 深粉红色
|
|
|
];
|
|
|
-export const columns = (props: { authList?: any[], labelList?: any[], enumList?: { [key: string]: any }, categoryList?: any[], lookBook: (data: any) => void, closeForm: (b: boolean, d: any) => void, setWorkDirection: (w: any) => void ,isModal:boolean}): ProColumns<any>[] => {
|
|
|
- let { authList, labelList, categoryList, enumList, lookBook, closeForm, setWorkDirection,isModal } = props
|
|
|
+export const columns = (props: { authList?: any[], labelList?: any[], enumList?: { [key: string]: any }, categoryList?: any[], lookBook: (data: any) => void, closeForm: (b: boolean, d: any) => void, setWorkDirection: (w: any) => void, isModal: boolean }): ProColumns<any>[] => {
|
|
|
+ let { authList, labelList, categoryList, enumList, lookBook, closeForm, setWorkDirection, isModal } = props
|
|
|
let { styles } = useStyles()
|
|
|
return enumList?.BOOK_STATUS ? [
|
|
|
{
|
|
@@ -37,7 +38,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
|
|
|
render: (a: any, b: any) => {
|
|
|
return <div style={{ position: 'relative' }}>
|
|
|
{b?.vipFree && <MyIcon type="icon-vipmianfei" style={{ fontSize: 20, position: 'absolute', zIndex: 1 }} />}
|
|
|
- <Image src={b?.longBookInfo?.picUrl} style={{ width: 50 }} onError={(e:any)=>{
|
|
|
+ <Image src={b?.longBookInfo?.picUrl} style={{ width: 50 }} onError={(e: any) => {
|
|
|
e.target.src = localStorage.getItem("nocover")
|
|
|
}} />
|
|
|
</div>
|
|
@@ -136,11 +137,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
|
|
|
align: 'center',
|
|
|
hideInSearch: true,
|
|
|
render: (a: any, b: any) => {
|
|
|
- let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [],[ b?.paymentType ]|| [])
|
|
|
+ let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [], b?.paymentType ? [b?.paymentType] : [])
|
|
|
+ let arr1 = new Map(enumList?.PAYMENT_OPTION?.values?.map(({ value, description }: any) => [value, description]))
|
|
|
return <Space size={[0, 5]} wrap>
|
|
|
{
|
|
|
arr?.map(str => {
|
|
|
- return <Tag bordered={false} key={str}>{str}</Tag>
|
|
|
+ return <Tag bordered={false} key={str}>{str}{b?.paymentOption != null && '(' + arr1.get(b?.paymentOption) + ')'}</Tag>
|
|
|
})
|
|
|
}
|
|
|
</Space>
|
|
@@ -187,6 +189,20 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
|
|
|
align: 'center',
|
|
|
hideInSearch: true,
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '付费配置权限',
|
|
|
+ tooltip: <span>平台方是否开放付费配置权限<br />允许:可以自行修改小说收费配置<br />不允许:没有权限修改收费配置</span>,
|
|
|
+ dataIndex: 'allowDistributorConfig',
|
|
|
+ key: 'allowDistributorConfig',
|
|
|
+ width: 100,
|
|
|
+ ellipsis: true,
|
|
|
+ align: 'center',
|
|
|
+ hideInSearch: true,
|
|
|
+ render: (_, row) => {
|
|
|
+ let str = row.allowDistributorConfig ? "允许" : "不允许"
|
|
|
+ return <Badge status={row.allowDistributorConfig ? "success" : "error"} text={str} />
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: 'cz',
|
|
@@ -195,9 +211,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
|
|
|
ellipsis: true,
|
|
|
align: 'center',
|
|
|
hideInSearch: true,
|
|
|
- hideInTable:isModal,
|
|
|
+ hideInTable: isModal,
|
|
|
render: (a: any, b: any) => {
|
|
|
- return <a onClick={() => { closeForm(true, b) }}>付费配置</a>
|
|
|
+ return <Space>
|
|
|
+ {b?.allowDistributorConfig && <a onClick={() => { closeForm(true, b) }}>付费配置</a>}
|
|
|
+ <BookExtend shortBookId={b?.bookId} bookName={b?.longBookInfo?.bookName} />
|
|
|
+ </Space>
|
|
|
}
|
|
|
},
|
|
|
// 搜索条件
|
|
@@ -333,7 +352,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
|
|
|
dataIndex: 'wordCount',
|
|
|
valueType: 'segmented',
|
|
|
hideInTable: true,
|
|
|
- fieldProps: { type: 'primary', style: { width: 'auto' },block:true},
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' }, block: true },
|
|
|
colSize: 3,
|
|
|
initialValue: '',
|
|
|
valueEnum: {
|