瀏覽代碼

fix: 项目列表-创建人企事业可能为空的情况

lanjianrong 3 年之前
父節點
當前提交
8308a5c7a4
共有 1 個文件被更改,包括 4 次插入9 次删除
  1. 4 9
      src/pages/Project/Management/List/index.tsx

+ 4 - 9
src/pages/Project/Management/List/index.tsx

@@ -3,7 +3,7 @@ import ProTable from '@ant-design/pro-table'
 import { Tag, Modal } from 'antd'
 import { Tag, Modal } from 'antd'
 import consts from '@/utils/consts'
 import consts from '@/utils/consts'
 import { useRef, useState, useEffect, useMemo } from 'react'
 import { useRef, useState, useEffect, useMemo } from 'react'
-import { connect, history, Link, useRequest } from '@umijs/max'
+import { connect, Link, useRequest } from '@umijs/max'
 import { DeleteOutlined } from '@ant-design/icons'
 import { DeleteOutlined } from '@ant-design/icons'
 import ProjectModal, { ModalType } from './components/ProjectModal'
 import ProjectModal, { ModalType } from './components/ProjectModal'
 import dayjs from 'dayjs'
 import dayjs from 'dayjs'
@@ -47,13 +47,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
     onSuccess: () => tRef.current?.reload()
     onSuccess: () => tRef.current?.reload()
   })
   })
 
 
-  const goToDetail = params => {
-    return history.push({
-      pathname: '/project/management/detail',
-      state: params
-    })
-  }
-
   const handleDelProject = (ID: string) => {
   const handleDelProject = (ID: string) => {
     Modal.confirm({
     Modal.confirm({
       title: '删除项目',
       title: '删除项目',
@@ -99,7 +92,9 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
       width: 326,
       width: 326,
       onHeaderCell: () => ({ style: { textAlign: 'center' } }),
       onHeaderCell: () => ({ style: { textAlign: 'center' } }),
       renderText: (_, record) =>
       renderText: (_, record) =>
-        record?.created?.ID ? `${record?.created?.name}(${record?.created?.institution?.name})` : null
+        record?.created?.ID
+          ? `${record?.created?.name}(${record?.created?.institution?.name ?? '-'})`
+          : null
     },
     },
     {
     {
       dataIndex: 'reportAccount',
       dataIndex: 'reportAccount',