/* * @Author: your name * @Date: 2021-11-10 09:33:30 * @LastEditTime: 2023-04-14 10:59:12 * @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, Divider } from 'antd'; import { useState, useEffect } from 'react'; import avatar from '../../../public/images/avatar.png'; import TopBar from '@/components/topBar'; import { FastEntry, FastEntryTabType } from './components/FastEntry'; import { RecentlyVisited, RecentlyVisitedItemsType } from './components/RecentlyVisited'; import { todoItem, TodoList } from './components/TodoList'; import { getAllParams, getUserIndexData, todoListAct, UserInfo } from '@/service'; import { MsgRecord } from './components/MsgRecord'; import { getParamsManaTableData } from '../platform/setting/paramsMana/service'; export interface IndexPageType { location: Location; } const IndexPage: React.FC = ({ location }) => { const { systemLists, //当前医院可选子系统列表 setInitialState, userData } = useModel('@@initialState', (model) => { return { systemLists: model.initialState?.systemLists, setInitialState: model.setInitialState, userData: model.initialState?.userData, }; }); const [loading, setLoading] = useState(false); 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 [iframeLoading, set_iframeLoading] = useState(false); const onLoadhandle = () => { set_iframeLoading(false); }; const getIndexPageDataFunc = async () => { const resp = await getUserIndexData(); if (resp) { set_userInfo(resp.userInfo); const fastEntryList = resp.fastEntrance.map((item: any) => ({ name: item.name, path: item.path, menuId: item.menuId, systemId: item.systemId })); set_fastEntry(fastEntryList); set_todoList(resp.todoList.map((t: any) => ({ id: t.id, status: 1, content: t.content, createDate: t.createDate, taskLevel: t.taskLevel, }))); 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) => { const resp = await todoListAct([id]); if (resp) { getIndexPageDataFunc(); } } const setIframeUrl = async () => { const resp = await getAllParams(); if (resp) { const needItem = resp.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}&toolbar=[]&hideTitle=true&hideScaleBar=false&&scale=width&hidePageBar=false&token=${token}`); } } } useEffect(() => { getIndexPageDataFunc(); const t = localStorage.getItem('visitedTabs'); if (t) { const visitedPaths = JSON.parse(t); set_recentlyVisitedList(visitedPaths); } setIframeUrl(); // const url = `${spacialPage[0].url}&token=${youshuToken}`; }, []) return (
欢迎进入医管平台
头像
{userInfo?.name}
{`${userInfo?.gender} | ${userInfo?.title ? userInfo?.title : '-'} | ${userInfo?.major ? userInfo?.major : '-'}`}
人员工号 {userInfo?.account ? userInfo?.account : '-'}
人员类别 {userInfo?.jobTitle ? userInfo?.jobTitle : '-'}
所属科室 {userInfo?.departmentName ? userInfo?.departmentName : '-'}
进院日期 {userInfo?.entryTime ? `${new Date(userInfo?.entryTime).getFullYear()}-${(new Date(userInfo?.entryTime).getMonth() + 1) > 10 ? (new Date(userInfo?.entryTime).getMonth() + 1) : '0' + (new Date(userInfo?.entryTime).getMonth() + 1)}-${(new Date(userInfo?.entryTime).getDate()) > 10 ? (new Date(userInfo?.entryTime).getDate()) : '0' + (new Date(userInfo?.entryTime).getDate())}` : '-'}
资格证号:{userInfo?.qualificationCertificateNo ? userInfo?.qualificationCertificateNo : '-'}
执业证号:{userInfo?.practiceCertificateNo ? userInfo?.practiceCertificateNo : '-'}
医师级别:{userInfo?.doctorLevel ? userInfo?.doctorLevel : '-'}
执业状态:{userInfo?.practiceStatus ? userInfo?.practiceStatus : '-'}
执业科目:{userInfo?.practiceSubject ? userInfo?.practiceSubject : '-'}
备注:{userInfo?.remark ? userInfo?.remark : '-'}
执业类别:{userInfo?.practiceCate ? userInfo?.practiceCate : '-'}
); }; export default IndexPage;