|
@@ -83,6 +83,42 @@ const DetailModal: React.FC<ProjectModalProps> = ({
|
|
}
|
|
}
|
|
}, [visible, state.activeKey])
|
|
}, [visible, state.activeKey])
|
|
|
|
|
|
|
|
+<<<<<<< HEAD:src/pages/Project/Management/List/components/Detail.tsx
|
|
|
|
+=======
|
|
|
|
+ const onMount = async () => {
|
|
|
|
+ const { dataID } = defaultFormData
|
|
|
|
+ const { code = -1, data } = await getProject({ ID: dataID })
|
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
+ const {
|
|
|
|
+ created: { ID: createdID },
|
|
|
|
+ reportAccount,
|
|
|
|
+ ...currentFormData
|
|
|
|
+ } = { ...data }
|
|
|
|
+
|
|
|
|
+ setState({
|
|
|
|
+ ...state,
|
|
|
|
+ account: currentFormData,
|
|
|
|
+ perm: { createdID, reportAccount: reportAccount?.map(item => item.ID) || [] }
|
|
|
|
+ })
|
|
|
|
+ const keys = Object.keys(currentFormData)
|
|
|
|
+ keys.forEach(key => {
|
|
|
|
+ if (currentFormData[key] instanceof Object) {
|
|
|
|
+ const targetMap = currentFormData[key]
|
|
|
|
+ delete currentFormData[key]
|
|
|
|
+ currentFormData[`${key}ID`] = targetMap.ID
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ form.setValues({ ...currentFormData })
|
|
|
|
+ }
|
|
|
|
+ delay(80).then(() => {
|
|
|
|
+ form.setSchemaByPath('projectTypeID', {
|
|
|
|
+ enum: pTypeList.map(item => item.value),
|
|
|
|
+ enumNames: pTypeList.map(item => item.label)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+>>>>>>> 994f418... feat: 修复由于编辑者为空的情况引发的报错:src/pages/Project/Management/components/Detail.tsx
|
|
const onChange = key => {
|
|
const onChange = key => {
|
|
setState({ ...state, activeKey: key })
|
|
setState({ ...state, activeKey: key })
|
|
if (key === '2') {
|
|
if (key === '2') {
|
|
@@ -155,7 +191,8 @@ const DetailModal: React.FC<ProjectModalProps> = ({
|
|
<Form.Item
|
|
<Form.Item
|
|
label="创建人:创建项目、管理编辑者、上传项目数据、编制项目、添加批注"
|
|
label="创建人:创建项目、管理编辑者、上传项目数据、编制项目、添加批注"
|
|
name="createdID"
|
|
name="createdID"
|
|
- rules={[{ required: true, message: '请选择创建人' }]}>
|
|
|
|
|
|
+ rules={[{ required: true, message: '请选择创建人' }]}
|
|
|
|
+ >
|
|
<TreeNodeSelect params={{ isCreated: 1 }} />
|
|
<TreeNodeSelect params={{ isCreated: 1 }} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item label="编辑者:编制项目、上传项目数据、添加批注" name="reportAccount">
|
|
<Form.Item label="编辑者:编制项目、上传项目数据、添加批注" name="reportAccount">
|