Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
c73bea90
提交
c73bea90
authored
6月 11, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改目录管理接口
上级
d1f90f95
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
7 行删除
+21
-7
categoryManage.ts
src/api/modules/categoryManage.ts
+1
-1
index.tsx
...yManage/directoryManage/components/addOrEditDec/index.tsx
+20
-6
没有找到文件。
src/api/modules/categoryManage.ts
浏览文件 @
c73bea90
...
@@ -25,7 +25,7 @@ export class CategoryManageAPI {
...
@@ -25,7 +25,7 @@ export class CategoryManageAPI {
};
};
// 新增或编辑目录
// 新增或编辑目录
static
addOrEditDirectory
=
(
static
addOrEditDirectory
=
(
data
:
{
id
?:
number
;
directoryName
:
string
;
type
:
number
;
relevance
:
number
}[]
,
data
:
{
id
?:
number
;
directoryName
:
string
;
type
:
number
;
show
:
number
[]
}
,
)
=>
{
)
=>
{
return
axios
.
post
(
'/pms/classify/addOrEditDirectory'
,
data
);
return
axios
.
post
(
'/pms/classify/addOrEditDirectory'
,
data
);
};
};
...
...
src/pages/categoryManage/directoryManage/components/addOrEditDec/index.tsx
浏览文件 @
c73bea90
...
@@ -10,6 +10,7 @@ import {
...
@@ -10,6 +10,7 @@ import {
RadioChangeEvent
,
RadioChangeEvent
,
Radio
,
Radio
,
Space
,
Space
,
Checkbox
,
}
from
'antd'
;
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
...
@@ -54,7 +55,6 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
...
@@ -54,7 +55,6 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
editData
,
editData
,
})
=>
{
})
=>
{
const
[
form
]
=
Form
.
useForm
<
any
>
();
const
[
form
]
=
Form
.
useForm
<
any
>
();
const
[
hasPid
,
setHasPid
]
=
useState
(
false
);
//是否有上级目录
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
//提交按钮的loading
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
//提交按钮的loading
const
[
directoryOptions
,
setDirectoryOptions
]
=
useState
([]);
//目录options
const
[
directoryOptions
,
setDirectoryOptions
]
=
useState
([]);
//目录options
...
@@ -66,10 +66,11 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
...
@@ -66,10 +66,11 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
form
.
setFieldValue
(
'directoryName'
,
editData
.
directoryName
);
form
.
setFieldValue
(
'directoryName'
,
editData
.
directoryName
);
onChangeType
(
editData
.
type
);
onChangeType
(
editData
.
type
);
if
(
editData
.
pid
)
{
if
(
editData
.
type
==
0
)
{
setHasPid
(
true
);
form
.
setFieldValue
(
}
else
{
'show'
,
setHasPid
(
false
);
editData
.
show
?.
map
((
value
)
=>
Number
(
value
)),
);
}
}
}
}
}
}
...
@@ -92,7 +93,6 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
...
@@ -92,7 +93,6 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
const
res
=
await
CategoryManageAPI
.
addOrEditDirectory
({
const
res
=
await
CategoryManageAPI
.
addOrEditDirectory
({
...
values
,
...
values
,
id
:
editData
?.
id
,
id
:
editData
?.
id
,
pid
:
hasPid
?
values
.
pid
:
null
,
});
});
res
.
code
==
'200'
&&
message
.
success
(
'新增成功'
);
res
.
code
==
'200'
&&
message
.
success
(
'新增成功'
);
handleOk
();
handleOk
();
...
@@ -142,6 +142,20 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
...
@@ -142,6 +142,20 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
<
Form
.
Item
label=
'目录名称'
name=
'directoryName'
rules=
{
[{
required
:
true
}]
}
>
<
Form
.
Item
label=
'目录名称'
name=
'directoryName'
rules=
{
[{
required
:
true
}]
}
>
<
Input
placeholder=
'请输入目录名称'
allowClear=
{
true
}
></
Input
>
<
Input
placeholder=
'请输入目录名称'
allowClear=
{
true
}
></
Input
>
</
Form
.
Item
>
</
Form
.
Item
>
{
form
.
getFieldValue
(
'type'
)
==
'0'
&&
(
<
Form
.
Item
label=
'显示设置'
name=
'show'
rules=
{
[{
required
:
true
,
message
:
'请选择显示设置'
}]
}
>
<
Checkbox
.
Group
>
<
Checkbox
value=
{
1
}
>
作业服务分类
</
Checkbox
>
<
Checkbox
value=
{
3
}
>
飞手培训分类
</
Checkbox
>
<
Checkbox
value=
{
2
}
>
设备租赁分类
</
Checkbox
>
<
Checkbox
value=
{
4
}
>
产品商城分类
</
Checkbox
>
</
Checkbox
.
Group
>
</
Form
.
Item
>
)
}
</
Form
>
</
Form
>
</
Modal
>
</
Modal
>
);
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论