|
@@ -1,104 +1,315 @@
|
|
|
|
+import { getDescriptions } from "@/utils";
|
|
import { ProColumns } from "@ant-design/pro-components";
|
|
import { ProColumns } from "@ant-design/pro-components";
|
|
-import { Badge } from "antd";
|
|
|
|
-
|
|
|
|
-export const columns = (): ProColumns<any>[] => {
|
|
|
|
- let payChannelObj: any = { '1': '微信小程序支付' };
|
|
|
|
- let orderTypeObj: any = { '1': '书币充值', "2": "vip充值", "3": "购买整本" };
|
|
|
|
- let orderStatusObj: any = { '1': '待支付', "2": "已支付" };
|
|
|
|
- return [
|
|
|
|
- {
|
|
|
|
- title: "用户Id",
|
|
|
|
- dataIndex: 'userId',
|
|
|
|
- key: "userId",
|
|
|
|
- align: "center",
|
|
|
|
|
|
+import { Badge, Col, Image, Row, Space, Tag } from "antd";
|
|
|
|
+import { createStyles } from "antd-style";
|
|
|
|
+const useStyles = createStyles(({ token }) => {
|
|
|
|
+ return {
|
|
|
|
+ bookLabel: {
|
|
|
|
+ color: token.colorTextTertiary
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+const brightColors = [
|
|
|
|
+ "#FF6347", // 番茄红
|
|
|
|
+ "#FF4500", // 橙红色
|
|
|
|
+ "#FFD700", // 金黄色
|
|
|
|
+ "#32CD32", // 鲜绿色
|
|
|
|
+ "#00FF7F", // 麦绿色
|
|
|
|
+ "#00CED1", // 暗青色
|
|
|
|
+ "#4682B4", // 钢蓝色
|
|
|
|
+ "#6A5ACD", // 鲜紫色
|
|
|
|
+ "#FF69B4", // 热粉红色
|
|
|
|
+ "#FF1493" // 深粉红色
|
|
|
|
+];
|
|
|
|
+export const columns = (props: { authList?: any[], enumList?: { [key: string]: any }, lookBook: (data: any) => void }): ProColumns<any>[] => {
|
|
|
|
+ let { authList, enumList, lookBook } = props
|
|
|
|
+ let { styles } = useStyles()
|
|
|
|
+ return enumList?.BOOK_STATUS ? [
|
|
|
|
+ {
|
|
|
|
+ title: '封面',
|
|
|
|
+ dataIndex: 'picUrl',
|
|
|
|
+ key: 'picUrl',
|
|
|
|
+ width: 90,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
|
|
+ render: (a: any, b: any) => {
|
|
|
|
+ return <Image src={b?.shortBookInfoVO?.picUrl} style={{ width: 50 }} />
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "小说名称",
|
|
|
|
- dataIndex: 'bookName',
|
|
|
|
- key: "bookName",
|
|
|
|
- align: "center",
|
|
|
|
|
|
+ title: '作品详情',
|
|
|
|
+ dataIndex: 'authorId',
|
|
|
|
+ key: 'authorId',
|
|
|
|
+ ellipsis: true,
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
|
|
+ render: (a, b) => {
|
|
|
|
+ let { bookName, wordCount, labelInfoList, bookStatus, categoryInfo, authorInfo, score } = b?.shortBookInfoVO
|
|
|
|
+ let arr = enumList?.BOOK_STATUS?.values
|
|
|
|
+ return <Row >
|
|
|
|
+ <Col span={24}>
|
|
|
|
+ <Space size={[5, 0]} wrap>
|
|
|
|
+ <a style={{ fontSize: 14, color: "#337ab7" }} onClick={() => {
|
|
|
|
+ lookBook?.({ ...b.shortBookInfoVO, pageNum: 1, pageSize: 2 })
|
|
|
|
+ }}>[{categoryInfo?.name}]{bookName}</a>
|
|
|
|
+ <span style={{ fontSize: 11 }} className={styles.bookLabel}>[{arr[bookStatus]?.description}]</span>
|
|
|
|
+ <Space size={[0, 0]}>
|
|
|
|
+ {
|
|
|
|
+ labelInfoList?.map((tags: { id: string, name: string }, index: number) => {
|
|
|
|
+ return <Tag key={tags?.id} color={brightColors[index]}>{tags?.name}</Tag>
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ </Space>
|
|
|
|
+ </Space>
|
|
|
|
+ </Col>
|
|
|
|
+ <Col span={24} className={styles.bookLabel}><span ><span>作者</span>:</span>{authorInfo?.authorName}</Col>
|
|
|
|
+ <Col span={24} className={styles.bookLabel}><span >总字数:</span>{wordCount || 0}</Col>
|
|
|
|
+ <Col span={24} className={styles.bookLabel}><span >评分:</span>{score || 0}</Col>
|
|
|
|
+ </Row>
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "支付渠道",
|
|
|
|
- dataIndex: 'payChannel',
|
|
|
|
- key: "payChannel",
|
|
|
|
- align: "center",
|
|
|
|
- valueType:'select',
|
|
|
|
- valueEnum:payChannelObj,
|
|
|
|
- render: (a: any,b:any) => {
|
|
|
|
- return payChannelObj[b.payChannel]
|
|
|
|
- },
|
|
|
|
|
|
+ title: '所属频道',
|
|
|
|
+ dataIndex: 'workDirection',
|
|
|
|
+ key: 'workDirection',
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 80,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ hideInSearch: true,
|
|
|
|
+ render: (a: any, b: any) => {
|
|
|
|
+ return enumList?.WORK_DIRECTION?.values[b.shortBookInfoVO.workDirection]?.description
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "支付金额",
|
|
|
|
- dataIndex: 'amount',
|
|
|
|
- key: "amount",
|
|
|
|
|
|
+ title: '点击量',
|
|
|
|
+ dataIndex: 'visitCount',
|
|
|
|
+ key: 'visitCount',
|
|
|
|
+ width: 90,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
- align: "center",
|
|
|
|
|
|
+ render: (a, b) => {
|
|
|
|
+ let { visitCount } = b?.shortBookInfoVO
|
|
|
|
+ return visitCount
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "订单类型",
|
|
|
|
- dataIndex: 'orderType',
|
|
|
|
- key: "orderType",
|
|
|
|
- valueType:'select',
|
|
|
|
- valueEnum:orderTypeObj,
|
|
|
|
- align: "center",
|
|
|
|
- render: (a: any,b:any) => {
|
|
|
|
- return orderTypeObj[b.orderType]
|
|
|
|
|
|
+ title: '上架状态',
|
|
|
|
+ dataIndex: 'shelveStatus',
|
|
|
|
+ key: 'shelveStatus',
|
|
|
|
+ width: 90,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
|
|
+ hideInSearch: true,
|
|
|
|
+ render: (a: any, b) => {
|
|
|
|
+ let arr: any = enumList?.SHELVE_STATUS?.values
|
|
|
|
+ let { shelveStatus } = b?.shortBookInfoVO
|
|
|
|
+ return arr[shelveStatus]?.description && <Badge text={arr[shelveStatus]?.description} status={shelveStatus == 0 ? "processing" : "default"} />
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "订单状态",
|
|
|
|
- dataIndex: 'orderStatus',
|
|
|
|
- key: "orderStatus",
|
|
|
|
- valueType:'select',
|
|
|
|
- valueEnum:orderStatusObj,
|
|
|
|
- align: "center",
|
|
|
|
- render: (a: any,b:any) => {
|
|
|
|
- return <Badge text={orderStatusObj[b.orderStatus]} status={b.orderStatus != 1 ? "success" : "warning"} />
|
|
|
|
|
|
+ title: '来源',
|
|
|
|
+ dataIndex: 'source',
|
|
|
|
+ key: 'source',
|
|
|
|
+ width: 90,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
|
|
+ hideInSearch: true,
|
|
|
|
+ render: (a: any, b) => {
|
|
|
|
+ let { source } = b?.shortBookInfoVO
|
|
|
|
+ let arr: any = new Map(enumList?.SOURCE?.values?.map(({ value, description }: any) => [value, description]))
|
|
|
|
+ return arr.get(source)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "用户订单号",
|
|
|
|
- dataIndex: 'orderId',
|
|
|
|
- key: "orderId",
|
|
|
|
- align: "center",
|
|
|
|
|
|
+ title: '收费类型',
|
|
|
|
+ dataIndex: 'paymentType',
|
|
|
|
+ key: 'paymentType',
|
|
|
|
+ width: 100,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
|
|
+ hideInSearch: true,
|
|
|
|
+ render: (a: any, b: any) => {
|
|
|
|
+ let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [], b?.paymentType || [])
|
|
|
|
+ return <Space size={[0,5]} wrap>
|
|
|
|
+ {
|
|
|
|
+ arr?.map(str=>{
|
|
|
|
+ return <Tag bordered={false} key={str}>{str}</Tag>
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ </Space>
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: 'VIP免费',
|
|
|
|
+ dataIndex: 'vipFree',
|
|
|
|
+ key: 'vipFree',
|
|
|
|
+ width: 70,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
|
|
+ hideInSearch: true,
|
|
|
|
+ render: (a: any, b) => {
|
|
|
|
+ return <Badge text={a ? "是" : "否"} status={a ? "processing" : "default"} />
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "商户订单号",
|
|
|
|
- dataIndex: 'merchantOrderId',
|
|
|
|
- key: "merchantOrderId",
|
|
|
|
- align: "center",
|
|
|
|
|
|
+ title: '收费金额',
|
|
|
|
+ tooltip:"收费金额(整本)",
|
|
|
|
+ dataIndex: 'paymentAmount',
|
|
|
|
+ key: 'paymentAmount',
|
|
|
|
+ width: 100,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
|
|
+ hideInSearch: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "下单时间",
|
|
|
|
- dataIndex: 'orderTime',
|
|
|
|
- key: "orderTime",
|
|
|
|
|
|
+ title: '收费书币',
|
|
|
|
+ tooltip:"收费书币(/千字、/本、/段|章节)",
|
|
|
|
+ dataIndex: 'paymentCoin',
|
|
|
|
+ key: 'paymentCoin',
|
|
|
|
+ width: 100,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
- align: "center",
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "支付时间",
|
|
|
|
- tooltip: "实际到账时间",
|
|
|
|
- dataIndex: 'payTime',
|
|
|
|
- key: "payTime",
|
|
|
|
|
|
+ title: '开始收费段落',
|
|
|
|
+ dataIndex: 'beginPayParagraphNo',
|
|
|
|
+ key: 'beginPayParagraphNo',
|
|
|
|
+ width: 100,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
- align: "center",
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'cz',
|
|
|
|
+ key: 'cz',
|
|
|
|
+ width: 90,
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ align: 'center',
|
|
|
|
+ hideInSearch: true,
|
|
|
|
+ render:(a:any,b:any)=>{
|
|
|
|
+ return <a>付费配置</a>
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 搜索条件
|
|
// 搜索条件
|
|
{
|
|
{
|
|
- title: "开始时间",
|
|
|
|
- dataIndex: 'startTime',
|
|
|
|
- valueType: 'dateTime',
|
|
|
|
- hideInTable: true
|
|
|
|
|
|
+ title: "小说名称",
|
|
|
|
+ dataIndex: 'bookName',
|
|
|
|
+ valueType: 'text',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { placeholder: "请输入小说名称" },
|
|
|
|
+ colSize: 1,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "作者",
|
|
|
|
+ dataIndex: 'authorId',
|
|
|
|
+ valueType: 'select',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { showSearch: true, placeholder: '请选择作者' },
|
|
|
|
+ colSize: 1,
|
|
|
|
+ valueEnum: new Map(authList?.map(({ id, authorName }) => [id, authorName]))
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "频道",
|
|
|
|
+ dataIndex: 'workDirection',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: () => {
|
|
|
|
+ let arr = enumList?.WORK_DIRECTION?.values
|
|
|
|
+ return arr ? new Map([{ value: '', description: "全部" }, ...arr]?.map(({ value, description }: any) => [value, description])) : {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "来源",
|
|
|
|
+ dataIndex: 'source',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: () => {
|
|
|
|
+ let arr = enumList?.SOURCE?.values
|
|
|
|
+ return arr ? new Map([{ value: '', description: "全部" }, ...arr]?.map(({ value, description }: any) => [value, description])) : {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "连载",
|
|
|
|
+ dataIndex: 'bookStatus',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: () => {
|
|
|
|
+ let arr = enumList?.BOOK_STATUS?.values
|
|
|
|
+ return arr ? new Map([{ value: '', description: "全部" }, ...arr]?.map(({ value, description }: any) => [value, description])) : {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "上架",
|
|
|
|
+ dataIndex: 'shelveStatus',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: () => {
|
|
|
|
+ let arr = enumList?.SHELVE_STATUS?.values
|
|
|
|
+ return arr ? new Map([{ value: '', description: "全部" }, ...arr]?.map(({ value, description }: any) => [value, description])) : {}
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "结束时间",
|
|
|
|
- dataIndex: 'endTime',
|
|
|
|
- valueType: 'dateTime',
|
|
|
|
- hideInTable: true
|
|
|
|
|
|
+ title: "付费",
|
|
|
|
+ dataIndex: 'paymentType',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: () => {
|
|
|
|
+ let arr = enumList?.PAYMENT_TYPE?.values
|
|
|
|
+ return arr ? new Map([{ value: '', description: "全部" }, ...arr]?.map(({ value, description }: any) => [value, description])) : {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "VIP",
|
|
|
|
+ dataIndex: 'vipFree',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: () => {
|
|
|
|
+ let arr = enumList?.VIP_FREE?.values
|
|
|
|
+ return arr ? new Map([{ value: '', description: "全部" }, ...arr]?.map(({ value, description }: any) => [value, description])) : {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "字数",
|
|
|
|
+ dataIndex: 'wordCount',
|
|
|
|
+ valueType: 'segmented',
|
|
|
|
+ hideInTable: true,
|
|
|
|
+ fieldProps: { type: 'primary', style: { width: 'auto' } },
|
|
|
|
+ colSize: 3,
|
|
|
|
+ initialValue: '',
|
|
|
|
+ valueEnum: {
|
|
|
|
+ "": "全部",
|
|
|
|
+ "0-2": "2万内",
|
|
|
|
+ "2-5": "2-5万",
|
|
|
|
+ "5-10": "5-10万",
|
|
|
|
+ "10-20": "10-20万",
|
|
|
|
+ "20-40": "20-40万",
|
|
|
|
+ "40-100": "40-100万",
|
|
|
|
+ "100-150": "100-150万",
|
|
|
|
+ "150-200": "150-200万",
|
|
|
|
+ "200-300": "200-300万",
|
|
|
|
+ "300-0": "300万以上",
|
|
|
|
+ },
|
|
},
|
|
},
|
|
- ];
|
|
|
|
|
|
+ ] : []
|
|
}
|
|
}
|