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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
| /*
| * @Company: hugeInfo
| * @Author: lwh
| * @Date: 2024-04-08
| * @LastEditTime: 2025-05-12 15:48:53
| * @LastEditors: lwh
| * @Version: 1.0.0
| * @Description: 档案信息组件
| */
| import React, { useState, useEffect } from 'react';
| import { Avatar, Upload, Button } from 'dingtalk-design-mobile';
| import { ApplyDialog, Applied } from './previewTable';
| import InfoView from './../../../../components/InfoView';
| import MyModal from './../../../../components/MyModal';
| import * as $$ from '../../../../utils/utility';
| import './index.less';
|
| const appUrl = $$.appUrl;
| export const Daxx = (props) => {
| const [data, setData] = useState({});
| const [modalImg, setModalImg] = useState({ visible: false, url: '' });
|
| const onPreview = async (file) => {
| const src = `${appUrl.fileUrl}/${appUrl.sys}/${file.showUrl}`;
| window.open(src);
| // if (file.cat === '22_00017-6') {
| // // 文件预览
| // } else {
| // // 图片文件,使用模态框预览
| // setModalImg({ visible: true, url: src });
| // }
| };
|
| useEffect(() => {
| const applyData = props.data?.fakeData?.filter((item) => item.perType === '15_020008-1' || item.perType === '24_00006-1');
| const appliedData = props.data?.fakeData?.filter((item) => item.perType === '15_020008-2' || item.perType === '24_00006-2');
|
| setData({
| ...props.data,
| applyData,
| appliedData,
| });
| }, [props.data]);
|
| // 渲染上传组件
| const renderUpload = (ownerType) => {
| const fileList = data.fileInfoList?.filter((item) => item.ownerType === ownerType)?.[0]?.fileList || [];
|
| return fileList.length > 0 ? (
| <>
| <Upload
| label=""
| disabled
| onPreview={onPreview}
| fileList={fileList}
| type="form-upload"
| accept="*"
| previewContent="预览"
| showUploadList={{
| showRemoveIcon: false,
| showUploadBtn: false,
| }}
| className="daxx-upload-preview-only"
| />
| <MyModal visible={modalImg.visible} center title="查看图片" onClose={() => setModalImg({ visible: false, url: '' })}>
| <div style={{ height: '1px', width: '100%', backgroundColor: 'rgba(126, 134, 142, 0.16)' }}></div>
| <div style={{ height: '300px' }}>
| <img src={modalImg.url} alt="" style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
| </div>
| </MyModal>
| </>
| ) : (
| '-'
| );
| };
|
| return (
| <div className="daxx">
| {/* 申请人 &代理人*/}
| {data.applyData && data.applyData.length > 0 && <ApplyDialog data={data.applyData} />}
| {/* 被申请人 */}
| {data.appliedData && data.appliedData.length > 0 && <Applied data={data.appliedData} />}
|
| <div className="daxx-info">
| <div className="public-space"></div>
| <InfoView
| showButtons={false}
| OnClick={() => {
| console.log('点击编辑');
| }}
| list={[
| {
| type: 'text',
| title: '事项标签',
| key: '-',
| },
| {
| type: 'diy',
| title: '事项状态',
| value: <div className="daxx-info-status-blue">{data.statusName || '-'}</div>,
| },
| {
| type: 'text',
| title: '事项来源',
| value: 'canalName',
| },
| data.canal === '22_00001-1' && {
| type: 'diy',
| title: '来访时间',
| value: <div className="daxx-info-time">{data.visitTime || '-'}</div>,
| },
| data.canal === '22_00001-1' && {
| type: 'text',
| title: '来访人数(人)',
| value: 'visitPeopleNum',
| },
| data.canal === '22_00001-1' && {
| type: 'text',
| title: '来访形式',
| key: <span>来访</span>,
| },
| data.canal === '22_00001-3' && {
| type: 'text',
| title: '来访形式',
| key: <span>排查</span>,
| },
| {
| type: 'text',
| title: '事项编号',
| value: 'caseRef',
| },
| {
| type: 'text',
| title: '事项等级',
| key: <span>{data.caseLevel === 1 ? '一级' : data.caseLevel === 2 ? '二级' : data.caseLevel === 3 ? '三级' : '-'}</span>,
| },
| {
| type: 'text',
| title: '纠纷类型',
| key: <span>{data?.caseTypeFirstName ? `${data.caseTypeFirstName}/${data.caseTypeName}` : '-'}</span>,
| },
| {
| type: 'text',
| title: '纠纷发生时间',
| key: <span>{data.occurTime ? $$.myTimeFormat(data.occurTime, 'YYYY-M-D HH:mm') : '-'}</span>,
| },
| {
| type: 'text',
| title: '纠纷发生地点',
| value: 'addr',
| },
| {
| type: 'text',
| title: '问题属地',
| key: <span>{data?.queAreaName ? `${data.queAreaName}/${data.queRoadName}` : '-'}</span>,
| },
| {
| type: 'text',
| title: '涉及人数(人)',
| value: 'peopleNum',
| },
| {
| type: 'text',
| title: '涉及金额',
| value: 'amount',
| },
| {
| type: 'text',
| title: '事项概况',
| value: 'caseDes',
| },
| {
| type: 'text',
| title: '事项申请',
| value: 'caseClaim',
| paddingBottom: '12px',
| },
| {
| type: 'divider',
| },
| {
| type: 'diy',
| title: '申请材料',
| value: <div className="daxx-info-apply-material">{renderUpload('22_00018-101')}</div>,
| },
| {
| type: 'divider',
| },
| {
| type: 'diy',
| title: '证明材料',
| value: <div className="daxx-info-apply-material">{renderUpload('22_00018-102')}</div>,
| },
| {
| type: 'divider',
| },
| {
| type: 'text',
| title: '登记机构',
| value: 'inputUnitName',
| },
| {
| type: 'text',
| title: '登记人',
| value: 'inputUserName',
| },
| {
| type: 'text',
| title: '登记时间',
| paddingBottom: true,
| key: <span>{data.createTime ? $$.myTimeFormat(data.createTime, 'YYYY-M-D HH:mm') : '-'}</span>,
| },
| {
| type: 'divider',
| },
| ]}
| data={data || {}}
| />
| </div>
| </div>
| );
| };
|
| export default Daxx;
|
|