Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-book
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-book
Commits
bb1ea15d
提交
bb1ea15d
authored
3月 09, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 优化代码格式,统一箭头函数语法
上级
c32d0b8d
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
image.jsx
src/common/wangeditor-customer/components/image.jsx
+12
-12
没有找到文件。
src/common/wangeditor-customer/components/image.jsx
浏览文件 @
bb1ea15d
...
...
@@ -38,7 +38,7 @@ const ImageModal = (props, ref) => {
maxCount
:
1
,
showUploadList
:
false
,
accept
:
fileAccept
.
join
(
','
),
beforeUpload
:
file
=>
{
beforeUpload
:
(
file
)
=>
{
const
fileExt
=
file
.
name
.
substring
(
file
.
name
.
lastIndexOf
(
'.'
))
if
(
!
fileAccept
.
includes
(
fileExt
.
toLowerCase
()))
{
message
.
error
(
'请上传正确格式的图片'
)
...
...
@@ -52,7 +52,7 @@ const ImageModal = (props, ref) => {
setImgUrl
(
url
)
form
.
setFieldsValue
({
imgUrl
:
url
})
setUploading
(
false
)
}
}
,
}
const
clear
=
()
=>
{
...
...
@@ -65,12 +65,12 @@ const ImageModal = (props, ref) => {
setImageVisible
(
false
)
}
const
onFinish
=
values
=>
{
const
onFinish
=
(
values
)
=>
{
console
.
log
(
values
)
editor
.
restoreSelection
()
const
nodeEntries
=
SlateEditor
.
nodes
(
editor
,
{
match
:
node
=>
{
match
:
(
node
)
=>
{
// JS syntax
if
(
SlateElement
.
isElement
(
node
))
{
if
(
node
.
type
===
'paragraph'
)
{
...
...
@@ -79,7 +79,7 @@ const ImageModal = (props, ref) => {
}
return
false
},
universal
:
true
universal
:
true
,
})
for
(
let
nodeEntry
of
nodeEntries
)
{
const
[
node
]
=
nodeEntry
...
...
@@ -100,16 +100,16 @@ const ImageModal = (props, ref) => {
children
:
[
{
// 该字段必须要
text
:
''
}
]
}
]
text
:
''
,
}
,
]
,
}
,
]
,
}
const
oP
=
{
type
:
'paragraph'
,
textAlign
:
'center'
,
children
:
[{
text
:
values
.
imgTitle
}]
children
:
[{
text
:
values
.
imgTitle
}]
,
}
if
(
tempNodeInfo
&&
Object
.
entries
(
tempNodeInfo
).
length
>
0
)
{
...
...
@@ -142,7 +142,7 @@ const ImageModal = (props, ref) => {
clear
()
}
const
onOnlineImageChange
=
url
=>
{
const
onOnlineImageChange
=
(
url
)
=>
{
setImgUrl
(
url
)
form
.
setFieldsValue
({
imgUrl
:
url
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论