|
@@ -4,7 +4,7 @@ import type { ProColumnType, ActionType } from '@ant-design/pro-table'
|
|
import { Button, Popconfirm } from 'antd'
|
|
import { Button, Popconfirm } from 'antd'
|
|
import consts from '@/utils/consts'
|
|
import consts from '@/utils/consts'
|
|
import { useRef, useState, useEffect } from 'react'
|
|
import { useRef, useState, useEffect } from 'react'
|
|
-import { connect, useRequest, history } from 'umi'
|
|
|
|
|
|
+import { connect, useRequest } from 'umi'
|
|
import type { ConnectProps } from 'umi'
|
|
import type { ConnectProps } from 'umi'
|
|
import type { ProjectModelState } from '../model'
|
|
import type { ProjectModelState } from '../model'
|
|
import { DeleteOutlined } from '@ant-design/icons'
|
|
import { DeleteOutlined } from '@ant-design/icons'
|
|
@@ -14,6 +14,7 @@ import { PageContainer } from '@ant-design/pro-layout'
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
import { BaseMenuEnum } from '@/pages/Schema/Base'
|
|
import { BaseMenuEnum } from '@/pages/Schema/Base'
|
|
import { generateColumns } from '@/utils/util'
|
|
import { generateColumns } from '@/utils/util'
|
|
|
|
+import DetailModal from './components/DetailModal'
|
|
|
|
|
|
type ListProps = ConnectProps & {
|
|
type ListProps = ConnectProps & {
|
|
pTypeList: { label: string; value: string }[]
|
|
pTypeList: { label: string; value: string }[]
|
|
@@ -41,6 +42,8 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
search: null
|
|
search: null
|
|
},
|
|
},
|
|
visible: false,
|
|
visible: false,
|
|
|
|
+ visibles: false,
|
|
|
|
+ readOnly: true,
|
|
currentModalType: ModalType.ADD,
|
|
currentModalType: ModalType.ADD,
|
|
defaultFormData: null
|
|
defaultFormData: null
|
|
})
|
|
})
|
|
@@ -55,7 +58,25 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
dataIndex: 'name',
|
|
dataIndex: 'name',
|
|
- title: '项目名称'
|
|
|
|
|
|
+ title: '项目名称',
|
|
|
|
+ render: (name, record) => (
|
|
|
|
+ <div
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ setState({
|
|
|
|
+ ...state,
|
|
|
|
+ visibles: true,
|
|
|
|
+ readOnly: true,
|
|
|
|
+ defaultFormData: {
|
|
|
|
+ ID: record.ID,
|
|
|
|
+ name: record.name,
|
|
|
|
+ projectTypeID: record.projectType.ID
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }}>
|
|
|
|
+ {name}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
},
|
|
},
|
|
{
|
|
{
|
|
dataIndex: 'createdTime',
|
|
dataIndex: 'createdTime',
|
|
@@ -78,9 +99,22 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
dataIndex: 'created',
|
|
dataIndex: 'created',
|
|
|
|
+ key: 'created',
|
|
title: '创建人'
|
|
title: '创建人'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ dataIndex: 'reportAccount',
|
|
|
|
+ key: 'reportAccount',
|
|
|
|
+ title: '数据上报',
|
|
|
|
+ renderText: (_, record) => record.reportAccount?.name
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ dataIndex: 'approval',
|
|
|
|
+ key: 'approval',
|
|
|
|
+ title: '审批流程',
|
|
|
|
+ renderText: (_, record) => record.approval?.name
|
|
|
|
+ },
|
|
|
|
+ {
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: 'operation',
|
|
dataIndex: 'operation',
|
|
render: (_, record) => (
|
|
render: (_, record) => (
|
|
@@ -140,6 +174,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
actions: [
|
|
actions: [
|
|
// <Button onClick={() => history.push('/project/management/add')}>新建项目</Button>
|
|
// <Button onClick={() => history.push('/project/management/add')}>新建项目</Button>
|
|
<Button
|
|
<Button
|
|
|
|
+ type="primary"
|
|
onClick={() =>
|
|
onClick={() =>
|
|
setState({ ...state, visible: true, currentModalType: ModalType.ADD })
|
|
setState({ ...state, visible: true, currentModalType: ModalType.ADD })
|
|
}>
|
|
}>
|
|
@@ -158,6 +193,15 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
reloadTable={() => tRef.current?.reload()}
|
|
reloadTable={() => tRef.current?.reload()}
|
|
setVisible={(visible: boolean) => setState({ ...state, visible })}
|
|
setVisible={(visible: boolean) => setState({ ...state, visible })}
|
|
/>
|
|
/>
|
|
|
|
+
|
|
|
|
+ <DetailModal
|
|
|
|
+ defaultFormData={state.defaultFormData}
|
|
|
|
+ pTypeList={pTypeList}
|
|
|
|
+ visibles={state.visibles}
|
|
|
|
+ readOnly={state.readOnly}
|
|
|
|
+ reloadTable={() => tRef.current?.reload()}
|
|
|
|
+ setVisible={(visibles: boolean) => setState({ ...state, visibles })}
|
|
|
|
+ />
|
|
</PageContainer>
|
|
</PageContainer>
|
|
)
|
|
)
|
|
}
|
|
}
|