You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
import React, { useEffect, useRef, useState } from 'react';
|
|
import { connect } from "react-redux";
|
|
import { Modal, Form } from "@douyinfe/semi-ui";
|
|
const VacateRemark = (props) => {
|
|
const { dispatch, actions, onCancel, close, remarkData } = props;
|
|
console.log(actions, 'actionsactionsactions');
|
|
const { humanAffairs } = actions;
|
|
const form = useRef();//表单
|
|
//初始化
|
|
useEffect(() => { }, []);
|
|
|
|
function handleOk() {
|
|
form.current.validate().then((values) => {
|
|
dispatch(humanAffairs.createVacateRemark({ pepUserId: remarkData.pepUserId, remark: values.remark || '' })).then((res) => {
|
|
if (res.success) {
|
|
close();
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
return (
|
|
<Modal title='添加备注'
|
|
visible={true}
|
|
destroyOnClose
|
|
okText='保存' width={800}
|
|
onOk={handleOk}
|
|
onCancel={onCancel}>
|
|
<Form getFormApi={(formApi) => (form.current = formApi)} labelPosition={'left'}>
|
|
<Form.TextArea
|
|
field="remark"
|
|
label='备注'
|
|
initValue={remarkData?.remark || ""}
|
|
placeholder="请输入备注"
|
|
/>
|
|
</Form>
|
|
</Modal>
|
|
)
|
|
}
|
|
|
|
function mapStateToProps(state) {
|
|
const { global } = state;
|
|
return {
|
|
actions: global.actions,
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(VacateRemark);
|