/* * @Author: your name * @Date: 2021-11-10 09:33:30 * @LastEditTime: 2025-05-20 10:53:28 * @LastEditors: code4eat awesomedema@gmail.com * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: /KC-MiddlePlatform/src/pages/index.tsx */ import { useModel, history, Location, Helmet } from 'umi'; import './index.less'; import { Skeleton, Drawer, Tooltip } from 'antd'; import { useState, useEffect } from 'react'; import { FastEntry, FastEntryTabType } from './components/FastEntry'; import { RecentlyVisitedItemsType } from './components/RecentlyVisited'; import { todoItem, TodoList } from './components/TodoList'; import { getSysParamsByCode, getUserIndexData, UserInfo } from '@/service'; import { KcimCenterSysId } from '@/constant'; import { createFromIconfontCN } from '@ant-design/icons'; import '../../../public/zhongtaiB.js'; const IconFont = createFromIconfontCN({ scriptUrl: '', }); export interface IndexPageType { location: Location; } const IndexPage: React.FC = ({ location }) => { const { systemLists, //当前医院可选子系统列表 setInitialState, userData, customerType, } = useModel('@@initialState', (model) => { return { systemLists: model.initialState?.systemLists, setInitialState: model.setInitialState, userData: model.initialState?.userData, customerType: model.initialState?.customerType, }; }); const [userInfo, set_userInfo] = useState(); const [fastEntry, set_fastEntry] = useState([]); const [recentlyVisitedList, set_recentlyVisitedList] = useState([]); const [todoList, set_todoList] = useState([]); const [msgRecord, set_msgRecord] = useState([]); const [specialPageUrl, setspecialPageUrl] = useState(undefined); const [leftImgUrl, set_leftImgUrl] = useState(undefined); const [leftBgImgUrl, set_leftBgImgUrl] = useState(undefined); const [iframeLoading, set_iframeLoading] = useState(false); const [allParams, set_allParams] = useState([]); const [title, set_title] = useState(undefined); const [welcomTitle, set_welcomTitle] = useState('欢迎进入医管平台'); const [drawerOpen, set_drawerOpen] = useState(false); const onLoadhandle = () => { set_iframeLoading(false); }; const getIndexPageDataFunc = async () => { const resp = await getUserIndexData(); if (resp) { set_userInfo(resp.userInfo); set_leftImgUrl(resp.indexUrl ? resp.indexUrl.split('|')[0] : undefined); set_leftBgImgUrl(resp.indexUrl ? resp.indexUrl.split('|')[1] : undefined); localStorage.setItem('userInfo', JSON.stringify(resp.userInfo)); setInitialState((s: any) => ({ ...s, userInfo: resp.userInfo })); const fastEntryList = resp.fastEntrance.map((item: any) => ({ id: item.id, name: item.name, path: item.path, menuId: item.menuId, systemId: item.systemId, type: item.type, contentType: item.contentType, url: item.url, })); set_fastEntry(fastEntryList); set_todoList( resp.todoList.map((t: any) => ({ id: t.id, status: 1, content: t.content, createDate: t.createDate, taskLevel: t.taskLevel, recordTitle: t.recordTitle, })), ); set_msgRecord( resp.messageRecords.map((t: any) => ({ title: t.recordTitle, date: t.createDate, resolveTime: t.resolveTime, isProcess: t.isProcess, content: t.content, })), ); } }; const todoListClickHandle = async (id: number) => { set_drawerOpen(true); // const resp = await todoListAct([id]); // if (resp) { // getIndexPageDataFunc(); // } }; const setIframeUrl = async (allParams: any[]) => { const needItem = allParams.filter((a: any) => a.code == '1644270043527254016'); const userData = localStorage.getItem('userData'); let token = ''; if (userData) { const { youshuToken } = JSON.parse(userData); token = youshuToken; } if (needItem.length > 0) { setspecialPageUrl(`http://eastern1.kcim-bi.163yun.com/dash/integration/56?rid=${needItem[0].value}&token=${token}`); } }; const getAllParamsHanle = async () => { const resp = await getSysParamsByCode(KcimCenterSysId); if (resp) { set_allParams(resp); } }; const onClose = () => { set_drawerOpen(false); }; const fastEntryOnChangeHandle = () => { getIndexPageDataFunc(); }; useEffect(() => { if (allParams) { setIframeUrl(allParams); allParams.forEach((item) => { if (item.code == '1739124039835848704') { set_title(item.value); } if (item.code == '1739123252502073344') { set_welcomTitle(item.value); } }); } }, [allParams]); useEffect(() => { getIndexPageDataFunc(); const t = localStorage.getItem('visitedTabs'); if (t) { const visitedPaths = JSON.parse(t); set_recentlyVisitedList(visitedPaths); } getAllParamsHanle(); // const url = `${spacialPage[0].url}&token=${youshuToken}`; }, []); return (
{/* */}
set_drawerOpen(false)}> 待办事项
任立群发起了请假申请
2023-12-26 11:24
后勤管理 / 报事报修
{welcomTitle}
{title ? title.split('|')[0] : '默认标题'}
{title ? title.split('|')[1] : '默认标题'}
{specialPageUrl && (
)} {!specialPageUrl && (
)}
{userInfo?.account}
{`欢迎回来,${userInfo?.name}`}
{customerType == '2' ? '组织' : '科室'} {userInfo?.departmentName ? userInfo?.departmentName : '-'}
{customerType == '2' ? '职务' : '职称'} {customerType == '2' ? (userInfo?.jobTitle ?? '-') : (userInfo?.title ?? '-')}
类别 {userInfo?.userCate ? userInfo?.userCate : '-'}
岗位 {userInfo?.position ? userInfo?.position : '-'}
fastEntryOnChangeHandle()} />
); }; export default IndexPage;