forked from gzzfw/frontEnd/gzDyh

dminyi
2024-09-07 80e40362a760c5c53c51e8a1e79c9a11c6a0f5fe
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
import React, { Fragment, useState } from 'react';
import { register, downO, up } from '@/assets/images';
 
export default function ApplyInfo(props) {
  const [list, setList] = useState([
    {
      appType: '上报申请',
      time: '2024-7-12 10:00',
      addr: '白云区新市街汇桥北社区委员会 ',
      people: '李晓明',
      status: 1,
      statusName: '审核通过',
      id: 1,
    },
    {
      appType: '上报申请',
      time: '2024-7-12 10:00',
      addr: '白云区新市街汇桥北社区委员会 ',
      people: '李晓明',
      status: 2,
      statusName: '审核中',
      id: 2,
    },
    {
      appType: '上报申请',
      time: '2024-7-12 10:00',
      addr: '白云区新市街汇桥北社区委员会 ',
      people: '李晓明',
      status: 3,
      statusName: '审核不通过',
      id: 3,
    }
  ]);
 
  const toggleView = (id) => {
    setList(list.map(record => {
      if (record.id === id) {
        return {
          ...record,
          showView: !record.showView,
        };
      }
      return record;
    }));
  };
 
  return (
    <div style={{ margin: '0 16px' }}>
      <div>
        {list?.map(item => {
          return <div className='applyInfoClass'>
            <div className='applyInfoClass-img' onClick={() => { toggleView(item.id) }}>
              <img src={item.showView ? up : downO} alt="" className="title-downUp" />
            </div>
            <div className='applyInfoClass-title'>
              <div className='applyInfoClass-title-txt'>{item.appType}</div>
              <div className={`applyInfoClass-title-tag-${item.status}`} >{item.statusName}</div>
            </div>
            <div>
              <span style={{ marginRight: '32px' }}>
                <span style={{ color: '#86909C' }}>申请时间:</span><span>{item.time}</span>
              </span>
              <span style={{ marginRight: '8px' }}>
                <span style={{ color: '#86909C' }}>申请人:</span><span>{item.addr}</span>
              </span>
              <span><span>{item.people}<img src={register} alt="" className="title-register" /></span></span>
            </div>
          </div>
        })}
      </div>
    </div>
  )
}