|
@@ -22,11 +22,6 @@ type ListProps = ConnectProps & {
|
|
|
const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
const tRef = useRef<ActionType>(null)
|
|
|
useEffect(() => {
|
|
|
- // if (!pTypeList.length) {
|
|
|
- // dispatch({
|
|
|
- // type: 'project/queryProjectTypeList'
|
|
|
- // })
|
|
|
- // }
|
|
|
if (!schema) {
|
|
|
dispatch({
|
|
|
type: 'schemaBase/querySchema',
|
|
@@ -52,7 +47,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
})
|
|
|
|
|
|
const goToDetail = params => {
|
|
|
- // return history.push(`/institutions/company/companyname`)
|
|
|
return history.push({
|
|
|
pathname: '/project/management/detail',
|
|
|
state: params
|
|
@@ -70,13 +64,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
onClick={() => {
|
|
|
goToDetail({ dataID: record.ID })
|
|
|
- // setState({
|
|
|
- // ...state,
|
|
|
- // visible: true,
|
|
|
- // currentModalType: ModalType.PREVIEW,
|
|
|
- // title: record.name,
|
|
|
- // defaultFormData: record
|
|
|
- // })
|
|
|
}}>
|
|
|
{text}
|
|
|
</span>
|
|
@@ -90,22 +77,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
onHeaderCell: () => ({ style: { textAlign: 'center' } }),
|
|
|
renderText: text => dayjs(text).format('YYYY-MM-DD')
|
|
|
},
|
|
|
- // {
|
|
|
- // dataIndex: 'projectTypeID',
|
|
|
- // title: '项目类型',
|
|
|
- // width: 126,
|
|
|
- // align: 'center',
|
|
|
- // filters: true,
|
|
|
- // filterMultiple: false,
|
|
|
- // onHeaderCell: () => ({ style: { textAlign: 'center' } }),
|
|
|
- // valueEnum: pTypeList.reduce((prev, curr) => {
|
|
|
- // const items = { ...prev }
|
|
|
- // items[curr.value] = {
|
|
|
- // text: curr.label
|
|
|
- // }
|
|
|
- // return items
|
|
|
- // }, {})
|
|
|
- // },
|
|
|
{
|
|
|
dataIndex: 'createdID',
|
|
|
key: 'createdID',
|
|
@@ -131,12 +102,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
</div>
|
|
|
)
|
|
|
},
|
|
|
- // {
|
|
|
- // dataIndex: 'approval',
|
|
|
- // key: 'approval',
|
|
|
- // title: '审批流程',
|
|
|
- // renderText: (_, record) => record.approval?.name
|
|
|
- // },
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: 'operation',
|
|
@@ -180,7 +145,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
params={state.params}
|
|
|
actionRef={tRef}
|
|
|
scroll={{ y: document.body.clientHeight - 291 }}
|
|
|
- // columns={generateColumns(columns, schema)}
|
|
|
columns={columns}
|
|
|
request={async (params, filter, sorter) => {
|
|
|
const { code = -1, data: { items = [], total = 0 } = {} } = await getProjectList({
|
|
@@ -196,10 +160,11 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
}}
|
|
|
toolbar={{
|
|
|
search: {
|
|
|
- onSearch: val => setState({ ...state, params: { ...state.params, search: val } })
|
|
|
+ onSearch: val => setState({ ...state, params: { ...state.params, search: val } }),
|
|
|
+ style: { width: '250px' },
|
|
|
+ placeholder: '请输入项目名称'
|
|
|
},
|
|
|
actions: [
|
|
|
- // <Button onClick={() => history.push('/project/management/add')}>新建项目</Button>
|
|
|
<Button
|
|
|
key="add"
|
|
|
type="primary"
|
|
@@ -209,7 +174,6 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
visible: true,
|
|
|
currentModalType: ModalType.ADD,
|
|
|
title: null
|
|
|
- // defaultFormData: transformToSchemaData(record, BaseMenuEnum.PROJECT, schema)
|
|
|
})
|
|
|
}>
|
|
|
新建项目
|
|
@@ -243,6 +207,5 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
|
|
|
}
|
|
|
|
|
|
export default connect(({ schemaBase }: { schemaBase: SchemaBaseModelState }) => ({
|
|
|
- // pTypeList: project.projectTypeList.map(item => ({ label: item.name, value: item.ID })),
|
|
|
schema: schemaBase.base[BaseMenuEnum.PROJECT]
|
|
|
}))(List)
|