|
@@ -11,11 +11,12 @@ function A2Share() {
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
|
const shareInfo = useSelector((state: RootState) => state.A2Share.shareInfo);
|
|
|
+ const [form] = Form.useForm()
|
|
|
|
|
|
const onFinish = useCallback(
|
|
|
async (values: any) => {
|
|
|
- if (values.cardinalNumber) {
|
|
|
- const res: any = await shareEditAPI(Number(values.cardinalNumber));
|
|
|
+ if (values.pcsShow) {
|
|
|
+ const res: any = await shareEditAPI(Number(values.pcsShow));
|
|
|
if (res.code === 0) {
|
|
|
MessageFu.success("编辑成功!");
|
|
|
dispatch(getShareAPI());
|
|
@@ -23,9 +24,18 @@ function A2Share() {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- [setOpen]
|
|
|
+ [setOpen,dispatch]
|
|
|
);
|
|
|
|
|
|
+ const getshareInfoFu = useCallback(() => {
|
|
|
+ // console.log('fachu',shareInfo);
|
|
|
+ const { pcsShow } = shareInfo;
|
|
|
+ form.setFieldsValue({
|
|
|
+ pcsShow: pcsShow
|
|
|
+ });
|
|
|
+
|
|
|
+ },[shareInfo, form]);
|
|
|
+
|
|
|
const onFinishFailed = (errorInfo: any) => {
|
|
|
console.log("Failed:", errorInfo);
|
|
|
};
|
|
@@ -53,6 +63,7 @@ function A2Share() {
|
|
|
}}
|
|
|
onClick={() => {
|
|
|
setOpen(true);
|
|
|
+ getshareInfoFu();
|
|
|
}}
|
|
|
>
|
|
|
修改
|
|
@@ -73,6 +84,7 @@ function A2Share() {
|
|
|
}
|
|
|
>
|
|
|
<Form
|
|
|
+ form={form}
|
|
|
name="basic"
|
|
|
labelCol={{ span: 5 }}
|
|
|
onFinish={onFinish}
|
|
@@ -81,14 +93,14 @@ function A2Share() {
|
|
|
>
|
|
|
<Form.Item
|
|
|
label="参与者基数"
|
|
|
- name="cardinalNumber"
|
|
|
+ name="pcsShow"
|
|
|
style={{ marginTop: "40px" }}
|
|
|
- rules={[{ message: "请输入参与者基数!" }]}
|
|
|
+ rules={[{ message: "请输入不超过999999999的正整数!" }]}
|
|
|
getValueFromEvent={(e) =>
|
|
|
e.target.value.replace(/^(0+)|[^\d]+/g, "")
|
|
|
}
|
|
|
>
|
|
|
- <Input placeholder="请输入正整数,不超过9999999" />
|
|
|
+ <Input maxLength={7} placeholder="请输入正整数,不超过9999999" />
|
|
|
</Form.Item>
|
|
|
{/* 确定和取消按钮 */}
|
|
|
<br />
|