shenwu hace 8 meses
padre
commit
0a8afe50d8
Se han modificado 1 ficheros con 76 adiciones y 68 borrados
  1. 76 68
      src/pages/MiniApp/BookManage/Short/index.tsx

+ 76 - 68
src/pages/MiniApp/BookManage/Short/index.tsx

@@ -3,10 +3,11 @@ import { columns } from "./tableConfig"
 import { useAjax } from "@/Hook/useAjax"
 import { useModel } from "@umijs/max"
 import { shortBookInfoList, shortBookInfoParagraphList, shortBookInfoBookConfig, shortBookInfoConfig, shortBookInfoParagraphAllList } from "@/services/miniApp/bookManage"
-import {  useEffect, useMemo, useRef, useState } from "react"
-import { Drawer, message } from "antd"
+import { useEffect, useMemo, useRef, useState } from "react"
+import { Drawer, message, Space, Tag } from "antd"
 import ReadText from "../components/readText"
 import formConfig from "./formConfig"
+import { EditFilled } from "@ant-design/icons"
 const wordCountRanges: any = {
     "": { start: null, end: null }, // 全部
     "0-2": { start: 0, end: 2 * 10000 },
@@ -105,73 +106,80 @@ const Page: React.FC = () => {
             })
         }
     }
-    return  <PageContainer title={false}
-    tabProps={{ type: 'card' }}
->
-    <ProTable<any, any>
-        params={publicData}
-        actionRef={actionRef}
-        headerTitle={"小说列表"}
-        rowKey={(r) => r.bookId}
-        search={{
-            labelWidth: 90,
-            searchGutter: [10, 15],
-        }}
-        scroll={{ x: true}}
-        loading={getParagraphList?.loading || getList?.loading}
-        // ghost={true}//去除表格的背景一些配置改变ui
-        beforeSearchSubmit={(params) => {//处理搜索数据
-            let newParams = Object.entries(params).reduce((acc: any, [key, value]) => {
-                // 过滤掉空值,包括空字符串和 null
-                if (value !== '' && value != null) {
-                    acc[key] = value;
-                }
-                if (key === 'wordCount' && value) {
-                    let obj = wordCountRanges[value]
-                    acc['startWordCount'] = obj.start
-                    acc['endWordCount'] = obj.end
-                    delete acc[key]
-                }
-                return acc;
-            }, {});
-            return newParams
-        }}
-        request={async (params) => {
-            return await getList.run(params)
-        }}
-        columns={columns({ authList: state?.authList, labelList: state.labelList, categoryList: state.categoryList, enumList: state?.enumList, lookBook, closeForm, setWorkDirection })}
-    />
-    {/* 付费配置 */}
-    <BetaSchemaForm<DataItem>
-        title={"付费配置"}
-        formRef={formRef}
-        open={open}
-        onOpenChange={(b) => { !b && closeForm(b) }}
-        layoutType={"ModalForm"}
-        labelCol={{ span: 6 }}
-        wrapperCol={{ span: 14 }}
-        // grid={true}
-        layout='horizontal'
-        onFinish={submit}
-        columns={formConfig({ enumList: state?.enumList, paymentType, paragraphList: getParagraphAllList?.data?.data?.map((item: { paragraphInfo: any }) => item.paragraphInfo) })}
-        loading={add?.loading}
-    />
-    {/* 阅读小说 */}
-    <Drawer
-        open={!!openBook}
-        placement="right"
-        onClose={() => { setOpneBook(null) }}
-        footer={null}
-        width={'65%'}
-        destroyOnClose={true}
-        // getContainer={false}
-        styles={{ body: { padding: 0 } }}
-        closeIcon={false}
-        title={<div style={{ fontSize: 20 }}>{openBook?.bookName ? openBook?.bookName : ""}</div>}
+    return <PageContainer title={false}
+        tabProps={{ type: 'card' }}
     >
-        <ReadText data={openBook} next={lookBook} />
-    </Drawer>
-</PageContainer>
+        <ProTable<any, any>
+            params={publicData}
+            actionRef={actionRef}
+            headerTitle={"小说列表"}
+            rowKey={(r) => r.bookId}
+            rowSelection={{ alwaysShowAlert: true, hideSelectAll: true, columnWidth: 0, columnTitle: '', renderCell: () => null }}
+            tableAlertRender={() => <Space>
+                <Tag  bordered={false} color="processing" style={{cursor:'pointer'}}>收费价格:短篇¥2/千字,中长篇¥2/千字<EditFilled /></Tag>
+                <Tag bordered={false} color="processing" style={{cursor:'pointer'}}>收费起始章节:短篇2,中长篇21<EditFilled /></Tag>
+                <Tag bordered={false} color="processing" style={{cursor:'pointer'}}>整本价格:短篇19.9元,中长篇99元<EditFilled /></Tag>
+            </Space>}
+            tableAlertOptionRender={false}
+            search={{
+                labelWidth: 90,
+                searchGutter: [10, 15],
+            }}
+            scroll={{ x: true }}
+            loading={getParagraphList?.loading || getList?.loading}
+            // ghost={true}//去除表格的背景一些配置改变ui
+            beforeSearchSubmit={(params) => {//处理搜索数据
+                let newParams = Object.entries(params).reduce((acc: any, [key, value]) => {
+                    // 过滤掉空值,包括空字符串和 null
+                    if (value !== '' && value != null) {
+                        acc[key] = value;
+                    }
+                    if (key === 'wordCount' && value) {
+                        let obj = wordCountRanges[value]
+                        acc['startWordCount'] = obj.start
+                        acc['endWordCount'] = obj.end
+                        delete acc[key]
+                    }
+                    return acc;
+                }, {});
+                return newParams
+            }}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns({ authList: state?.authList, labelList: state.labelList, categoryList: state.categoryList, enumList: state?.enumList, lookBook, closeForm, setWorkDirection })}
+        />
+        {/* 付费配置 */}
+        <BetaSchemaForm<DataItem>
+            title={"付费配置"}
+            formRef={formRef}
+            open={open}
+            onOpenChange={(b) => { !b && closeForm(b) }}
+            layoutType={"ModalForm"}
+            labelCol={{ span: 6 }}
+            wrapperCol={{ span: 14 }}
+            // grid={true}
+            layout='horizontal'
+            onFinish={submit}
+            columns={formConfig({ enumList: state?.enumList, paymentType, paragraphList: getParagraphAllList?.data?.data?.map((item: { paragraphInfo: any }) => item.paragraphInfo) })}
+            loading={add?.loading}
+        />
+        {/* 阅读小说 */}
+        <Drawer
+            open={!!openBook}
+            placement="right"
+            onClose={() => { setOpneBook(null) }}
+            footer={null}
+            width={'65%'}
+            destroyOnClose={true}
+            // getContainer={false}
+            styles={{ body: { padding: 0 } }}
+            closeIcon={false}
+            title={<div style={{ fontSize: 20 }}>{openBook?.bookName ? openBook?.bookName : ""}</div>}
+        >
+            <ReadText data={openBook} next={lookBook} />
+        </Drawer>
+    </PageContainer>
 
 }
 export default Page