import React from 'react' import { connect, Dispatch } from 'umi'; import i18n from 'i18next'; import { useTranslation, Trans } from 'react-i18next' import { Input, Modal, Form } from 'antd' import styles from './index.less'; import type { kFModelState } from './model' type FieldType = { name?: string; }; interface kFProps { dispatch: Dispatch; kFModel: kFModelState; getKfList: () => void; kb_id: string } const Index: React.FC = ({ kFModel, dispatch, getKfList, kb_id }) => { const { isShowCEFwModal } = kFModel const { t } = useTranslation() const handleCancel = () => { dispatch({ type: 'kFModel/updateState', payload: { isShowCEFwModal: false } }); }; const [form] = Form.useForm() const handleOk = async () => { try { const values = await form.validateFields(); dispatch({ type: 'kFModel/document_create', payload: { name: values.name, kb_id }, callback: () => { dispatch({ type: 'kFModel/updateState', payload: { isShowCEFwModal: false } }); getKfList && getKfList() } }); } catch (errorInfo) { console.log('Failed:', errorInfo); } }; return (
label="文件名" name="name" rules={[{ required: true, message: 'Please input value!' }]} >
); } export default connect(({ kFModel, loading }) => ({ kFModel, loading }))(Index);