Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
9bd774f3
提交
9bd774f3
authored
7月 04, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:账号管理设置单位
上级
0034b71e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
10 行删除
+21
-10
index.tsx
...es/systemManage/accountManage/comp/addEditModal/index.tsx
+20
-10
index.tsx
...es/systemManage/companyManage/comp/addEditModal/index.tsx
+1
-0
没有找到文件。
src/pages/systemManage/accountManage/comp/addEditModal/index.tsx
浏览文件 @
9bd774f3
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
insertBAccountType
,
listBAccountPageType
}
from
'~/api/interface/systemManageType'
;
import
{
insertBAccountType
,
listBAccountPageType
}
from
'~/api/interface/systemManageType'
;
import
{
Col
,
Form
,
Input
,
message
,
Modal
,
Row
,
Select
,
TreeSelect
}
from
'antd'
;
import
{
Col
,
Form
,
Input
,
message
,
Modal
,
Row
,
Select
}
from
'antd'
;
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
SystemManageAPI
}
from
'~/api'
;
// 列表的类型
// 列表的类型
...
@@ -21,6 +21,8 @@ const AddEditModal: React.FC<propType> = (props) => {
...
@@ -21,6 +21,8 @@ const AddEditModal: React.FC<propType> = (props) => {
};
};
// 参数
// 参数
const
{
title
,
open
,
closed
,
data
}
=
props
;
const
{
title
,
open
,
closed
,
data
}
=
props
;
// 单位列表
const
[
companyList
,
setCompanyList
]
=
useState
<
{
label
:
string
;
value
:
number
}[]
>
([]);
// 表单钩子
// 表单钩子
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 关闭弹窗
// 关闭弹窗
...
@@ -56,9 +58,18 @@ const AddEditModal: React.FC<propType> = (props) => {
...
@@ -56,9 +58,18 @@ const AddEditModal: React.FC<propType> = (props) => {
handleCancel
();
handleCancel
();
}
}
};
};
// 获取所属单位
const
getCompanyList
=
async
()
=>
{
const
res
=
await
SystemManageAPI
.
listCompanyPage
({
pageNo
:
1
,
pageSize
:
9999
,
});
setCompanyList
(
res
?.
result
?.
list
?.
map
((
i
)
=>
({
label
:
i
.
companyName
,
value
:
i
.
id
}))
||
[]);
};
// componentDidMount
// componentDidMount
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
open
)
return
;
if
(
!
open
)
return
;
getCompanyList
().
then
();
if
(
!
data
)
return
;
if
(
!
data
)
return
;
form
.
setFieldsValue
(
data
);
form
.
setFieldsValue
(
data
);
// console.log('data --->', data);
// console.log('data --->', data);
...
@@ -169,17 +180,16 @@ const AddEditModal: React.FC<propType> = (props) => {
...
@@ -169,17 +180,16 @@ const AddEditModal: React.FC<propType> = (props) => {
wrapperCol=
{
{
span
:
18
}
}
wrapperCol=
{
{
span
:
18
}
}
rules=
{
[{
required
:
true
,
message
:
'请选择所属单位'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择所属单位'
}]
}
name=
'companyId'
name=
'companyId'
initialValue=
{
1
}
//
initialValue={1}
>
>
<
Tree
Select
<
Select
treeData=
{
[{
id
:
1
,
company
:
'科比特'
}]
}
options=
{
companyList
}
placeholder=
'请选择所属单位'
placeholder=
'请选择所属单位'
fieldNames=
{
{
children
:
'children'
,
label
:
'company'
,
value
:
'id'
,
}
}
allowClear
allowClear
showSearch
filterOption=
{
(
input
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
...
...
src/pages/systemManage/companyManage/comp/addEditModal/index.tsx
浏览文件 @
9bd774f3
...
@@ -44,6 +44,7 @@ const AddEditModal: React.FC<propType> = (props) => {
...
@@ -44,6 +44,7 @@ const AddEditModal: React.FC<propType> = (props) => {
province
:
values
?.
area
?.
at
(
0
),
province
:
values
?.
area
?.
at
(
0
),
city
:
values
?.
area
?.
at
(
1
),
city
:
values
?.
area
?.
at
(
1
),
district
:
values
?.
area
?.
at
(
2
),
district
:
values
?.
area
?.
at
(
2
),
companyType
:
1
,
});
});
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论