From 68f41dad70cc9c90b87258d91300576d7f5682e7 Mon Sep 17 00:00:00 2001 From: liuwh <964324856@qq.com> Date: Sat, 14 Sep 2024 15:58:38 +0800 Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master --- gz-customerSystem/src/views/register/handleFeedback/index.jsx | 176 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 140 insertions(+), 36 deletions(-) diff --git a/gz-customerSystem/src/views/register/handleFeedback/index.jsx b/gz-customerSystem/src/views/register/handleFeedback/index.jsx index 2aa9934..fd3ac85 100644 --- a/gz-customerSystem/src/views/register/handleFeedback/index.jsx +++ b/gz-customerSystem/src/views/register/handleFeedback/index.jsx @@ -3,22 +3,25 @@ * @Author: dminyi 1301963064@qq.com * @Date: 2024-08-09 09:59:43 * @LastEditors: dminyi 1301963064@qq.com - * @LastEditTime: 2024-09-06 17:43:15 + * @LastEditTime: 2024-09-11 12:20:34 * @FilePath: \gzDyh\gz-customerSystem\src\views\basicInformation\organization\index.jsx * @Description: 来访登记 * */ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import NewPage from '@/components/NewPage'; import "@arco-themes/react-gzzz/css/arco.css"; import '../index.less'; import { Typography, Steps, Tabs } from '@arco-design/web-react'; -import { Audit, Matter, transfer, aiPerson } from '@/assets/images' +import { Audit, Matter, applyRecord, transfer, Aimge, examine } from '@/assets/images' import MatterDetail from '../matterDetail'; import Handle from './component/handle'; import AuditView from './component/AuditView'; -import {AiQuestion} from '../visit/component/levelDetail' +import { AiQuestion } from '../visit/component/levelDetail'; +import * as $$ from '@/utils/utility'; +import ApplyInfo from "../matterDetail/ApplyInfo"; + const Step = Steps.Step; const TabPane = Tabs.TabPane; @@ -27,42 +30,152 @@ // marginTop: 20, }; +function getCaseApi(data) { + return $$.ax.request({ urlAi: `case-law/get-case`, typeAi: 'post', service: 'mediate', data }); +} + +function getLawApi(data) { + return $$.ax.request({ urlAi: `case-law/get-law`, typeAi: 'post', service: 'mediate', data }); +} + +function getTabButton(caseTaskId) { + return $$.ax.request({ url: `caseTask/getTabButton?caseTaskId=` + caseTaskId, type: 'get', service: 'mediate' }); +} + +function getCaseInfoApi(id) { + return $$.ax.request({ url: '/caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' }); +} const Organization = () => { + const caseTaskId = $$.getQueryString('caseTaskId') + const caseId = $$.getQueryString('caseId') const [current, setCurrent] = useState(3); - const [tabsActive, setTabsActive] = useState('1'); + const [tabsActive, setTabsActive] = useState('sxxq'); const [AiQuestionView, setAiQuestionView] = useState(false) - const [tabsList, setTabList] = useState([ + const [aiData, setAiData] = useState([]) + const [aiLawData, setAiLawData] = useState([]); + const [caseDetailAi, setCaseDetailAi] = useState({}); + const [authorData, setAuthorData] = useState({}); + const [tabsList, setTabsList] = useState([]); + const myTab = [ + { + img: Matter, + label: '详情', + key: "dslxq" + }, { img: Matter, label: '事项详情', - key: '1' + key: "sxxq" }, { img: transfer, - label: '流转办理', - key: '2', - isNeedStep: true,//加上这个就有进度条 + label: '事项办理', + key: "sxbl", + isNeedStep: true, }, { - img: Audit, - label: '审核', - key: '3', + img: applyRecord, + label: '申请记录', + key: "sqjl", }, - ]) + { + img: examine, + label: '联合处置审核', + key: 'lhczsh', + }, + ] + useEffect(() => { + getCaseInfo(caseId) + getAuthor(); + }, []) + + const handleAi = () => { + setAiQuestionView(true) + } + + const getCase = async (caseDes, caseClaim) => { + const res = await getCaseApi({ + caseDes: caseDes, + caseClaim: caseClaim, + caseId: caseId + }) + if (res.type) { + setAiData(res.data) + } + } + + const getLaw = async (caseDes, caseClaim) => { + const res = await getLawApi({ + caseDes: caseDes, + caseClaim: caseClaim, + caseId: caseId + }) + if (res.type) { + setAiLawData(res.data) + } + } + + const getAuthor = async () => { + const res = await getTabButton(caseTaskId) + if (res.type) { + const { tabList } = res.data + setAuthorData(res.data) + if (tabList.length === 0) { + //没有tab就不展示 + } else { + setTabsList(myTab.filter(item => { + const flag = tabList.some(result => { + if (result.id === item.key) { + return true + } + }) + return flag + })) + setTabsActive(tabList[0].id) + } + } + } + + const getCaseInfo = async (id) => { + const res = await getCaseInfoApi(id) + if (res.type) { + let caseDes = res.data.caseDes; + let caseClaim = res.data.caseClaim; + setCaseDetailAi(caseDes) + getCase(caseDes, caseClaim); + getLaw(caseDes, caseClaim); + } + } + + //根据id定义组件 + const getTypeDom = (key) => { + if (key === 'sxxq' || key === 'dslxq') { + return <MatterDetail hasApplet={true} hasEditBtn={true} authorData={authorData} caseId={caseId} /> + } + if (key === 'sxbl') { + return <Handle authorData={authorData} caseId={caseId} caseTaskId={caseTaskId} /> + } + if (key === 'sqjl') { + return <ApplyInfo /> + } + if (key === 'lhczsh') { + return <AuditView authorData={authorData} caseId={caseId} caseTaskId={caseTaskId} /> + } + } return ( - <div style={{ position: 'relative' }}> + <div style={{ position: 'relative', height: '100vh' }}> <NewPage pageHead={ { breadcrumbData: [{ title: '工作台' }, { title: '事件中心' }], title: '办理反馈' } } > <Tabs - defaultActiveTab='1' onChange={(v) => setTabsActive(v)} className='myTabContent' + activeTab={tabsActive} > {tabsList?.map(item => { return <TabPane @@ -75,7 +188,7 @@ } > { - item.isNeedStep && <div style={{ backgroundColor: '#fff', margin: '12px 16px 0px 16px', paddingTop: '16px', paddingLeft: '91px' }}> + item.isNeedStep && <div style={{ backgroundColor: '#fff', margin: '0px 16px 0px 16px', paddingTop: '16px', paddingLeft: '91px' }}> <Steps type='navigation' current={current}> <Step title='来访登记' disabled /> <Step title='事件流转' disabled /> @@ -86,31 +199,22 @@ </Steps> </div> } - {tabsActive === '1' && - <MatterDetail hasApplet={true} hasEditBtn={true} /> - } - { - tabsActive === '2' && <Typography.Paragraph style={style}> - <Handle /> - </Typography.Paragraph> - } - { - tabsActive === '3' && <Typography.Paragraph style={style}> - <AuditView /> - </Typography.Paragraph> - } + {getTypeDom(item.key)} </TabPane> })} </Tabs> </NewPage> - <div className="gradient-box" onClick={() => setAiQuestionView(true)}> - <div><img src={aiPerson} alt='' style={{ width: '24px', height: '24px', marginRight: '6px' }} /></div> - <div style={{ color: '#FFFFFF' }}>智能调解助理</div> + <div className="gradient-box" onClick={() => handleAi()}> + <div><img src={Aimge} alt='' style={{ width: '111px', height: '120px' }} /></div> + <div style={{ color: '#FFFFFF' }}>穗调解数智人</div> </div> <AiQuestion - visible={AiQuestionView} - onClose={() => setAiQuestionView(false)} - /> + visible={AiQuestionView} + onClose={() => setAiQuestionView(false)} + aiData={aiData} + aiLawData={aiLawData} + caseDetailAi={caseDetailAi} + /> </div> ) } -- Gitblit v1.8.0