shenwu 5 months ago
parent
commit
4ffc15e176

+ 1 - 1
src/pages/MiniApp/BookManage/Long/formConfig.tsx

@@ -114,7 +114,7 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
                     },
                     },
                 ],
                 ],
             },
             },
-            hideInForm: paymentType[0] != 2 || !isGlobalConfig,//单本书
+            hideInForm: paymentType[0] === 0 || !isGlobalConfig,//单本书
         },
         },
         {
         {
             title: 'VIP阅读',
             title: 'VIP阅读',

+ 27 - 8
src/pages/MiniApp/BookManage/Long/tableConfig.tsx

@@ -3,6 +3,7 @@ import { getDescriptions } from "@/utils";
 import { ProColumns } from "@ant-design/pro-components";
 import { ProColumns } from "@ant-design/pro-components";
 import { Badge, Col, Image, Row, Space, Tag } from "antd";
 import { Badge, Col, Image, Row, Space, Tag } from "antd";
 import { createStyles } from "antd-style";
 import { createStyles } from "antd-style";
+import BookExtend from "../components/extend";
 const useStyles = createStyles(({ token }) => {
 const useStyles = createStyles(({ token }) => {
     return {
     return {
         bookLabel: {
         bookLabel: {
@@ -22,8 +23,8 @@ const brightColors = [
     "#FF69B4", // 热粉红色
     "#FF69B4", // 热粉红色
     "#FF1493"  // 深粉红色
     "#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()
     let { styles } = useStyles()
     return enumList?.BOOK_STATUS ? [
     return enumList?.BOOK_STATUS ? [
         {
         {
@@ -37,7 +38,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
                 return <div style={{ position: 'relative' }}>
                 return <div style={{ position: 'relative' }}>
                     {b?.vipFree && <MyIcon type="icon-vipmianfei" style={{ fontSize: 20, position: 'absolute', zIndex: 1 }} />}
                     {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")
                         e.target.src = localStorage.getItem("nocover")
                     }} />
                     }} />
                 </div>
                 </div>
@@ -136,11 +137,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
             render: (a: any, b: any) => {
             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>
                 return <Space size={[0, 5]} wrap>
                     {
                     {
                         arr?.map(str => {
                         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>
                 </Space>
@@ -187,6 +189,20 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             align: 'center',
             align: 'center',
             hideInSearch: true,
             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: '操作',
             title: '操作',
             dataIndex: 'cz',
             dataIndex: 'cz',
@@ -195,9 +211,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             ellipsis: true,
             ellipsis: true,
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
-            hideInTable:isModal,
+            hideInTable: isModal,
             render: (a: any, b: any) => {
             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',
             dataIndex: 'wordCount',
             valueType: 'segmented',
             valueType: 'segmented',
             hideInTable: true,
             hideInTable: true,
-            fieldProps: { type: 'primary', style: { width: 'auto' },block:true},
+            fieldProps: { type: 'primary', style: { width: 'auto' }, block: true },
             colSize: 3,
             colSize: 3,
             initialValue: '',
             initialValue: '',
             valueEnum: {
             valueEnum: {

+ 1 - 1
src/pages/MiniApp/BookManage/Short/formConfig.tsx

@@ -112,7 +112,7 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
                     },
                     },
                 ],
                 ],
             },
             },
-            hideInForm: paymentType[0] != 2 || !isGlobalConfig,//单本书
+            hideInForm: paymentType[0] === 0 || !isGlobalConfig,
         },
         },
         {
         {
             title: 'VIP阅读',
             title: 'VIP阅读',

+ 15 - 1
src/pages/MiniApp/BookManage/Short/tableConfig.tsx

@@ -204,6 +204,20 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             align: 'center',
             align: 'center',
             hideInSearch: true,
             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: '操作',
             title: '操作',
             dataIndex: 'cz',
             dataIndex: 'cz',
@@ -215,7 +229,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             hideInTable: isModal,
             hideInTable: isModal,
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
                 return <Space>
                 return <Space>
-                    <a onClick={() => { closeForm(true, b) }}>付费配置</a>
+                    {b?.allowDistributorConfig && <a onClick={() => { closeForm(true, b) }}>付费配置</a>}
                     <BookExtend shortBookId={b?.bookId} bookName={b?.shortBookInfoVO?.bookName} />
                     <BookExtend shortBookId={b?.bookId} bookName={b?.shortBookInfoVO?.bookName} />
                 </Space>
                 </Space>
             }
             }