import React, { useCallback, useEffect, useRef, useState } from 'react' import styles from './index.module.scss' import TopCom from '@/components/TopCom' import classNames from 'classnames' import { Button, Form, FormInstance, Input, InputNumber } from 'antd' import TextArea from 'antd/es/input/TextArea' import { EyeOutlined, CloseOutlined } from '@ant-design/icons' import MyPopconfirm from '@/components/MyPopconfirm' import { ImageViewer } from 'antd-mobile' import { domShowFu } from '@/utils/domShow' import dayjs from 'dayjs' import htmlToPdf2 from '@/utils/htmlToPdf2' import { MessageFu } from '@/utils/message' import ZinfoPop from '@/components/ZinfoPop' import history from '@/utils/history' type FormType = { name: string phone: string ID: string num1: null | number num2: null | null jigou: string miaoshu: string } function A5order() { useEffect(() => { FormBoxRef.current?.setFieldsValue({ name: '王大锤', phone: '18702025091', ID: '421083199504071212', num1: 3, num2: null, jigou: '机构机构', miaoshu: '' }) }, []) // 表单的ref const FormBoxRef = useRef(null) // 没有通过校验 const onFinishFailed = useCallback(() => {}, []) // 点击提交的页面元素显示和隐藏 const [time, setTime] = useState('') // 导出pdf文本域换行问题 const [tetx, setText] = useState({ 1: '', 2: '' }) // 打开提示弹窗 const [titPop, setTitPop] = useState('') // 通过校验点击确定 const onFinish = useCallback(async (values: FormType) => { setTitPop('succ') console.log(123, values) // domShowFu('#AsyncSpinLoding', true) // setText({ // 1: values.jigou.replaceAll(/(\n|\r|\r\n)/g, '
'), // 2: values.miaoshu.replaceAll(/(\n|\r|\r\n)/g, '
') // }) // const time = dayjs(new Date()).format('YYYY-MM-DD HH:mm') // setTime(time) // window.setTimeout(() => { // const dom = document.querySelector('.A5listMain') as HTMLDivElement // if (dom) { // const name = '预约申请单' // htmlToPdf2(dom, name, () => { // // 打开预约成功的弹窗 // // setTime('') // // domShowFu('#AsyncSpinLoding', false) // }) // } else { // MessageFu.warning('找不到元素!') // setTime('') // domShowFu('#AsyncSpinLoding', false) // } // }, 500) }, []) const [fileUrl, setFileUrl] = useState({ src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', name: '' }) return (
{/* 顶部 */}

预约日期:11月21日上午

预约课程:英语课程英语课程英语

{time ? (

申请时间: {time}

) : null}
{/* 第一个卡片 */}
负责人信息
e.target.value.replace(/\s+/g, '')} >
{/* 第二个卡片 */}
团队信息
{/* 文本域不换行问题 */} {time ? ( <>
*所属机构
*团队描述
) : ( <> e.target.value.replace(/\s+/g, '')} >