forked from gzzfw/frontEnd/gzDyh

liyj
2024-09-05 6bbe73072fcb0ee0b7f190e0f3da286518c3d7a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import React, { useRef } from 'react'
import { Row, Col } from 'antd';
import { Form, Input, Button } from '@arco-design/web-react';
import ArcoUpload from '@/components/ArcoUpload';
import { Scrollbars } from "react-custom-scrollbars";
import { escalation } from '@/assets/images/icon';
 
const FormItem = Form.Item;
const TextArea = Input.TextArea;
 
export default function BackModel(props) {
  const formRef = useRef();
 
  const handleSubmit = () => {
    formRef.current.validate(undefined, (errors, values) => {
      console.log(errors, values);
    })
  }
 
  const handleTemplate = (type) => {
    if(type === 1) {
      formRef.current.setFieldValue('trueName', '经初步核查,该事项较为复杂,且涉及多个相关部门的协调配合,为确保能够高效、妥善地解决当事人的问题,特此请求上级给予指导和支持。')
    } else {
      formRef.current.setFieldValue('trueName', '')
    }
  }
 
  return (
    <div>
      <Scrollbars style={{ height: '550px' }} autoHide>
        <Form
          ref={formRef}
          layout='vertical'
          requiredSymbol={false}
          initialValues={{
          }}//默认值
          scrollToFirstError
        >
          <Row>
            <Col span={24}>
              <FormItem
                label='上报至'
                field='trueName'
              >
                <div className='myTag' >
                  <img src={escalation} alt="" className="title-file" />白云区综治中心
                </div>
              </FormItem>
            </Col>
            <Col span={24} style={{ position: 'relative' }}>
              <div style={{ position: 'absolute', display: 'flex ', top: '28px', zIndex: 1 }}>
                <div className='myTag' style={{ marginRight: '22px' }} onClick={() => { handleTemplate(1) }}>公共模板1:通用上报意见范本</div>
                <div className='myTag' onClick={() => { handleTemplate(2) }}>个人模板1:超过处置范围的上报意见</div>
              </div>
              <FormItem
                label={(<div style={{ display: 'flex' }}>上报意见<div className="must">必填</div></div>)}
                field='trueName'
                rules={[{ required: true, message: '请选择回退理由' }]}
              >
 
                <TextArea
                  autoSize={{ minRows: 4, maxRows: 8 }}
                  placeholder='请填写回退的具体理由'
                  style={{ marginTop: '40px' }}
                />
              </FormItem>
            </Col>
            <Col span={24} className="doubleFile">
              <ArcoUpload
                params={{
                  action: ``,
                }}
                field='file'
                label='附件材料'
              />
            </Col>
          </Row>
        </Form>
      </Scrollbars>
      <div className='dialogFooter'>
        <Button
          type="primary"
          className="dialogPrimary"
          onClick={handleSubmit}
        >
          提交
        </Button>
      </div>
    </div>
  )
}