wjx 1 год назад
Родитель
Сommit
f5a2f22c37

+ 12 - 6
src/pages/gameDataStatistics/roleOperate/strategy/strategyModal.tsx

@@ -5,7 +5,7 @@ import { FieldTimeOutlined } from "@ant-design/icons";
 import { useAjax } from "@/Hook/useAjax";
 import { useAjax } from "@/Hook/useAjax";
 import { StrategyProps, modalStrategyApi } from "@/services/gameData/roleOperate";
 import { StrategyProps, modalStrategyApi } from "@/services/gameData/roleOperate";
 
 
-enum conditionEnum {
+export enum conditionEnum {
     gt = '大于',
     gt = '大于',
     ge = '大于等于',
     ge = '大于等于',
     lt = '小于',
     lt = '小于',
@@ -62,13 +62,15 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
                 helpTips = amountTips + ',发送钉钉消息'
                 helpTips = amountTips + ',发送钉钉消息'
             }
             }
             setHelp(helpTips)
             setHelp(helpTips)
-            form.setFieldsValue({ configExplain: helpTips })
+            // form.setFieldsValue({ configExplain: helpTips })
         } else {
         } else {
             setHelp(undefined)
             setHelp(undefined)
-            form.setFieldsValue({ configExplain: undefined })
+            // form.setFieldsValue({ configExplain: undefined })
         }
         }
     }, [type, time, amount, timeCondition, amountCondition])
     }, [type, time, amount, timeCondition, amountCondition])
 
 
+    console.log('---->', help)
+
     const handleOk = async () => {
     const handleOk = async () => {
         form.submit()
         form.submit()
         let data = await form.validateFields()
         let data = await form.validateFields()
@@ -141,7 +143,7 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
                     {superGameList?.map((item: any) => <Select.Option value={item.super_game_id} key={item.super_game_id}>{item.super_game_name}</Select.Option>)}
                     {superGameList?.map((item: any) => <Select.Option value={item.super_game_id} key={item.super_game_id}>{item.super_game_name}</Select.Option>)}
                 </Select>
                 </Select>
             </Form.Item>
             </Form.Item>
-            <Form.Item label="策略类型" help={help} name='type' rules={[{ required: true, message: '请选择策略类型!' }]}>
+            <Form.Item label="策略类型" name='type' rules={[{ required: true, message: '请选择策略类型!' }]}>
                 <Select
                 <Select
                     showSearch
                     showSearch
                     style={{ minWidth: 140 }}
                     style={{ minWidth: 140 }}
@@ -225,8 +227,12 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
                     </Form.Item>}
                     </Form.Item>}
                 </Space>
                 </Space>
             </Form.Item>}
             </Form.Item>}
-            <Form.Item label="策略说明" name='configExplain' rules={[{ required: true, message: '请选择配置说明!' }]}>
-                <Input.TextArea placeholder="配置说明:请写出具体的配置细节。如:首次充值金额大于等于500并且注册时间24小时内的用户,发送钉钉消息" />
+            <Form.Item label="策略备注" name='configExplain' rules={[{ required: true, message: '请选择策略备注!' }]}>
+                {/* <Input.TextArea placeholder="配置说明:请写出具体的配置细节。如:首次充值金额大于等于500并且注册时间24小时内的用户,发送钉钉消息" /> */}
+                <Input.TextArea placeholder="请输入备注" />
+            </Form.Item>
+            <Form.Item label="策略说明">
+                <Input.TextArea value={help} disabled placeholder="策略说明"/>
             </Form.Item>
             </Form.Item>
         </Form>
         </Form>
     </Modal>
     </Modal>

+ 48 - 7
src/pages/gameDataStatistics/roleOperate/strategy/tableConfig.tsx

@@ -4,6 +4,7 @@ import { Row, Col, Popconfirm, Tag } from "antd"
 import { DeleteOutlined, EditOutlined } from "@ant-design/icons"
 import { DeleteOutlined, EditOutlined } from "@ant-design/icons"
 import WidthEllipsis from "@/components/widthEllipsis"
 import WidthEllipsis from "@/components/widthEllipsis"
 import React from "react"
 import React from "react"
+import { conditionEnum } from "./strategyModal"
 
 
 function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {
 function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {
 
 
@@ -30,7 +31,7 @@ function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {
             align: 'center',
             align: 'center',
             width: 100,
             width: 100,
             render: (a: number, b: any) => {
             render: (a: number, b: any) => {
-                return {1: <Tag color="#f50">追踪玩家</Tag>, 2: <Tag color="#2db7f5">玩家流失</Tag>, 3: <Tag color="#87d068">新用户追踪</Tag>}[a]
+                return { 1: <Tag color="#f50">追踪玩家</Tag>, 2: <Tag color="#2db7f5">玩家流失</Tag>, 3: <Tag color="#87d068">新用户追踪</Tag> }[a]
             }
             }
         },
         },
         {
         {
@@ -38,9 +39,9 @@ function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {
             dataIndex: 'amount',
             dataIndex: 'amount',
             key: 'amount',
             key: 'amount',
             align: 'center',
             align: 'center',
-            width: 80,
+            width: 100,
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
-                return (a && a !== 0) ? a : '--'
+                return ((a && a !== 0) && b?.amountCondition) ? conditionEnum[b?.amountCondition] + " " + a : '--'
             }
             }
         },
         },
         {
         {
@@ -50,22 +51,62 @@ function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {
             align: 'center',
             align: 'center',
             width: 80,
             width: 80,
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
-                return (a && a !== 0) ? a : '--'
+                return (b?.timeCondition && (a && a !== 0)) ? conditionEnum[b?.timeCondition] + " " + a : '--'
             }
             }
         },
         },
         {
         {
-            title: '策略说明',
+            title: '策略备注',
             dataIndex: 'configExplain',
             dataIndex: 'configExplain',
             key: 'configExplain',
             key: 'configExplain',
             width: 150,
             width: 150,
             render: (a: string, b: any) => (<WidthEllipsis value={a} />)
             render: (a: string, b: any) => (<WidthEllipsis value={a} />)
         },
         },
+        {
+            title: '策略说明',
+            dataIndex: 'configExplain',
+            key: 'configExplain',
+            width: 350,
+            render: (a: string, b: any) => {
+                const { type, time, amount, timeCondition, amountCondition } = b
+                if (type) {
+                    let timeTips: string = ''
+                    let amountTips: string = ''
+                    switch (type) {
+                        case 1:
+                            // 单笔充值金额大于等于XX,并且注册时间在XX小时内的玩家
+                            timeTips = time ? `注册时间${conditionEnum[timeCondition]}${time}小时的玩家` : ''
+                            amountTips = amount ? `单笔充值金额${conditionEnum[amountCondition]}${amount}元` : ''
+                            break
+                        case 2:
+                            // 累计充值金额大于等于XX,并且最近游戏距今时间超过XX小时的玩家
+                            amountTips = amount ? `累计充值金额${conditionEnum[amountCondition]}${amount}元` : ''
+                            timeTips = time ? `最近游戏距今时间${conditionEnum[timeCondition]}${time}小时的玩家` : ''
+                            break
+                        case 3:
+                            // '新用户注册创角首日充值大于等于XX的用户'
+                            amountTips = amount ? `新用户注册创角首日充值${conditionEnum[amountCondition]}${amount}元的用户` : ''
+                            break
+                    }
+                    let helpTips = ''
+                    if (timeTips && amountTips) {
+                        helpTips = amountTips + ',并且' + timeTips + ',发送钉钉消息'
+                    } else if (timeTips) {
+                        helpTips = timeTips + ',发送钉钉消息'
+                    } else if (amountTips) {
+                        helpTips = amountTips + ',发送钉钉消息'
+                    }
+                    return <WidthEllipsis value={helpTips} />
+                } else {
+                    return '--'
+                }
+            }
+        },
         {
         {
             title: '创建人',
             title: '创建人',
             dataIndex: 'createName',
             dataIndex: 'createName',
             key: 'createName',
             key: 'createName',
             align: 'center',
             align: 'center',
-            width: 100,
+            width: 80,
             render: (a: string, b: any) => (<WidthEllipsis value={a} />)
             render: (a: string, b: any) => (<WidthEllipsis value={a} />)
         },
         },
         {
         {
@@ -81,7 +122,7 @@ function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {
             dataIndex: 'updateName',
             dataIndex: 'updateName',
             key: 'updateName',
             key: 'updateName',
             align: 'center',
             align: 'center',
-            width: 100,
+            width: 80,
             render: (a: string, b: any) => (<WidthEllipsis value={a} />)
             render: (a: string, b: any) => (<WidthEllipsis value={a} />)
         },
         },
         {
         {