Commit ca309d1c authored by GuanHua's avatar GuanHua
parents 27360561 fc11325f
......@@ -115,7 +115,7 @@ const Home: React.FC<{}> = () => {
layouts={layout}
/>
</div>
<a href="https://www.yuque.com/shushangyun-lingxi/xr7ol7/eh909i" target="__blank" className={styles.controller}>
<a href="https://www.yuque.com/xsnnko/kh076h" target="__blank" className={styles.controller}>
<CompassFilled className={styles.icon} />
<span className={styles.text}>{intl.formatMessage({ id: 'home.guide' })}</span>
</a>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-30 20:07:59
* @LastEditTime: 2021-12-03 15:07:15
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
......@@ -300,15 +300,15 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
const { value } = state;
const releaseTimeEndValue = value?.[1];
const effectiveTime = getFieldValue('[effectiveTimeStart, effectiveTimeEnd]'); // 券有效期
const effectiveTimeStartValue = effectiveTime?.[0];
const effectiveTimeEndValue = effectiveTime?.[1];
if (
releaseTimeEndValue
&& effectiveTimeStartValue
&& moment(releaseTimeEndValue) > moment(effectiveTimeStartValue)
&& effectiveTimeEndValue
&& moment(releaseTimeEndValue) >= moment(effectiveTimeEndValue)
) {
setFieldState('[releaseTimeStart, releaseTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '领(发)券截止时间应该小于券有效期起始时间');
FormPath.setIn(fieldState, 'errors', '领(发)券截止时间应该小于券有效期截止时间');
});
} else {
actions.clearErrors('[releaseTimeStart, releaseTimeEnd]');
......@@ -318,17 +318,17 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
// 券有效期始时间
onFieldValueChange$('[effectiveTimeStart, effectiveTimeEnd]').subscribe(state => {
const { value } = state;
const effectiveTimeStartValue = value?.[0];
const effectiveTimeEndValue = value?.[1];
const releaseTime = getFieldValue('[releaseTimeStart, releaseTimeEnd]'); // 券有效期
const releaseTimeEndValue = releaseTime?.[1];
if (
effectiveTimeStartValue
effectiveTimeEndValue
&& releaseTimeEndValue
&& moment(effectiveTimeStartValue) < moment(releaseTimeEndValue)
&& moment(effectiveTimeEndValue) <= moment(releaseTimeEndValue)
) {
setFieldState('[effectiveTimeStart, effectiveTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '券有效期起始时间应该大于等于领(发)券截止时间');
FormPath.setIn(fieldState, 'errors', '券有效期截止时间应该大于领(发)券截止时间');
});
} else {
actions.clearErrors('[effectiveTimeStart, effectiveTimeEnd]');
......
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