forked from gzzfw/frontEnd/gzDyh

dminyi
2024-09-11 8d6b46929dc3cb6d012c889f22cb8976fa6bd04d
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/*
 * @Author: dminyi 1301963064@qq.com
 * @Date: 2024-08-27 16:47:12
 * @LastEditors: dminyi 1301963064@qq.com
 * @LastEditTime: 2024-09-11 10:12:32
 * @FilePath: \gzDyh\gz-customerSystem\src\views\register\visit\component\levelDetail.jsx
 * @Description: 右抽屉提示
 */
import React, { useEffect, useState } from 'react';
import MyDrawer from '@/components/MyDrawer';
import { caselogo } from '@/assets/images';
import * as $$ from '@/utils/utility';
 
 
function getCaseDetailApi(data) {
    return $$.ax.request({ urlAi: `case-law/get-case-detail`, typeAi: 'get', service: 'mediate', data });
}
 
 
const EventLevelDrawer = ({ visible, onClose }) => {
    return (
        <MyDrawer
            visible={visible}
            onClose={onClose}
            title="事件等级"
            width={1000}
            style={{ position: 'absolute' }}
            bodyStyle={{ marginTop: '-8px' }}
            titleBefore={true}
        >
            <div style={{ marginTop: '-8px' }}>
                <div>
                    <div style={{ color: '#1A6FB8', fontSize: '15px', lineHeight: '23px', marginBottom: '8px' }}>一级重点事件</div>
                    1、5人(含5人)以上到非接待场所聚集、滞留、静坐、游行或准备上访;<br />
                    2、拉横幅、穿着“状衣”、呼喊口号、呼喊标语、堵塞交通非法占据公其场所、扰乱公共秩序、向他人散发传单等上访材料;<br />
                    3、拖欠工资、劳资纠纷涉及人数5人以上;<br />
                    4、拖欠工资总全额5万元以上,经济合同外涉金额20万元以上;<br />
                    5、扬言到市赴省进京越级上访;
                    6、存在轻生、自残等危险行为,打砸公私财物等极端倾向;<br />
                    7、群体性民事纠纷(5人及5人以上的邻里矛盾纠纷、经济债务纠纷、家庭纠纷等可能导致“民转刑”的民事纠纷);8、存在重大安全隐患、重大不稳定因索的矛盾;9、涉及政治类,非宗教类的非访宣传(在出租屋内从事涉邪教迷信印刷、存放资料的;在公共场所粘贴类似邪教的符号、图案、标志等)10、县(市、区)职能部门、各镇(街道)分管领导根据应急情况认为有必要启动红色预警机制的其他矛盾纠纷。
                </div>
                <div>
                    <div style={{ color: '#1A6FB8', fontSize: '15px', lineHeight: '23px', marginBottom: '8px', marginTop: '20px' }}>二级重点事件</div>
                    1、5人(含5人)以上到非接待场所聚集、滞留、静坐、游行或准备上访;<br />
                    2、拉横幅、穿着“状衣”、呼喊口号、呼喊标语、堵塞交通非法占据公其场所、扰乱公共秩序、向他人散发传单等上访材料;<br />
                    3、拖欠工资、劳资纠纷涉及人数5人以上;<br />
                    4、拖欠工资总全额5万元以上,经济合同外涉金额20万元以上;<br />
                    5、扬言到市赴省进京越级上访;
                    6、存在轻生、自残等危险行为,打砸公私财物等极端倾向;<br />
                    7、群体性民事纠纷(5人及5人以上的邻里矛盾纠纷、经济债务纠纷、家庭纠纷等可能导致“民转刑”的民事纠纷);8、存在重大安全隐患、重大不稳定因索的矛盾;9、涉及政治类,非宗教类的非访宣传(在出租屋内从事涉邪教迷信印刷、存放资料的;在公共场所粘贴类似邪教的符号、图案、标志等)10、县(市、区)职能部门、各镇(街道)分管领导根据应急情况认为有必要启动红色预警机制的其他矛盾纠纷。
                </div>
                <div>
                    <div style={{ color: '#1A6FB8', fontSize: '15px', lineHeight: '23px', marginBottom: '8px', marginTop: '20px' }}>三级普通事件</div>
                    1、5人(含5人)以上到非接待场所聚集、滞留、静坐、游行或准备上访;<br />
                    2、拉横幅、穿着“状衣”、呼喊口号、呼喊标语、堵塞交通非法占据公其场所、扰乱公共秩序、向他人散发传单等上访材料;<br />
                    3、拖欠工资、劳资纠纷涉及人数5人以上;<br />
                    4、拖欠工资总全额5万元以上,经济合同外涉金额20万元以上;<br />
                    5、扬言到市赴省进京越级上访;
                    6、存在轻生、自残等危险行为,打砸公私财物等极端倾向;<br />
                    7、群体性民事纠纷(5人及5人以上的邻里矛盾纠纷、经济债务纠纷、家庭纠纷等可能导致“民转刑”的民事纠纷);8、存在重大安全隐患、重大不稳定因索的矛盾;9、涉及政治类,非宗教类的非访宣传(在出租屋内从事涉邪教迷信印刷、存放资料的;在公共场所粘贴类似邪教的符号、图案、标志等)10、县(市、区)职能部门、各镇(街道)分管领导根据应急情况认为有必要启动红色预警机制的其他矛盾纠纷。
                </div>
 
            </div>
        </MyDrawer>
    );
};
 
const MattersDetail = ({ visible, onClose }) => {
    return (
        <MyDrawer
            visible={visible}
            onClose={onClose}
            title="事项概况"
            width={1000}
            style={{ position: 'absolute' }}
            bodyStyle={{ marginTop: '-8px' }}
            titleBefore={true}
        >
            <div style={{ marginTop: '-8px' }}>
                事项简述应该填写完整,完整的事项简述应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过。<br />
                例如:<br />
                2024年8月13日,张某与女性好友王某在某烧烤档就餐期间发生场盾争执,报警人称女方从今年一月份开始,以各种理由让其帮忙付了外卖费,送金链等首饰,但又不确认关系,女方后期还拉黑了报警人,因此报警人认为女方涉嫌诈骗。
            </div>
        </MyDrawer>
    );
}
 
const NoHandleReason = ({ visible, onClose }) => {
    return (
        <div className='MyDrawer'>
            <MyDrawer
                visible={visible}
                onClose={onClose}
                title="无法化解理由"
                width={1000}
                style={{ position: 'absolute' }}
                bodyStyle={{ marginTop: '-8px' }}
                titleBefore={true}
            >
                <div style={{ marginTop: '-8px' }}>
                    完整的无法化解理由至少应具备3要素:调解过程中提供的解决方案+调解过程中的主要分歧点+最终难以调和的原因
                    例如:
                    调解工作于2024年1月10日在某街道人民调解委员会进行,双方当事人均到场参与。调解员首先听取了双方当事人的陈述,随后进行了多次单独会谈,根据被申请方的实际情况提出分期支付欠款的解决方案。在调解过程中,双方就具体支付方式进行了反复讨论,但未能达成一致意见。双方的主要分歧点在与被申请方不想一次性支付欠款。双方在沟通过程中情绪激动,互不相让。尽管调解员尝试缓和气氛,并引导双方从利益出发寻求解决方案,但双方仍坚持各自的立场,不愿妥协。
                </div>
            </MyDrawer>
 
        </div>
 
    )
 
}
 
const AiQuestion = ({ visible, onClose, aiData, aiLawData,caseDetailAi }) => {
    const [list, setList] = useState([
        // {
        //     id: '1',
        //     type: '典型案例',
        //     name: '唐某某诉重庆某工业有限公司劳动合同纠纷案'
        // },
        // {
        //     id: '2',
        //     type: '相似案例',
        //     name: '曾某某诉某网络科技公司劳动争议案'
        // },
        // {
        //     id: '3',
        //     type: '相似案例',
        //     name: '曾某某诉某网络科技公司劳动争议案'
        // },
    ])
    const [caseDetailView, setCaseDetailView] = useState({})
    const [modalType, setModalType] = useState('case')
    const [lawDetail, setLawDetail] = useState({})
    const [layerList, setLayerList] = useState([
        {
            id: '1',
            name: '法条一'
        },
        {
            id: '2',
            name: '法条二'
        },
        {
            id: '3',
            name: '法条三'
        },
    ])
 
    const [caseDetail, setCaseDetail] = useState(false)
    const toggleView = (type, id) => {
        setCaseDetail(true)
        setModalType(type)
        
        if (type === 'case') {
            getCaseDetail(id);
        }
        if (type === 'law') {
            console.log(id,'idddddd')
            
            const lawItem = aiLawData.find(item => item.lawInfoId === id)
            console.log(lawItem,'lawItem')
            setLawDetail(lawItem)
        }
    };
 
 
    const caseDetailOnClose = () => {
        setCaseDetail(false)
    }
 
    const getCaseDetail = async (id) => {
        const res = await getCaseDetailApi({
            caseId: id,
            type: '1'
        })
        if (res.type) {
            setCaseDetailView(res.data)
        }
    }
 
    useEffect(() => {
        setList(aiData);
        setLayerList(aiLawData);
 
    }, [aiData, aiLawData])
 
    return (
        <>
            <MyDrawer
                visible={visible}
                onClose={onClose}
                title="智能调解助理"
                width={1200}
                style={{ position: 'absolute' }}
                bodyStyle={{ marginTop: '-8px' }}
                titleBefore={true}
            >
                <div style={{ display: 'flex' }}>
                    <div style={{ width: '100px' }}></div>
                    <div className='aiBox'>
                        <div className='aiBox-case'>
                            <div className='aiBox-case-logo'>
                                <img src={caselogo} alt='' className='aiBox-case-logo-img' />
                            </div>
                            <div style={{ flex: 1,marginTop:'4px' }}>{caseDetailAi}</div>
                        </div>
                        <div className='marginLeft'>
                            <div className='marginLeft-title'>相关案例:</div>
                            <div className='aiBox-list'>
                                {list?.map((item, index) => (
                                    <div className='aiBox-list-item'>
                                        <div className='aiBox-list-item-type'>{item.caseType === 1 ? '典型案例' : '相似案例'}</div>
                                        <div className='aiBox-list-item-name'>{item.caseName}</div>
                                        <div className='aiBox-list-item-btn' onClick={() => toggleView('case', item.caseId)}>查看</div>
                                    </div>
                                ))}
                            </div>
                        </div>
                        <div className='marginLeft'>
                            <div className='marginLeft-title'>相关法条:</div>
                            <div className='aiBox-list'>
                                {layerList?.map((item, index) => (
                                    <div className='aiBox-list-item'>
                                        <div className='aiBox-list-item-type'>相关法条</div>
                                        <div className='aiBox-list-item-name'>{item.lawTitle}{item.lawIndex}</div>
                                        <div className='aiBox-list-item-btn' onClick={() => toggleView('law', item.lawInfoId)} >查看</div>
                                    </div>
                                ))}
                            </div>
                        </div>
 
                    </div>
                </div>
            </MyDrawer>
            <div className='MyDrawer'>
                <MyDrawer
                    visible={caseDetail}
                    onClose={caseDetailOnClose}
                    title={modalType === 'case'?"查看相关案例":"查看相关法条"}
                    width={400}
                    style={{ position: 'absolute' }}
                    bodyStyle={{ marginTop: '-8px' }}
                    titleBefore={true}
                >
                    {
                        modalType === 'case' &&
                        <div className='layerDetail'>
                            <div className='layerDetail-title'>参考案例</div>
                            <div className='layerDetail-name'>{caseDetailView?.caseTitle || '-'}</div>
                            <div className='layerDetail-littleTitle'>基本案情</div>
                            <div className='layerDetail-content'>{caseDetailView?.caseDesc || '-'}</div>
                            <div className='layerDetail-littleTitle'>诉求</div>
                            <div className='layerDetail-content'>{caseDetailView?.caseClaim || '-'}</div>
                            <div className='layerDetail-littleTitle'>诉求</div>
                            <div className='layerDetail-content'>{caseDetailView?.agreeContent || '-'}</div>
                        </div>
                    }
                    {
                        modalType === 'law' &&
                        <div className='layerDetail'>
                            <div className='layerDetail-title'>{lawDetail?.lawIndex}&nbsp;&nbsp;{lawDetail?.lawTitle}</div>
                            <div className='layerDetail-littleTitle'>{lawDetail.lawDesc}</div>
                        </div>
                    }
                </MyDrawer>
            </div>
 
        </>
 
    )
}
 
 
 
export { EventLevelDrawer, MattersDetail, NoHandleReason, AiQuestion };