Commit a886a859 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 0c6212d1 dc62a437
export default {
'/api': {
'target': 'http://10.0.0.25:8100/',
'target': 'http://10.0.0.10:8100/',
'changeOrigin': true,
'pathRewrite': { '^/api': '' },
}
......
/*
* @Author: Xujiamin
* @Date: 2020-08-26 21:02:23
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-14 14:34:28
* @LastEditors: Please set LastEditors
* @LastEditTime: 2020-10-21 19:00:05
* @Description: 系统能力路由相关
*/
import { RouterChild } from '../utils';
......@@ -91,13 +91,35 @@ const AuthConfigRoute: RouterChild = {
name: 'accountSetting',
component: '@/pages/accountSetting'
},
// 账号修改
// 密码修改
{
path: '/memberCenter/systemSetting/accountSetting/edit',
path: '/memberCenter/systemSetting/accountSetting/loginPwd',
name: 'editAccount',
component: '@/pages/accountSetting/editAccount',
hideInMenu: true,
}
},
// 邮箱修改
{
path: '/memberCenter/systemSetting/accountSetting/email',
name: 'editAccount',
component: '@/pages/accountSetting/editAccount',
hideInMenu: true,
},
// 手机修改
{
path: '/memberCenter/systemSetting/accountSetting/phone',
name: 'editAccount',
component: '@/pages/accountSetting/editAccount',
hideInMenu: true,
},
// 支付密码
{
path: '/memberCenter/systemSetting/accountSetting/paycode',
name: 'editAccount',
component: '@/pages/accountSetting/editAccount',
hideInMenu: true,
},
//
],
}
......
import React, { useState } from 'react'
import { Tag, Row } from 'antd'
import { useFormEffects, ISchemaFieldComponentProps } from '@formily/antd'
import { RiskCheck } from 'god'
const SliderValidate = (props: ISchemaFieldComponentProps) => {
const { value = [], mutators } = props
const xPoint = 80
const yPoint = 30
const imgUrl = 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1603280613858&di=b810f23b7c17affe6a2be8a28cecd857&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F14%2F75%2F01300000164186121366756803686.jpg'
const componentProps = {
xPoint,
yPoint,
imgUrl
}
return (
<div>
<RiskCheck {...componentProps} imgWidth={300}/>
</div>
)
}
SliderValidate.defaultProps = {}
SliderValidate.isFieldComponent = true;
export default SliderValidate
\ No newline at end of file
......@@ -26,6 +26,7 @@ import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import VirtualChildren from './components/VirtualChildren';
import SmilingFace from './components/SmilingFace';
import SliderValidate from './components/SliderValidate';
import { useLinkComponentProps } from './linkages/linkComponentProps';
import Loading from '../Loading';
......@@ -98,6 +99,7 @@ export const componentExport = {
DateSelect,
VirtualChildren,
SmilingFace,
SliderValidate,
RadioGroup: Radio.Group
}
const NiceForm: React.FC<NiceFormProps> = props => {
......
......@@ -17,9 +17,10 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
linkage.loading(name)
service().then(res => {
let enums = []
if (format) {
const [labelString, valueString] = format
res = res.map(v => ({
enums = res.map(v => ({
label: v[labelString],
value: v[valueString]
}))
......@@ -29,7 +30,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
linkage.loaded(name)
linkage.enum(name, res)
linkage.enum(name, enums)
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch('requestAsyncSelect', {
name,
......
......@@ -51,7 +51,7 @@ const TypeVerify: React.FC<IProps> = (props) => {
} else if(type == 'paycode') {
title = paycode == 0 ? "设置支付密码" : "重置支付密码"
}
return <Link to={`/memberCenter/systemSetting/editAccount?type=${type}`}>{title}</Link>
return <Link to={`/memberCenter/systemSetting/accountSetting/${type}`}>{title}</Link>
}
return (
......
......@@ -23,7 +23,11 @@ interface accountProps {
}
const EditAccount = (props) => {
const { type = 'loginPwd' } = props.location.query
const pathnameSplit = props.location.pathname.split("/")
const length = pathnameSplit.length;
const type = pathnameSplit[length - 1] || "loginPwd";
console.log(type);
// const { type = 'loginPwd' } = props.location.query
const [account, setAccount] = useState<accountProps>({})
const MAP = {
......
......@@ -230,7 +230,7 @@ const MemberMaintain: React.FC<[]> = () => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -222,7 +222,7 @@ const MemberPr1: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -222,7 +222,7 @@ const MemberPr2: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -12,7 +12,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { PublicApi } from '@/services/api';
import { MEMBER_INNER_STATUS_SUCCESS } from '@/constants';
import { MEMBER_INNER_STATUS_FAILED } from '@/constants';
import { auditSchema } from '../schema/auditSchema';
import {
MEMBER_STATUS_TAG_MAP,
......@@ -126,7 +126,10 @@ const MemberPrConfirm: React.FC<{}> = props => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
selectedRowKeys: selectedRowKeys,
getCheckboxProps: record => ({
disabled: record.innerStatus === MEMBER_INNER_STATUS_FAILED,
}),
};
const fetchListData = async (params: any) => {
......@@ -225,7 +228,7 @@ const MemberPrConfirm: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -222,7 +222,7 @@ const MemberPrSubmit: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-07 16:33:12
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-23 19:44:24
* @LastEditTime: 2020-10-21 17:39:44
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -70,17 +70,12 @@ export const channelSchema: ISchema = {
remark: {
type: 'string',
title: '渠道描述',
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 5,
placeholder: '最大200个字符,100个汉字',
},
'x-rules': [
{
required: true,
message: '请填写渠道描述'
},
{
limitByte: true, // 自定义校验规则
maxByte: 200,
......
......@@ -12,12 +12,11 @@ export interface OrderHandReceivedModalProps {
const OrderHandReceivedModal:React.FC<OrderHandReceivedModalProps> = ({currentRef}) => {
const { formContext } = useContext(OrderDetailContext)
const { data } = useContext(OrderDetailContext)
const [confirmVisible, setConfirmVisible] = useState(false)
const formData = formContext.data || {}
const formData = data || {}
const { run, loading } = useHttpRequest(PublicApi.postOrderManualConfirmReceipt)
const handleConfirm = async () => {
console.log('确认收货')
const { code } = await run({
orderId: formData.id
})
......
......@@ -18,7 +18,7 @@ const ReadyReceiveOrderDetail: React.FC = () => {
const approvedRef = useRef<any>({})
// 是否是手工收货
const isHeadReceipt = formContext && formContext.data.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER
const isHeadReceipt = formContext.data && formContext.data.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER
const handleClick = useCallback(() => {
if (isHeadReceipt) {
......
......@@ -16,7 +16,7 @@ const ReadyConfirmDelevedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
// 是否是手工发货
const isHandDeleved = formContext && formContext.data && formContext.data.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER
const isHandDeleved = formContext.data && formContext.data.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER
// 所有发货单都是否已经发货了
const isShowBtn = formContext.data?.orderDeliveryDetailsResponses?.some(v => v.interiorState === DeliverySideState.ADD_LOGISTICS_ORDER)
......
......@@ -2,9 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-29 09:48:52
* @LastEditTime: 2020-10-22 09:25:26
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
......@@ -392,6 +394,50 @@ export const useBusinessEffects = (context, actions) => {
const { name, originAsyncData, value } = fieldState;
const current = originAsyncData.find(item => item.productId === value);
// 取消选择
if (!value) {
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.productId`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.productName`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.price`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.productCount`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.amount`
}),
state => {
state.value = `¥0.00`;
}
);
}
if (!current) {
return;
}
......@@ -417,7 +463,7 @@ export const useBusinessEffects = (context, actions) => {
return `invoicesDetailsRequests.${$1}.price`
}),
state => {
state.value = current.price;
state.value = (current.price / current.purchaseCount).toFixed(2);
}
);
setFieldState(
......@@ -425,7 +471,7 @@ export const useBusinessEffects = (context, actions) => {
return `invoicesDetailsRequests.${$1}.productCount`
}),
state => {
state.value = 1;
state.value = current.purchaseCount;
}
);
setFieldState(
......@@ -433,7 +479,7 @@ export const useBusinessEffects = (context, actions) => {
return `invoicesDetailsRequests.${$1}.amount`
}),
state => {
state.value = `¥${(1 * current.price).toFixed(2)}`;
state.value = `¥${(1 * (current.price / current.purchaseCount)).toFixed(2)}`;
}
);
});
......@@ -458,13 +504,22 @@ export const useBusinessEffects = (context, actions) => {
if (!current || isNaN(+value)) {
return;
}
if (value > current.purchaseCount) {
Modal.confirm({
title: '提示',
content: '单据数量已超过商品数量',
okText: '确认',
cancelText: '取消',
});
}
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.amount`
}),
state => {
state.value = `¥${(+value * current.price).toFixed(2)}`;
state.value = `¥${(+value * (current.price / current.purchaseCount)).toFixed(2)}`;
}
);
});
......
......@@ -527,7 +527,7 @@ const AddBills: React.FC<{}> = (props: any) => {
product: undefined,
productName: item.productName,
productId: '',
price: 0,
price: '',
productCount: 0,
amount: '',
}));
......
......@@ -38,7 +38,7 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
membersName: {
supplyMembersName: {
type: 'string',
default: undefined,
'x-component-props': {
......
import React, { useState, Fragment } from 'react';
import cx from 'classnames';
import { Row } from 'antd';
import { Link, Helmet } from 'umi'
import { Row, Button } from 'antd';
import { Link, Helmet, history } from 'umi'
import { FormPage, RiskCheck } from 'god'
import { IFormControllers, IFormButtonTypes } from 'god/dist/src/form-page'
import './index.less'
......@@ -9,90 +9,25 @@ import NiceForm from '@/components/NiceForm';
import { forgetPwdSchema } from './schema';
import { PATTERN_MAPS } from '@/constants/regExp';
import { omit } from '@/utils';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
const actions = createFormActions()
const GetBack: React.FC = () => {
const [validButton, setValidButton] = useState(true)
const finish = (value: any) => {
console.log(value, 'finish')
}
const handleSubmit = (value: any) => {
const handleSubmit = async (value: any) => {
const { account } = value
const accountParams = PATTERN_MAPS.email.test(account) ? {email: account, ...omit(value, ['account'])} : { phone: account, ...omit(value, ['account']) }
console.log(accountParams)
}
const getBcakForm: IFormControllers[] = [
{
type: 'Input',
name: 'phonemail',
span: 24,
inputProps: {
type: 'phonemail',
placeholder: '请输入您的邮箱/手机',
},
rules: [
{ required: true, message: '邮箱/手机为必填项!' }
]
},
// {
// span: 24,
// // @ts-ignore
// custom: () => <RiskCheck />
// },
{
type: 'Verification',
name: 'smsCode',
span: 24,
inputProps: {
const isEmail = PATTERN_MAPS.email.test(account)
const accountParams = isEmail ? {email: account, ...omit(value, ['account', 'confirmPassword'])} : { phone: account, ...omit(value, ['account', 'confirmPassword']) }
const submitFn = isEmail ? PublicApi.postMemberRegisterResetEmail : PublicApi.postMemberRegisterResetSms
}
},
{
type: 'Input',
name: 'password',
span: 24,
inputProps: {
type: 'password',
placeholder: '设置你的密码',
},
rules: [
{ required: true, message: '密码为必填项!' },
{ pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,20}$/, message: '密码长度8-20个字符,必须包含大小写字母和数字!' }
],
},
{
type: 'Input',
name: 'confirm',
span: 24,
dependencies: ['password'],
inputProps: {
type: 'password',
placeholder: '请再次输入密码',
},
rules: [
{ required: true, message: '请再次确认密码!' },
({ getFieldValue }) => ({
validator(rule, value) {
if (!value || getFieldValue('password') === value) {
return Promise.resolve();
}
return Promise.reject('两次的密码输入不一致!');
},
}),
]
},
]
const getBackButtons: IFormButtonTypes[] = [
{
text: '提交',
type: 'primary',
htmlType: 'submit',
block: true,
disabled: false,
const { code } = await submitFn(accountParams)
if (code === 1000) {
history.replace('/user/login')
}
]
}
const SubmitBtn = <Button type='primary' block htmlType='submit'>提交</Button>
return (
<Fragment>
......@@ -105,6 +40,10 @@ const GetBack: React.FC = () => {
<NiceForm
schema={forgetPwdSchema}
onSubmit={handleSubmit}
actions={actions}
expressionScope={{
SubmitBtn
}}
effects={($, { setFieldState, getFieldState }) => {
$('onFieldValueChange', '*(password,confirmPassword)').subscribe(fieldState => {
const selfName = fieldState.name
......@@ -128,6 +67,10 @@ const GetBack: React.FC = () => {
})
}}
/>
<p className={'formBox'}>
<Link className='back' to={'/user/login'}>返回登录页</Link>
</p>
</div>
</Row>
</Fragment>
......
......@@ -202,12 +202,19 @@ export const forgetPwdSchema: ISchema = {
size: 'large'
}
},
SliderValidate: {
type: 'object',
"x-component": "SliderValidate"
},
smsCode: {
type: 'string',
"x-component": 'Phone',
required: true,
"x-rules": [
{
required: true,
message: '请输入验证码'
},
{
pattern: PATTERN_MAPS.smsCode,
message: '请输入正确的6位验证码'
}
......@@ -229,6 +236,8 @@ export const forgetPwdSchema: ISchema = {
if (res.code === 1000) {
callback()
}
}).finally(() => {
setLoading(false)
})
}
......@@ -240,6 +249,8 @@ export const forgetPwdSchema: ISchema = {
if (res.code === 1000) {
callback()
}
}).finally(() => {
setLoading(false)
})
}
})
......@@ -282,9 +293,12 @@ export const forgetPwdSchema: ISchema = {
size: 'large',
}
},
submit: {
VirtualChildren: {
type: 'string',
"x-component": 'Submit'
"x-component": 'VirtualChildren',
"x-component-props": {
children: "{{SubmitBtn}}"
}
}
}
}
......
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