|
@@ -2,13 +2,14 @@ import ProTable from '@ant-design/pro-table'
|
|
|
import type { ProColumnType, ActionType } from '@ant-design/pro-table'
|
|
import type { ProColumnType, ActionType } from '@ant-design/pro-table'
|
|
|
import { Button } from 'antd'
|
|
import { Button } from 'antd'
|
|
|
import consts from '@/utils/consts'
|
|
import consts from '@/utils/consts'
|
|
|
-import { useRef, useState, useEffect } from 'react'
|
|
|
|
|
-import { connect } from 'umi'
|
|
|
|
|
|
|
+import { useRef, useState, useEffect, useCallback } from 'react'
|
|
|
|
|
+import { connect, history, useModel } from 'umi'
|
|
|
import type { ConnectProps } from 'umi'
|
|
import type { ConnectProps } from 'umi'
|
|
|
import type { ProjectModelState } from '../model'
|
|
import type { ProjectModelState } from '../model'
|
|
|
import CompanyModal, { ModalType } from './components/CompanyModal'
|
|
import CompanyModal, { ModalType } from './components/CompanyModal'
|
|
|
import { queryInstitutionList } from '@/services/api/institution'
|
|
import { queryInstitutionList } from '@/services/api/institution'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
|
|
+// import CompanyName from './CompanyName'
|
|
|
|
|
|
|
|
type ListProps = ConnectProps & {
|
|
type ListProps = ConnectProps & {
|
|
|
pTypeList: { label: string; value: string }[]
|
|
pTypeList: { label: string; value: string }[]
|
|
@@ -35,10 +36,22 @@ const CompanyList: React.FC<ListProps> = ({ dispatch, pTypeList }) => {
|
|
|
// manual: true,
|
|
// manual: true,
|
|
|
// onSuccess: () => tRef.current?.reload()
|
|
// onSuccess: () => tRef.current?.reload()
|
|
|
// })
|
|
// })
|
|
|
|
|
+
|
|
|
|
|
+ const { initialState, setInitialState } = useModel('@@initialState')
|
|
|
|
|
+
|
|
|
|
|
+ const showName = useCallback(() => {
|
|
|
|
|
+ return history.push(`/institutions/company/companyname`)
|
|
|
|
|
+ }, [initialState, setInitialState])
|
|
|
|
|
+
|
|
|
const columns: ProColumnType<API.InstitutionListItem>[] = [
|
|
const columns: ProColumnType<API.InstitutionListItem>[] = [
|
|
|
{
|
|
{
|
|
|
dataIndex: 'name',
|
|
dataIndex: 'name',
|
|
|
- title: '企事业单位名称'
|
|
|
|
|
|
|
+ title: '企事业单位名称',
|
|
|
|
|
+ render: (name, record) => (
|
|
|
|
|
+ <span onClick={() => showName(record.id)} className="text-primary cursor-pointer">
|
|
|
|
|
+ {name}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ )
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
dataIndex: 'acronym',
|
|
dataIndex: 'acronym',
|