|
@@ -29,27 +29,12 @@ const Created = () => {
|
|
|
const { run: tryQueryProjectList } = useRequest(
|
|
|
createdID => getProjectList({ current: 1, pageSize: 21300, createdID }),
|
|
|
{
|
|
|
+ manual: true,
|
|
|
onSuccess: ({ items }) => {
|
|
|
setState({ ...state, projectList: items })
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
- useEffect(() => {
|
|
|
- async function querySelectOptions() {
|
|
|
- const {
|
|
|
- code = -1,
|
|
|
- data: { items }
|
|
|
- } = await queryAcountList({ current: 1, pageSize: 21400, isCreated: '0' })
|
|
|
- setState({
|
|
|
- ...state,
|
|
|
- options:
|
|
|
- code === consts.RET_CODE.SUCCESS
|
|
|
- ? items.map(item => ({ label: item.name, value: item.ID }))
|
|
|
- : []
|
|
|
- })
|
|
|
- }
|
|
|
- state.modalVisible && querySelectOptions()
|
|
|
- }, [state.modalVisible])
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (state.dataID && state.modalType === CreatedModalType.DEL) {
|
|
@@ -155,7 +140,18 @@ const Created = () => {
|
|
|
{state.modalType === CreatedModalType.ADD ? (
|
|
|
<>
|
|
|
<p className="mb-4">创建人可在前台创建项目、上传项目数据、编制项目等</p>
|
|
|
- <ProFormSelect name="ID" options={state.options} />
|
|
|
+ <ProFormSelect
|
|
|
+ name="ID"
|
|
|
+ request={async () => {
|
|
|
+ const {
|
|
|
+ code = -1,
|
|
|
+ data: { items }
|
|
|
+ } = await queryAcountList({ current: 1, pageSize: 21400, isCreated: '0' })
|
|
|
+ return code === consts.RET_CODE.SUCCESS
|
|
|
+ ? items.map(item => ({ label: item.name, value: item.ID }))
|
|
|
+ : []
|
|
|
+ }}
|
|
|
+ />
|
|
|
</>
|
|
|
) : (
|
|
|
<>
|