| | |
| | | * @Author: dminyi 1301963064@qq.com |
| | | * @Date: 2024-08-27 16:47:12 |
| | | * @LastEditors: dminyi 1301963064@qq.com |
| | | * @LastEditTime: 2024-09-05 17:03:04 |
| | | * @LastEditTime: 2024-09-11 10:12:32 |
| | | * @FilePath: \gzDyh\gz-customerSystem\src\views\register\visit\component\levelDetail.jsx |
| | | * @Description: 右抽屉提示 |
| | | */ |
| | | import React from 'react'; |
| | | 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="事件等级指南" |
| | | title="事件等级" |
| | | width={1000} |
| | | style={{ position: 'absolute' }} |
| | | bodyStyle={{ marginTop: '-8px' }} |
| | |
| | | <MyDrawer |
| | | visible={visible} |
| | | onClose={onClose} |
| | | title="事项概况指南" |
| | | title="事项概况" |
| | | width={1000} |
| | | style={{ position: 'absolute' }} |
| | | bodyStyle={{ marginTop: '-8px' }} |
| | |
| | | |
| | | } |
| | | |
| | | 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) |
| | | } |
| | | }; |
| | | |
| | | |
| | | export { EventLevelDrawer, MattersDetail, NoHandleReason }; |
| | | 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> |
| | | } |
| | | { |
| | | modalType === 'law' && |
| | | <div className='layerDetail'> |
| | | <div className='layerDetail-title'>{lawDetail?.lawIndex} {lawDetail?.lawTitle}</div> |
| | | <div className='layerDetail-littleTitle'>{lawDetail.lawDesc}</div> |
| | | </div> |
| | | } |
| | | </MyDrawer> |
| | | </div> |
| | | |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | |
| | | |
| | | export { EventLevelDrawer, MattersDetail, NoHandleReason, AiQuestion }; |