Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-book
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-book
Commits
a07eeab9
提交
a07eeab9
authored
2月 10, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 编辑者选择的时候显示手机号
上级
b3a5b79c
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
11 行删除
+13
-11
index.jsx
src/components/selectTeacher/index.jsx
+9
-7
EditChapterEditors.jsx
src/pages/books/section/components/EditChapterEditors.jsx
+4
-4
没有找到文件。
src/components/selectTeacher/index.jsx
浏览文件 @
a07eeab9
...
@@ -7,12 +7,12 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 800, ...props }) {
...
@@ -7,12 +7,12 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 800, ...props }) {
const
[
options
,
setOptions
]
=
useState
([])
const
[
options
,
setOptions
]
=
useState
([])
const
fetchRef
=
useRef
(
0
)
const
fetchRef
=
useRef
(
0
)
const
debounceFetcher
=
useMemo
(()
=>
{
const
debounceFetcher
=
useMemo
(()
=>
{
const
loadOptions
=
value
=>
{
const
loadOptions
=
(
value
)
=>
{
fetchRef
.
current
+=
1
fetchRef
.
current
+=
1
const
fetchId
=
fetchRef
.
current
const
fetchId
=
fetchRef
.
current
setOptions
([])
setOptions
([])
setFetching
(
true
)
setFetching
(
true
)
fetchOptions
(
value
).
then
(
newOptions
=>
{
fetchOptions
(
value
).
then
(
(
newOptions
)
=>
{
if
(
fetchId
!==
fetchRef
.
current
)
{
if
(
fetchId
!==
fetchRef
.
current
)
{
// for fetch callback order
// for fetch callback order
return
return
...
@@ -39,12 +39,14 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 800, ...props }) {
...
@@ -39,12 +39,14 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 800, ...props }) {
async
function
fetchUserList
(
username
)
{
async
function
fetchUserList
(
username
)
{
console
.
log
(
'fetching user'
,
username
)
console
.
log
(
'fetching user'
,
username
)
return
getTeacherList
({
real_name
:
username
,
page_size
:
40
}).
then
(
res
=>
{
return
getTeacherList
({
real_name
:
username
,
page_size
:
40
}).
then
((
res
)
=>
{
return
res
.
data
.
list
return
res
.
data
.
list
.
map
((
item
)
=>
{
return
{
...
item
,
label
:
`
${
item
.
real_name
}
(
${
item
.
tel
}
)`
}
})
})
})
}
}
const
SelectTeacher
=
props
=>
{
const
SelectTeacher
=
(
props
)
=>
{
const
[
value
,
setValue
]
=
useState
([])
const
[
value
,
setValue
]
=
useState
([])
return
(
return
(
<
DebounceSelect
<
DebounceSelect
...
@@ -52,8 +54,8 @@ const SelectTeacher = props => {
...
@@ -52,8 +54,8 @@ const SelectTeacher = props => {
value=
{
value
}
value=
{
value
}
placeholder=
"Select users"
placeholder=
"Select users"
fetchOptions=
{
fetchUserList
}
fetchOptions=
{
fetchUserList
}
fieldNames=
{
{
label
:
'
real_name
'
,
value
:
'id'
}
}
fieldNames=
{
{
label
:
'
label
'
,
value
:
'id'
}
}
onChange=
{
newValue
=>
{
onChange=
{
(
newValue
)
=>
{
setValue
(
newValue
)
setValue
(
newValue
)
}
}
}
}
style=
{
{
width
:
'100%'
}
}
style=
{
{
width
:
'100%'
}
}
...
...
src/pages/books/section/components/EditChapterEditors.jsx
浏览文件 @
a07eeab9
...
@@ -8,7 +8,7 @@ const EditChapterEditors = ({ chapter = {}, onChange, ...props }) => {
...
@@ -8,7 +8,7 @@ const EditChapterEditors = ({ chapter = {}, onChange, ...props }) => {
const
[
value
,
setValue
]
=
useState
(
''
)
const
[
value
,
setValue
]
=
useState
(
''
)
useEffect
(()
=>
{
useEffect
(()
=>
{
getChapterEditors
({
book_id
:
chapter
.
book_id
,
chapter_id
:
chapter
.
id
}).
then
(
res
=>
{
getChapterEditors
({
book_id
:
chapter
.
book_id
,
chapter_id
:
chapter
.
id
}).
then
(
(
res
)
=>
{
setEditors
(
res
.
data
.
editors
||
[])
setEditors
(
res
.
data
.
editors
||
[])
const
value
=
res
.
data
.
selected_editor_ids
[
0
]
||
''
const
value
=
res
.
data
.
selected_editor_ids
[
0
]
||
''
setValue
(
value
)
setValue
(
value
)
...
@@ -26,12 +26,12 @@ const EditChapterEditors = ({ chapter = {}, onChange, ...props }) => {
...
@@ -26,12 +26,12 @@ const EditChapterEditors = ({ chapter = {}, onChange, ...props }) => {
<
Form
labelCol=
{
{
span
:
8
}
}
>
<
Form
labelCol=
{
{
span
:
8
}
}
>
<
Form
.
Item
label=
"当前章节"
>
{
chapter
.
title
}
</
Form
.
Item
>
<
Form
.
Item
label=
"当前章节"
>
{
chapter
.
title
}
</
Form
.
Item
>
<
Form
.
Item
label=
"编写者"
>
<
Form
.
Item
label=
"编写者"
>
<
Radio
.
Group
value=
{
value
}
onChange=
{
e
=>
setValue
(
e
.
target
.
value
)
}
style=
{
{
marginTop
:
'6px'
}
}
>
<
Radio
.
Group
value=
{
value
}
onChange=
{
(
e
)
=>
setValue
(
e
.
target
.
value
)
}
>
<
Space
direction=
"vertical"
>
<
Space
direction=
"vertical"
>
{
editors
.
map
(
item
=>
{
{
editors
.
map
(
(
item
)
=>
{
return
(
return
(
<
Radio
value=
{
item
.
editor_id
}
key=
{
item
.
editor_id
}
>
<
Radio
value=
{
item
.
editor_id
}
key=
{
item
.
editor_id
}
>
{
item
.
real_name
}
{
item
.
real_name
}
(
{
item
.
tel
}
)
</
Radio
>
</
Radio
>
)
)
})
}
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论