Commit c5f878cc authored by danzw1995's avatar danzw1995
parents 5ad47bcb ca309d1c
/**
* 公共部分
*/
export default {
export default {
/** button */
'common.button.save': '保存',
'common.button.confirm': '确定',
......@@ -33,10 +33,10 @@
'common.tip.save.success': '保存成功',
/** tabel */
'common.table.action': "操作",
'common.table.action': '操作',
/** table */
'common.table.status': "状态",
'common.table.columns.memberName': "商家名称",
'common.table.status': '状态',
'common.table.columns.memberName': '商家名称',
/** status */
'common.status.effective': '有效',
......@@ -85,5 +85,16 @@
'common.form.rule.only.number': '只允许填写数字',
'common.form.upload.placeholder': '请上传',
}
'common.error.nindangqianwuquan': '您当前无权访问该页面',
'common.error.chongxindenglu': '重新登录',
'common.error.aiya!yemian': '哎呀!页面未找到',
'common.error.gaicuowukeneng': '该错误可能由于如下原因所致',
'common.error.yemianyishixiao': '页面已失效',
'common.error.yemianyixiugai': '页面已修改或者删除',
'common.error.fanhuidaozhuye': '返回到主页',
'common.error.aiya!wangluo': '哎呀!网络连接出错了',
'common.error.diannaoweilianjie': '电脑未连接到网络',
'common.error.fanghuoqianghuosha': '防火墙或杀毒软件阻止',
'common.error.shuaxinyemianshi': '刷新页面试试',
'common.error.shushangyunfu': '数商云服务',
}
import React from 'react';
import { history } from 'umi';
import { Button, Row, Col } from 'antd';
import { GlobalConfig } from '@/global/config';
import UserHeader from '../layouts/components/UserHeader';
import { useIntl } from 'umi'
import styles from './index.less'
import Img from '../../mockStatic/illus.png'
const NoFoundPage: React.FC<{}> = () => {
const intl = useIntl()
const handleReturn = () => {
history.replace('/user/login')
......@@ -18,17 +18,17 @@ const NoFoundPage: React.FC<{}> = () => {
<Row>
<Col span={12}>
<div className={styles.desc}>
<h1>您当前无权访问该页面</h1>
<h1>{intl.formatMessage({ id: 'common.error.nindangqianwuquan', defaultMessage: '您当前无权访问该页面' })}</h1>
<Button
type="primary"
size="large"
style={{marginTop: 100}}
onClick={handleReturn}
>重新登录</Button>
>{intl.formatMessage({ id: 'common.error.chongxindenglu', defaultMessage: '重新登录' })}</Button>
</div>
</Col>
<Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务"/>
<img className={styles.image} src={Img} alt={intl.formatMessage({ id: 'common.error.shushangyunfu', defaultMessage: '数商云服务' })}/>
</Col>
</Row>
</div>
......
import React from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { Button, Row, Col } from 'antd';
import { GlobalConfig } from '@/global/config';
import UserHeader from '../layouts/components/UserHeader';
......@@ -7,6 +7,7 @@ import styles from './index.less'
import Img from '../../mockStatic/illus.png'
const NoFoundPage: React.FC<{}> = () => {
const intl = useIntl()
const handleReturn = () => {
history.go(-1)
......@@ -19,20 +20,20 @@ const NoFoundPage: React.FC<{}> = () => {
<Row>
<Col span={12}>
<div className={styles.desc}>
<h1>哎呀!页面未找到</h1>
<h4>该错误可能由于如下原因所致</h4>
<p>·页面已失效</p>
<p>·页面已修改或者删除</p>
<h1>{intl.formatMessage({ id: 'common.error.aiya!yemian', defaultMessage: '哎呀!页面未找到' })}</h1>
<h4>{intl.formatMessage({ id: 'common.error.gaicuowukeneng', defaultMessage: '该错误可能由于如下原因所致' })}</h4>
<p>·{intl.formatMessage({ id: 'common.error.yemianyishixiao', defaultMessage: '页面已失效' })}</p>
<p>·{intl.formatMessage({ id: 'common.error.yemianyixiugai', defaultMessage: '页面已修改或者删除' })}</p>
<Button
type="primary"
size="large"
style={{marginTop: 100}}
onClick={handleReturn}
>返回到主页</Button>
>{intl.formatMessage({ id: 'common.error.fanhuidaozhuye', defaultMessage: '返回到主页' })}</Button>
</div>
</Col>
<Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务"/>
<img className={styles.image} src={Img} alt={intl.formatMessage({ id: 'common.error.shushangyunfu', defaultMessage: '数商云服务' })} />
</Col>
</Row>
</div>
......
import React from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { Button, Row, Col } from 'antd';
import { GlobalConfig } from '@/global/config';
import UserHeader from '../layouts/components/UserHeader';
......@@ -7,6 +7,7 @@ import styles from './index.less'
import Img from '../../mockStatic/Artwork.png'
const InternetError: React.FC<{}> = () => {
const intl = useIntl()
const handleReload = () => {
history.go(-1)
......@@ -19,20 +20,20 @@ const InternetError: React.FC<{}> = () => {
<Row>
<Col span={12}>
<div className={styles.desc}>
<h1>哎呀!网络连接出错了</h1>
<h4>该错误可能由于如下原因所致</h4>
<p>·电脑未连接到网络</p>
<p>·防火墙或杀毒软件阻止</p>
<h1>{intl.formatMessage({ id: 'common.error.aiya!wangluo', defaultMessage: '哎呀!网络连接出错了' })}</h1>
<h4>{intl.formatMessage({ id: 'common.error.gaicuowukeneng', defaultMessage: '该错误可能由于如下原因所致' })}</h4>
<p>·{intl.formatMessage({ id: 'common.error.diannaoweilianjie', defaultMessage: '电脑未连接到网络' })}</p>
<p>·{intl.formatMessage({ id: 'common.error.fanghuoqianghuosha', defaultMessage: '防火墙或杀毒软件阻止' })}</p>
<Button
type="primary"
size="large"
style={{ marginTop: 100 }}
onClick={handleReload}
>刷新页面试试</Button>
>{intl.formatMessage({ id: 'common.error.shuaxinyemianshi', defaultMessage: '刷新页面试试' })}</Button>
</div>
</Col>
<Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务" />
<img className={styles.image} src={Img} alt={intl.formatMessage({ id: 'common.error.shushangyunfu', defaultMessage: '数商云服务' })} />
</Col>
</Row>
</div>
......
......@@ -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