wjx 1 éve
szülő
commit
f2ee57caa8

+ 2 - 2
src/components/QueryForm/index.tsx

@@ -498,8 +498,8 @@ const QueryForm: React.FC<Props> = (props) => {
     const disabledDate: RangePickerProps['disabledDate'] = (current) => {
         // Can not select days before today and today
         if (consumeDay && consumeDay?.length === 2) {
-            let [d1, d2] = consumeDay
-            return current && (current < moment(d1) || current > moment(d2).endOf('day'));
+            let [d1] = consumeDay
+            return current && (current < moment(d1) || current > moment().endOf('day'));
         }
         return current && current > moment().endOf('day');
     };

+ 12 - 0
src/pages/gameDataStatistics/roleOperate/msgPush/index.tsx

@@ -4,6 +4,7 @@ import style from '../../components/TableData/index.less'
 import { PlusOutlined } from "@ant-design/icons"
 import Tables from "@/components/Tables"
 import columnsPos from "./tableConfig"
+import MsgPushModal from "./msgPushModal"
 
 /**
  * 游戏内消息推送
@@ -93,6 +94,17 @@ const MsgPush: React.FC = () => {
                 />
             </div>
         </Space>
+
+        {visible && <MsgPushModal
+            visible={visible}
+            onClose={() => {
+                setVisible(visible)
+
+            }}
+            onChange={() => {
+                
+            }}
+        />}
     </Card>
 }
 

+ 92 - 5
src/pages/gameDataStatistics/roleOperate/msgPush/msgPushModal.tsx

@@ -1,6 +1,7 @@
-import { Modal } from "antd"
+import { DatePicker, Form, Input, Modal, Radio, Select, Space, TimePicker } from "antd"
+import { RangePickerProps } from "antd/lib/date-picker"
 import React from "react"
-
+import moment from "moment"
 
 interface Props {
     visible?: boolean
@@ -13,15 +14,101 @@ interface Props {
  * @param param0 
  * @returns 
  */
-const MsgPushModal: React.FC<Props> = ({  }) => {
+const MsgPushModal: React.FC<Props> = ({ visible, onClose, onChange }) => {
+
+    /*************************/
+    const [form] = Form.useForm()
+    const sendWay = Form.useWatch('sendWay', form)
+    const startDate = Form.useWatch('startDate', form);
+    const endDate = Form.useWatch('endDate', form);
+    /*************************/
+
+    const handleOk = async () => {
+        let validate = await form.validateFields()
+    }
 
+    const disabledDate: RangePickerProps['disabledDate'] = (current) => {
+        return current && current < moment().startOf('days');
+    };
 
+    const disabledStartDate: RangePickerProps['disabledDate'] = (current) => {
+        if (endDate) {
+            return current && (current < moment().startOf('days') || current > moment(endDate).endOf('days'));
+        }
+        return current && current < moment().startOf('days');
+    };
+
+    const disabledEndDate: RangePickerProps['disabledDate'] = (current) => {
+        if (startDate) {
+            return current && current < moment(startDate).startOf('days');
+        }
+        return current && current < moment().startOf('days');
+    };
 
     return <Modal
         title='新建游戏内消息推送'
-
+        visible={visible}
+        onCancel={onClose}
+        onOk={handleOk}
     >
-
+        <Form
+            name="basicMsgPush"
+            form={form}
+            labelCol={{ span: 4 }}
+            wrapperCol={{ span: 20 }}
+            autoComplete="off"
+            initialValues={{ sendWay: 0 }}
+            colon={false}
+            labelAlign="left"
+        >
+            <Form.Item
+                label={<strong>任务标题</strong>}
+                name="name"
+                rules={[{ required: true, message: '请输入任务标题' }]}
+            >
+                <Input placeholder="请输入任务标题" />
+            </Form.Item>
+            <Form.Item
+                label={<strong>发送类型</strong>}
+                name="sendWay"
+                rules={[{ required: true, message: '请选择发送类型' }]}
+            >
+                <Radio.Group
+                    options={[{ label: '立即发送', value: 0 }, { label: '定时发送', value: 1 }, { label: '每日循环', value: 2 }]}
+                    optionType="button"
+                    buttonStyle="solid"
+                />
+            </Form.Item>
+            {sendWay === 1 ? <Form.Item
+                label={<strong>发送时间</strong>}
+                name="sendTime"
+                rules={[{ required: true, message: '请选择发送时间' }]}
+            >
+                <DatePicker disabledDate={disabledDate} showTime />
+            </Form.Item> : sendWay === 2 ? <>
+                <Form.Item
+                    label={<strong>发送日期</strong>}
+                    required
+                >
+                    <Space>
+                        <Form.Item name='startDate' rules={[{ required: true, message: '请选择开始日期' }]} noStyle>
+                            <DatePicker disabledDate={disabledStartDate} placeholder={'开始时间'} />
+                        </Form.Item>
+                        <span>-</span>
+                        <Form.Item name='endDate' noStyle>
+                            <DatePicker disabledDate={disabledEndDate} placeholder={'结束日期'} />
+                        </Form.Item>
+                    </Space>
+                </Form.Item>
+                <Form.Item
+                    label={<strong>发送时间</strong>}
+                    name="sendTime"
+                    rules={[{ required: true, message: '请选择发送时间' }]}
+                >
+                    <TimePicker />
+                </Form.Item>
+            </> : null}
+        </Form>
     </Modal>
 }
 

+ 4 - 4
src/pages/gameDataStatistics/stream/recharge/index.tsx

@@ -34,7 +34,7 @@ const Recharge: React.FC = () => {
             leftChild={<QueryForm
                 initialValues={{ sourceSystem: 'ZX_ONE', consumeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
-                    const { costBeginDay, costEndDay, beginOrderTime, endOrderTime, ...params } = data
+                    const { costBeginDay, costEndDay, createDay, ...params } = data
                     let newQueryForm = JSON.parse(JSON.stringify(queryForm))
                     if (costBeginDay && costEndDay) {
                         newQueryForm.costBeginDate = costBeginDay
@@ -43,9 +43,9 @@ const Recharge: React.FC = () => {
                         delete newQueryForm.costBeginDate
                         delete newQueryForm.costEndDate
                     }
-                    if (beginOrderTime && endOrderTime) {
-                        newQueryForm.orderBeginDate = beginOrderTime
-                        newQueryForm.orderEndDate = endOrderTime
+                    if (createDay && createDay?.length === 2) {
+                        newQueryForm.orderBeginDate = moment(createDay[0]).format('YYYY-MM-DD')
+                        newQueryForm.orderEndDate = moment(createDay[1]).format('YYYY-MM-DD')
                     } else {
                         delete newQueryForm.orderBeginDate
                         delete newQueryForm.orderEndDate