Commit a063cd00 by fanyj

tijiao

parent 56a9954c
...@@ -12,6 +12,10 @@ import { $hostParams } from "./util"; ...@@ -12,6 +12,10 @@ import { $hostParams } from "./util";
import './index.less'; import './index.less';
ConfigProvider.config({
prefixCls: 'yy', // 4.13.0+
});
function render(props) { function render(props) {
const { container, ...restProps } = props; const { container, ...restProps } = props;
ReactDOM.render( ReactDOM.render(
......
...@@ -22,6 +22,8 @@ export const httpUtil={ ...@@ -22,6 +22,8 @@ export const httpUtil={
} }
}, },
showError:(data:any,type:number,title?:string)=>{ showError:(data:any,type:number,title?:string)=>{
console.log('error')
console.log((data.data||{}).ApiError||(data||{}).ApiError||(data||{}).message||(data.data||{}).message)
if(data.status&&((data.data||{}).ApiError||(data||{}).ApiError||(data||{}).message||(data.data||{}).message)){ if(data.status&&((data.data||{}).ApiError||(data||{}).ApiError||(data||{}).message||(data.data||{}).message)){
let messages = '未知异常'; let messages = '未知异常';
try { try {
......
...@@ -153,6 +153,7 @@ export default function request(options:any, autotip:boolean){ ...@@ -153,6 +153,7 @@ export default function request(options:any, autotip:boolean){
return new Promise((resolve)=>{ return new Promise((resolve)=>{
let result:any = {} let result:any = {}
fetch(options).then(response => { fetch(options).then(response => {
console.log('response',response)
try { try {
if(response?.status===200){ if(response?.status===200){
if(autotip) if(autotip)
...@@ -184,10 +185,10 @@ export default function request(options:any, autotip:boolean){ ...@@ -184,10 +185,10 @@ export default function request(options:any, autotip:boolean){
}).catch(async (error) => { }).catch(async (error) => {
if(autotip) if(autotip)
message.error('操作异常') message.error('操作异常')
let data = error; let data = error.response;
if(data?.ApiError||data?.status){ if(data?.ApiError||data?.status){
result.status=500 result.status=500
result.data=data result.data=data.data
} }
resolve(result) resolve(result)
}) })
......
...@@ -223,7 +223,7 @@ const AssetFlow:React.FC<any>=(props)=>{ ...@@ -223,7 +223,7 @@ const AssetFlow:React.FC<any>=(props)=>{
<Col span={12}> <Col span={12}>
<Form.Item <Form.Item
label='送审说明' label='送审说明'
name="desc" name="opinion"
style={{ marginBottom:15 }} style={{ marginBottom:15 }}
rules={[{ required: true, message: '请填写送审说明!' }]} rules={[{ required: true, message: '请填写送审说明!' }]}
> >
......
import React,{ useState, useEffect, useRef, useContext, useMemo } from "react"; import React,{ useState, useEffect, useRef, useContext, useMemo } from "react";
import { Button, Pagination, Space, Modal, Input, Tooltip, Checkbox, Typography, Dropdown, Menu, Divider, Select, message } from "antd"; import { Button, Pagination, Space, Modal, Input, Tooltip, Checkbox, Typography, Dropdown, Menu, Divider, Select, message, notification } from "antd";
import classNames from 'classnames'; import classNames from 'classnames';
import { Resizable } from 'react-resizable'; import { Resizable } from 'react-resizable';
import ResizeObserver from 'rc-resize-observer'; import ResizeObserver from 'rc-resize-observer';
......
...@@ -25,7 +25,7 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{ ...@@ -25,7 +25,7 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{
return httpUtil.getQueryVariable('processId',location.search)||'' return httpUtil.getQueryVariable('processId',location.search)||''
},[location.search]) },[location.search])
const {detail,detalLoading} = useGetProcessDetail({processId}) const {detail,detalLoading,reload} = useGetProcessDetail({processId})
const editmodal = useGetModalInfoAndAction() const editmodal = useGetModalInfoAndAction()
useEffect(()=>{ useEffect(()=>{
...@@ -153,6 +153,7 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{ ...@@ -153,6 +153,7 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{
const playload = {...detail,...data,submitItems:dataSource} const playload = {...detail,...data,submitItems:dataSource}
saveQuestionItemNext(playload,()=>{ saveQuestionItemNext(playload,()=>{
showMessage('success','操作成功') showMessage('success','操作成功')
reload?.()
}) })
}else{ }else{
showMessage('info','请选择下一步处理人') showMessage('info','请选择下一步处理人')
...@@ -176,6 +177,7 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{ ...@@ -176,6 +177,7 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{
const playload = {...detail,...data,submitItems:list} const playload = {...detail,...data,submitItems:list}
saveQuestionItemFinal(playload,()=>{ saveQuestionItemFinal(playload,()=>{
showMessage("success",'操作成功') showMessage("success",'操作成功')
reload?.()
}) })
}else{ }else{
showMessage('info','请完成待完成项') showMessage('info','请完成待完成项')
...@@ -203,8 +205,8 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{ ...@@ -203,8 +205,8 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="附件"> <Descriptions.Item label="附件">
{ {
(detail?.attachments||[]).map((item:any)=>{ (detail?.attachments||[]).map((item:any,key:number)=>{
return <Tag color="blue" style={{cursor:'pointer'}} onClick={()=>{openDetail(item.fileId)}} >{item?.fileName}</Tag> return <Tag color="blue" key={key} style={{cursor:'pointer'}} onClick={()=>{openDetail(item.fileId)}} >{item?.fileName}</Tag>
}) })
} }
</Descriptions.Item> </Descriptions.Item>
...@@ -258,8 +260,8 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{ ...@@ -258,8 +260,8 @@ const FlowAcceptDetail:React.FC<any>=(props)=>{
footer={ footer={
<div style={{display:'flex',justifyContent:'center',width:'100%'}}> <div style={{display:'flex',justifyContent:'center',width:'100%'}}>
<Space> <Space>
<Button loading={loading} onClick={nextUser} type="primary">转分配</Button> <Button loading={loading} disabled={!detail?.operateAble} onClick={nextUser} type="primary">转分配</Button>
<Button loading={loading} onClick={finishFlow} type="primary">保存</Button> <Button loading={loading} disabled={!detail?.operateAble} onClick={finishFlow} type="primary">保存</Button>
</Space> </Space>
</div> </div>
} }
......
...@@ -85,22 +85,29 @@ export const useGetProcessDetail = (props: {processId: string}) => { ...@@ -85,22 +85,29 @@ export const useGetProcessDetail = (props: {processId: string}) => {
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
useEffect(() => { useEffect(() => {
const fetchData = async () => {
try {
setLoading(true);
const response: any = await assetsManageService.getProcessDetail({processId});
if (httpUtil.checkSuccess(response, 1)) {
setDetail(response.data);
} else {
httpUtil.showError(response, 1);
}
} finally {
setLoading(false);
}
};
if(processId) if(processId)
fetchData(); fetchData();
}, [processId]); }, [processId]);
return { detail, detalLoading:loading }; const fetchData = async () => {
try {
setLoading(true);
const response: any = await assetsManageService.getProcessDetail({processId});
if (httpUtil.checkSuccess(response, 1)) {
setDetail(response.data);
} else {
httpUtil.showError(response, 1);
}
} finally {
setLoading(false);
}
};
const reload=useCallback(()=>{
if(processId)
fetchData();
},[])
return { detail, detalLoading:loading,reload };
}; };
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment