|
@@ -1,6 +1,6 @@
|
|
import { connect, useRequest } from 'umi'
|
|
import { connect, useRequest } from 'umi'
|
|
import { useEffect, useRef, useState } from 'react'
|
|
import { useEffect, useRef, useState } from 'react'
|
|
-import { message, Tabs } from 'antd'
|
|
|
|
|
|
+import { Form, message, Tabs } from 'antd'
|
|
import {
|
|
import {
|
|
getApprovalList,
|
|
getApprovalList,
|
|
getProject,
|
|
getProject,
|
|
@@ -13,11 +13,11 @@ import { BaseMenuEnum } from '@/pages/Schema/Base'
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
import type { SchemaBaseModelState } from '@/pages/Schema/Base/model'
|
|
import type { ConnectProps } from 'umi'
|
|
import type { ConnectProps } from 'umi'
|
|
import type { ProjectModelState } from '../../model'
|
|
import type { ProjectModelState } from '../../model'
|
|
-import ProForm, { ProFormDependency, ProFormSelect } from '@ant-design/pro-form'
|
|
|
|
|
|
+import ProForm from '@ant-design/pro-form'
|
|
// import TreeNodeSelect from './TreeNodeSelect'
|
|
// import TreeNodeSelect from './TreeNodeSelect'
|
|
import { ModalType } from './ProjectModal'
|
|
import { ModalType } from './ProjectModal'
|
|
import consts from '@/utils/consts'
|
|
import consts from '@/utils/consts'
|
|
-import { queryAcountList } from '@/services/api/institution'
|
|
|
|
|
|
+import TreeNodeSelect from './TreeNodeSelect'
|
|
|
|
|
|
enum FormType {
|
|
enum FormType {
|
|
UPLOAD_PERM = '1',
|
|
UPLOAD_PERM = '1',
|
|
@@ -79,20 +79,6 @@ const DetailModal: React.FC<ProjectModalProps> = ({
|
|
})
|
|
})
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- async function querySelectOptions() {
|
|
|
|
- const {
|
|
|
|
- code = -1,
|
|
|
|
- data: { items }
|
|
|
|
- } = await queryAcountList({ current: 1, pageSize: 21400 })
|
|
|
|
-
|
|
|
|
- setState({
|
|
|
|
- ...state,
|
|
|
|
- accountList:
|
|
|
|
- code === consts.RET_CODE.SUCCESS
|
|
|
|
- ? items.map(item => ({ label: item.name, value: item.ID }))
|
|
|
|
- : []
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
if (visible && !schema) {
|
|
if (visible && !schema) {
|
|
dispatch({
|
|
dispatch({
|
|
type: 'schemaBase/querySchema',
|
|
type: 'schemaBase/querySchema',
|
|
@@ -110,7 +96,6 @@ const DetailModal: React.FC<ProjectModalProps> = ({
|
|
}
|
|
}
|
|
|
|
|
|
if (state.activeKey === '3') {
|
|
if (state.activeKey === '3') {
|
|
- querySelectOptions()
|
|
|
|
ref2?.current?.setFieldsValue({ ...state.perm })
|
|
ref2?.current?.setFieldsValue({ ...state.perm })
|
|
}
|
|
}
|
|
}, [visible, state.activeKey])
|
|
}, [visible, state.activeKey])
|
|
@@ -218,21 +203,16 @@ const DetailModal: React.FC<ProjectModalProps> = ({
|
|
</TabPane> */}
|
|
</TabPane> */}
|
|
<TabPane tab="角色权限" key="3">
|
|
<TabPane tab="角色权限" key="3">
|
|
<ProForm formRef={ref2} onFinish={formData => onFinish(FormType.ROLE_PERM, formData)}>
|
|
<ProForm formRef={ref2} onFinish={formData => onFinish(FormType.ROLE_PERM, formData)}>
|
|
- <ProFormSelect
|
|
|
|
- name="createdID"
|
|
|
|
|
|
+ <Form.Item
|
|
label="创建人:创建项目、管理编辑者、上传项目数据、编制项目、添加批注"
|
|
label="创建人:创建项目、管理编辑者、上传项目数据、编制项目、添加批注"
|
|
- request={async () => {
|
|
|
|
- const { code = -1, data: { items } = { items: [] } } = await queryAcountList({
|
|
|
|
- current: 1,
|
|
|
|
- pageSize: 21400,
|
|
|
|
- isCreated: '1'
|
|
|
|
- })
|
|
|
|
- return code === consts.RET_CODE.SUCCESS
|
|
|
|
- ? items.map(item => ({ label: item.name, value: item.ID }))
|
|
|
|
- : []
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- <ProFormDependency name={['createdID']}>
|
|
|
|
|
|
+ name="createdID"
|
|
|
|
+ >
|
|
|
|
+ <TreeNodeSelect params={{ isCreated: '1' }} />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Form.Item label="编辑者:编制项目、上传项目数据、添加批注" name="reportAccount">
|
|
|
|
+ <TreeNodeSelect multiple />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ {/* <ProFormDependency name={['createdID']}>
|
|
{({ createdID }) => {
|
|
{({ createdID }) => {
|
|
return (
|
|
return (
|
|
<ProFormSelect
|
|
<ProFormSelect
|
|
@@ -245,7 +225,7 @@ const DetailModal: React.FC<ProjectModalProps> = ({
|
|
/>
|
|
/>
|
|
)
|
|
)
|
|
}}
|
|
}}
|
|
- </ProFormDependency>
|
|
|
|
|
|
+ </ProFormDependency> */}
|
|
</ProForm>
|
|
</ProForm>
|
|
</TabPane>
|
|
</TabPane>
|
|
</Tabs>
|
|
</Tabs>
|