Commit 514e19b3 authored by XieZhiXiong's avatar XieZhiXiong

chore: 修改正则

parent 6eee6ecc
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-15 13:38:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-15 14:10:11
* @LastEditTime: 2021-06-18 16:52:22
* @Description: 联动逻辑
*/
import { FormEffectHooks, FormPath } from '@formily/antd';
......@@ -21,7 +21,7 @@ export const useBusinessEffects = (context, actions, fieldName: string) => {
const { name, value } = fieldState;
if (value && value.length) {
setFieldState(
FormPath.transform(name, /\d/, $1 => {
FormPath.transform(name, /^\d$/, $1 => {
return `${fieldName}.${$1}.expireDay`
}),
state => {
......@@ -34,9 +34,9 @@ export const useBusinessEffects = (context, actions, fieldName: string) => {
// 如果选择了到期日,则清空 有效期
onFieldInputChange$(`${fieldName}.*.expireDay`).subscribe(fieldState => {
const { name, value } = fieldState;
if (value && value.length) {
if (value) {
setFieldState(
FormPath.transform(name, /\d/, $1 => {
FormPath.transform(name, /^\d$/, $1 => {
return `${fieldName}.${$1}.permanent`
}),
state => {
......
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