|
@@ -2,7 +2,7 @@ import { delProject, getProjectList } from '@/services/api/project'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
import { Button, Popconfirm, Tag } from 'antd'
|
|
|
import consts from '@/utils/consts'
|
|
|
-import { useRef, useState, useEffect } from 'react'
|
|
|
+import { useRef, useState, useEffect, useMemo } from 'react'
|
|
|
import { connect, history, useRequest } from 'umi'
|
|
|
import { DeleteOutlined } from '@ant-design/icons'
|
|
|
import ProjectModal, { ModalType } from './components/ProjectModal'
|
|
@@ -13,6 +13,7 @@ import AnimateContent from '@/components/AnimateContent'
|
|
|
import type { ProColumnType, ActionType } from '@ant-design/pro-table'
|
|
|
import type { ConnectProps } from 'umi'
|
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
|
+import type { ColumnsStateType } from '@ant-design/pro-table/lib/typing'
|
|
|
|
|
|
type ListProps = ConnectProps & {
|
|
|
pTypeList: { label: string; value: string }[]
|
|
@@ -104,7 +105,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
- dataIndex: 'operation',
|
|
|
+ dataIndex: 'operate',
|
|
|
width: 91,
|
|
|
align: 'center',
|
|
|
onHeaderCell: () => ({ style: { textAlign: 'center' } }),
|
|
@@ -137,6 +138,22 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
}
|
|
|
]
|
|
|
|
|
|
+ const columnsState: ColumnsStateType = useMemo(
|
|
|
+ () => ({
|
|
|
+ defaultValue: {
|
|
|
+ name: {
|
|
|
+ disable: true
|
|
|
+ },
|
|
|
+ opreate: {
|
|
|
+ disable: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ persistenceKey: 'project_list_column_key',
|
|
|
+ persistenceType: 'localStorage'
|
|
|
+ }),
|
|
|
+ []
|
|
|
+ )
|
|
|
+
|
|
|
const onAnimateChange = visible => setState({ ...state, visible })
|
|
|
return (
|
|
|
<PageContainer title={false}>
|
|
@@ -144,6 +161,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
rowKey="ID"
|
|
|
params={state.params}
|
|
|
actionRef={tRef}
|
|
|
+ columnsState={columnsState}
|
|
|
scroll={{ y: document.body.clientHeight - 291 }}
|
|
|
columns={columns}
|
|
|
request={async (params, filter, sorter) => {
|