diff --git a/README.md b/README.md index 4c89a72..e5090e2 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,5 @@ npm test ## More You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro). + + diff --git a/public/servers.json b/public/servers.json index 56491b8..579c7db 100644 --- a/public/servers.json +++ b/public/servers.json @@ -1,7 +1,7 @@ { - "API_URL": "http://localhost:8080/api/v4", - "SYS_MAN_URL": "http://localhost:8080/api", - "LOGIN_URL": "http://localhost:8080", - "PARENT_URL": "http://localhost:8080", - "moduleFactory": "http://localhost:8080/api/v4/sys/self" + "API_URL": "http://172.29.223.62:82/api/v4", + "SYS_MAN_URL": "http:/172.29.223.62:82/api", + "LOGIN_URL": "http:/172.29.223.62:82", + "PARENT_URL": "http://172.29.223.62:82", + "moduleFactory": "http://172.29.223.62:82/api/v4/sys/self" } diff --git a/src/components/Tabs-KSHLCJD/README.md b/src/components/Tabs-KSHLCJD/README.md new file mode 100644 index 0000000..5f4f541 --- /dev/null +++ b/src/components/Tabs-KSHLCJD/README.md @@ -0,0 +1 @@ +在办事项--查看流程节点--可视化流程节点 diff --git a/src/components/Tabs-KSHLCJD/index.js b/src/components/Tabs-KSHLCJD/index.js new file mode 100644 index 0000000..655f6ed --- /dev/null +++ b/src/components/Tabs-KSHLCJD/index.js @@ -0,0 +1,224 @@ +import React, { useState, useEffect } from 'react'; +import { Modal, Timeline, Steps, Card, Tag, Descriptions, Button } from 'antd'; +import { connect } from 'umi'; +import moment from 'moment'; + +const { Step } = Steps; + +const KSHLCJD = (props) => { + const { id, sysToken, hideModal, visible } = props; + const [loading, setLoading] = useState(false); + const [flowData, setFlowData] = useState(null); + const [currentStep, setCurrentStep] = useState(0); + + // 模拟流程数据 - 实际应该从接口获取 + const mockFlowData = [ + { + id: 1, + step: 1, + name: '预警生成', + status: 'finish', + time: '2024-01-01 09:00:00', + operator: '系统自动', + remark: '系统自动检测到问题并生成预警' + }, + { + id: 2, + step: 2, + name: '受理派发', + status: 'finish', + time: '2024-01-01 10:30:00', + operator: '张三', + remark: '受理员接收并派发到处理部门' + }, + { + id: 3, + step: 3, + name: '核查办理', + status: 'process', + time: '2024-01-02 14:20:00', + operator: '李四', + remark: '正在核查处理中' + }, + { + id: 4, + step: 4, + name: '审批审核', + status: 'wait', + time: '', + operator: '', + remark: '待审核' + }, + { + id: 5, + step: 5, + name: '办结归档', + status: 'wait', + time: '', + operator: '', + remark: '待归档' + } + ]; + + useEffect(() => { + if (id) { + fetchFlowData(); + } + }, [id]); + + // 获取流程数据 + const fetchFlowData = async () => { + setLoading(true); + try { + // 这里应该调用实际的API + // const response = await props.dispatch({ + // type: 'doing/fetchFlowData', + // payload: { id, sysToken } + // }); + + // 暂时使用模拟数据 + setTimeout(() => { + setFlowData(mockFlowData); + + // 计算当前步骤(根据status) + const current = mockFlowData.findIndex(item => item.status === 'process'); + setCurrentStep(current >= 0 ? current : mockFlowData.length - 1); + + setLoading(false); + }, 500); + } catch (error) { + setLoading(false); + } + }; + + // 渲染步骤状态图标 + const renderStepStatus = (status) => { + const statusConfig = { + finish: { color: 'green', text: '已完成' }, + process: { color: 'blue', text: '进行中' }, + wait: { color: 'gray', text: '待处理' }, + error: { color: 'red', text: '异常' } + }; + + const config = statusConfig[status] || statusConfig.wait; + return {config.text}; + }; + + // 渲染Timeline视图 + const renderTimelineView = () => { + return ( + + {flowData?.map((item) => ( + + + + + 步骤{item.step}: {item.name} + {item.remark} + {item.operator && 操作人: {item.operator}} + + + {renderStepStatus(item.status)} + + + + + ))} + + ); + }; + + // 渲染Steps视图 + const renderStepsView = () => { + return ( + + {flowData?.map((item) => ( + + {item.time || '待处理'} + {item.operator || ''} + {item.remark && {item.remark}} + + } + status={item.status} + /> + ))} + + ); + }; + + // 渲染流程统计信息 + const renderStatistics = () => { + if (!flowData) return null; + + const finished = flowData.filter(item => item.status === 'finish').length; + const processing = flowData.filter(item => item.status === 'process').length; + const waiting = flowData.filter(item => item.status === 'wait').length; + + return ( + + {flowData.length} + {finished} + {processing} + {waiting} + {Math.round((finished / flowData.length) * 100)}% + 2天 + + ); + }; + + return ( + hideModal(false)} + footer={[ + hideModal(false)}> + 关闭 + , + + 刷新 + + ]} + width={800} + maskClosable={false} + > + + {renderStatistics()} + + + 流程进度图 + {renderStepsView()} + + + + 流程时间线 + {renderTimelineView()} + + + {/* 如果流程有附件,可以展示在这里 */} + + 暂无附件 + + + + ); +}; + +export default connect()(KSHLCJD); diff --git a/src/global.jsx b/src/global.jsx index 9c8e94a..8a8f2e9 100644 --- a/src/global.jsx +++ b/src/global.jsx @@ -6,12 +6,6 @@ import defaultSettings from '../config/defaultSettings'; const { pwa } = defaultSettings; const isHttps = document.location.protocol === 'https:'; // if pwa is true -// debugger; -// document.cookie = "sessionId=undefined;"; -// document.cookie = "JSESSIONID=090bb5cb-1850-43ab-a79a-f80d157e62a5;"; -// document.cookie = "JSESSIONID=d0db1b68-5db1-4951-8648-a799d8fe028c;"; -// document.cookie = "JSESSIONID=118c94ee-44c0-4c17-b909-ab6e749552f8;"; -// document.cookie = "tokenId=63f2c2479300f41797118ee653816f9b;"; if (pwa) { // Notify user if offline now diff --git a/src/models/doing.js b/src/models/doing.js index 8d8acff..29da5aa 100644 --- a/src/models/doing.js +++ b/src/models/doing.js @@ -38,6 +38,7 @@ import { querySaveCC, queryCcjg, queryDownloadFile, + ceshi } from '@/services/doing'; const Model = { @@ -321,6 +322,13 @@ const Model = { } return false; }, + *fetchCeshi({ payload }, { call }) { + const response = yield call(ceshi, payload); + if (response && response.resCode === 0) { + return response; + } + return false; + } }, reducers: { changeSetting(state, { payload }) { diff --git a/src/pages/DoingCases/TableList/index.jsx b/src/pages/DoingCases/TableList/index.jsx index 64cfde0..4957c8e 100644 --- a/src/pages/DoingCases/TableList/index.jsx +++ b/src/pages/DoingCases/TableList/index.jsx @@ -15,6 +15,7 @@ import SLGZ from '@/components/Tabs-SLGZ'; import BJSP from '@/components/Tabs-BJSP'; import BJSQ from '@/components/Tabs-BJSQ'; import BJGZ from '@/components/Tabs-BJGZ'; +import KSHLCJD from '@/components/Tabs-KSHLCJD'; import { getDicsName } from '@/utils/utils'; import { AJZT, BLFS, UserLevel } from '@/utils/constants'; import { getHGIcons, ExampleBar, getTimeLine } from '@/components/MyIcons'; @@ -205,6 +206,15 @@ const TableList = (props) => { 重新审批 ); + const bjbbhlcjd =( + setNowModal()} + > + 可视化流程节点 + + ); // debugger; if (record.ck === 1) allBtns.push(ck); if (record.slpf === 1) allBtns.push(slpf); @@ -216,6 +226,7 @@ const TableList = (props) => { if (record.bjdspsp === 1) allBtns.push(bjdspsp); if (record.bjbbhcxsq === 1) allBtns.push(bjbbhcxsq); if (record.bjbbhcxsp === 1) allBtns.push(bjbbhcxsp); + if (record.bjbbhlcjd === 1) allBtns.push(bjbbhlcjd); // all.forEach(item => { // if (record[item] === 1) { // console.log('ppsp',[item.toUpperCase()]) @@ -353,7 +364,6 @@ const TableList = (props) => { getList(msg); } }, [msg]); - // 点击查询 const onSearch = (params) => { setSearchParams({ ...searchParams, ...params, page: 1 }); @@ -489,6 +499,12 @@ const mapDispatchToProps = (dispatch) => ({ }, setRefresh(params) { return dispatch({ type: 'doing/setRefresh', payload: params }); + }, + fetchCeshi(params) { + return dispatch({ + type: 'doing/fetchCeshi', + payload: params + }); } }); export default connect(mapStateToProps, mapDispatchToProps)(TableList); diff --git a/src/pages/DoingCases/index.jsx b/src/pages/DoingCases/index.jsx index 3c81ddd..58ef186 100644 --- a/src/pages/DoingCases/index.jsx +++ b/src/pages/DoingCases/index.jsx @@ -12,6 +12,12 @@ import { secondTabName } from '@/utils/utils'; const { TabPane } = Tabs +/** + * Doing组件 + * 用于处理不同级别(部级、省级、市级)平台的展示和切换 + * 根据用户位置和权限动态显示对应平台内容 + */ + // 从props中解构出需要的属性 const Doing = (props) => { const { user, isLocationInBu,locationType } = props; // console.log(isLocationInBu); @@ -85,7 +91,7 @@ const Doing = (props) => { return ( ) }else{ diff --git a/src/pages/ZBSX/TableList/index.jsx b/src/pages/ZBSX/TableList/index.jsx index 64cfde0..4c7dfa3 100644 --- a/src/pages/ZBSX/TableList/index.jsx +++ b/src/pages/ZBSX/TableList/index.jsx @@ -354,6 +354,11 @@ const TableList = (props) => { } }, [msg]); + useEffect(() => { + // 首次加载时调用 fetchCeshi + props.fetchCeshi({ /* 这里传入需要的参数 */ }); + }, []); // 空依赖数组表示只在组件首次挂载时执行 + // 点击查询 const onSearch = (params) => { setSearchParams({ ...searchParams, ...params, page: 1 }); @@ -489,6 +494,9 @@ const mapDispatchToProps = (dispatch) => ({ }, setRefresh(params) { return dispatch({ type: 'doing/setRefresh', payload: params }); - } + }, + fetchCeshi(params) { + return dispatch({ type: 'doing/fetchCeshi', payload: params }); + }, }); export default connect(mapStateToProps, mapDispatchToProps)(TableList); diff --git a/src/services/doing.js b/src/services/doing.js index 3ffa857..8090a44 100644 --- a/src/services/doing.js +++ b/src/services/doing.js @@ -21,7 +21,7 @@ export async function queryDoneList({ params, sysToken }) { export async function queryCategoryList({ params, sysToken, isNotGateway }) { const { API_URL } = getUrl(); - const url = !isNotGateway ? `${API_URL}${gateway(sysToken)}/zxzd` : `${API_URL}/zxzd/${sysToken}`; + const url = !isNotGateway ? `${API_URL}${gateway(sysToken)}/zxzd` : `${API_URL}/zxzd/${sysToken}`; return request(url, { method: 'GET', data: params, @@ -306,3 +306,9 @@ export async function queryDownloadFile({ params, sysToken }) { // method: 'GET', // }); } + +export async function ceshi({ params, sysToken }) { + return request("https://a-140000000000-0925.sxgadsj.gat/tactics-model-web/core/self",{ + method: 'GET', + }) +}
{item.remark}
操作人: {item.operator}
暂无附件