Commit 1fc4e396 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix(商家营销活动): 修复批量操作

parent 5806a28f
import React, { useRef, useState, useImperativeHandle } from 'react'; import React, { useRef, useImperativeHandle, useEffect } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd'; import { Card } from 'antd';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType, TableRowSelection } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'; import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
...@@ -62,9 +62,6 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -62,9 +62,6 @@ const Table: React.FC<Iprops> = (props: any) => {
const [selectRow, selectRowFns] = useRowSelectionTable({ const [selectRow, selectRowFns] = useRowSelectionTable({
customKey: rowKey || 'id', customKey: rowKey || 'id',
extendsSelection: { extendsSelection: {
onChange: (_rowKeys: any) => {
fetchRowkeys(selectRowFns.selectedRowKeys)
},
getCheckboxProps: (record) => getCheckboxProps && getCheckboxProps(record) getCheckboxProps: (record) => getCheckboxProps && getCheckboxProps(record)
} }
}); });
...@@ -122,6 +119,10 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -122,6 +119,10 @@ const Table: React.FC<Iprops> = (props: any) => {
} }
useEffect(() => {
fetchRowkeys && fetchRowkeys(selectRowFns.selectedRowKeys)
}, [selectRowFns])
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
......
...@@ -96,9 +96,9 @@ const columns_3 = ({ ...@@ -96,9 +96,9 @@ const columns_3 = ({
}, },
() => ({ () => ({
validator: (_rule, value) => { validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/; const pattern = /^(\d|[1-9]\d|99.999)(\.\d{1,3})?$/;
if (!pattern.test(value)) { if (!pattern.test(value)) {
return Promise.reject(new Error('折扣必须大于0')); return Promise.reject(new Error('折扣必须大于0且小于100最多保留3为小数'));
} }
return Promise.resolve(); return Promise.resolve();
}, },
......
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