Commit 5199f69d authored by XieZhiXiong's avatar XieZhiXiong

chore: 替换时间选择器

parent 60f0b1ec
......@@ -21,6 +21,7 @@ import {
} from '@/constants/marketing';
import AnchorPage from '@/components/AnchorPage';
import NiceForm from '@/components/NiceForm';
import FormilyRangeTime from '@/components/RangeTime/FormilyRangeTime';
import schema from './schema';
import { createEffects } from './effects';
import { ProductItemType } from '../GoodsDrawer';
......@@ -419,6 +420,7 @@ const CouponForm: React.FC<IProps> = (props) => {
CategoriesList,
CascaderFormItem,
ApplicableGoodsFormItem,
FormilyRangeTime,
}}
expressionScope={{
renderTableItemRemove,
......
......@@ -103,21 +103,10 @@ const schema: ISchema = {
title: intl.formatMessage({ id: 'merchantCoupon.giveCouponTime' }),
type: 'string',
required: true,
'x-component': 'RangePicker',
'x-component': 'FormilyRangeTime',
'x-component-props': {
placeholder: [intl.formatMessage({ id: 'merchantCoupon.giveCouponStartTime' }), intl.formatMessage({ id: 'merchantCoupon.giveCouponEndTime' })],
showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if ((type === 'start' || type === 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
disabledSeconds: () => range(0, 60).splice(0, moment().get('second')),
};
}
return {};
},
},
},
},
......@@ -300,21 +289,10 @@ const schema: ISchema = {
'[effectiveTimeStart, effectiveTimeEnd]': {
title: ' ',
type: 'string',
'x-component': 'RangePicker',
'x-component': 'FormilyRangeTime',
'x-component-props': {
placeholder: [`${intl.formatMessage({ id: 'merchantCoupon.effectiveTimeEnd'})}`, `${intl.formatMessage({ id: 'merchantCoupon.劵Validperioddeadline'})}`],
showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if ((type === 'start' || type === 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
disabledSeconds: () => range(0, 60).splice(0, moment().get('second')),
};
}
return {};
},
},
},
invalidDay: {
......
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