Commit 6fe38a98 authored by XieZhiXiong's avatar XieZhiXiong

feat: 初始展示领券时间、发券数量

parent 93c97ea3
......@@ -2,16 +2,16 @@
* @Author: XieZhiXiong
* @Date: 2021-07-02 15:30:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-02 18:03:50
* @LastEditTime: 2021-09-30 17:02:09
* @Description: 操作 Modal
*/
import React, { useRef } from 'react';
import { Modal } from 'antd';
import ReasonForm, { ReasonValueType, ReasonFormRefHandle } from '../ReasonForm';
import EditForm, { EditSubmitValueType, EditFormRefHandle } from '../EditForm';
import EditForm, { EditSubmitValueType, EditFormRefHandle, EditValueType } from '../EditForm';
export type ActionModalType = 'stop' | 'cancel' | 'startUp' | 'edit';
export type ActionModalValueType = { id: number };
export type ActionModalValueType = { id: number } & Partial<EditValueType>;
interface IProps {
/**
......@@ -96,6 +96,7 @@ const ActionModal: React.FC<IProps> = (props) => {
render: () => (
<EditForm
onSubmit={handleEditSubmit}
value={value}
ref={formRef}
/>
),
......
......@@ -40,6 +40,10 @@ interface IProps {
* 提交触发事件
*/
onSubmit: (values: EditSubmitValueType) => void,
/**
* 值
*/
value: EditValueType,
}
export interface EditFormRefHandle {
......@@ -47,7 +51,7 @@ export interface EditFormRefHandle {
}
const EditForm: React.ForwardRefRenderFunction<EditFormRefHandle, IProps> = ((props, ref) => {
const { onSubmit } = props;
const { onSubmit, value } = props;
useImperativeHandle(ref, () => ({
submit: () => formActions.submit(),
......@@ -70,6 +74,7 @@ const EditForm: React.ForwardRefRenderFunction<EditFormRefHandle, IProps> = ((pr
components={{
DatePicker,
}}
value={value}
effects={($, { setFieldState }) => {
}}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-22 09:49:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-22 13:57:50
* @LastEditTime: 2021-09-30 17:00:59
* @Description: 商家优惠劵查询
*/
import React, { useRef, useState } from 'react';
......@@ -177,7 +177,7 @@ const MerchantCouponQuery: React.FC = () => {
{record.update && (
<Button
type="link"
onClick={() => handleShowActionModal('edit', { id: record.id })}
onClick={() => handleShowActionModal('edit', { id: record.id, releaseTimeStart: moment(record.releaseTimeStart).format('YYYY-MM-DD HH:mm:ss'), releaseTimeEnd: moment(record.releaseTimeEnd).format('YYYY-MM-DD HH:mm:ss'), quantity: `${record.quantity}` })}
>
修改
</Button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment