Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-book
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-book
Commits
964ca990
提交
964ca990
authored
7月 22, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(admin): host preview and history dialogs
上级
b16eb3b9
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
25 行增加
和
59 行删除
+25
-59
FeatureDialog.jsx
...on/wangeditor-customer/features/history/FeatureDialog.jsx
+8
-0
feature.js
...rc/common/wangeditor-customer/features/history/feature.js
+2
-1
FeatureDialog.jsx
...on/wangeditor-customer/features/preview/FeatureDialog.jsx
+9
-0
feature.js
...rc/common/wangeditor-customer/features/preview/feature.js
+2
-1
WangEditorCustomer.jsx
...c/common/wangeditor-customer/shell/WangEditorCustomer.jsx
+4
-57
没有找到文件。
apps/admin/src/common/wangeditor-customer/features/history/FeatureDialog.jsx
0 → 100644
浏览文件 @
964ca990
import
{
Modal
}
from
'antd'
import
HistoryDialog
from
'./HistoryDialog'
export
default
function
HistoryFeatureDialog
({
open
,
onClose
,
runtime
})
{
return
<
Modal
open=
{
open
}
header=
{
null
}
footer=
{
null
}
destroyOnHidden
centered
keyboard=
{
false
}
closeIcon=
{
false
}
maskClosable=
{
false
}
width=
"90%"
onCancel=
{
onClose
}
wrapClassName=
"history1"
style=
{
{
padding
:
0
}
}
>
<
HistoryDialog
chapterId=
{
runtime
.
chapterId
}
bookId=
{
runtime
.
bookId
}
saveContent=
{
runtime
.
saveContent
}
setContent=
{
runtime
.
setContent
}
setHistoryVisible=
{
visible
=>
!
visible
&&
onClose
()
}
/>
</
Modal
>
}
apps/admin/src/common/wangeditor-customer/features/history/feature.js
浏览文件 @
964ca990
import
{
defineEditorFeature
}
from
'../../core/define-editor-feature'
import
HistoryFeatureDialog
from
'./FeatureDialog'
export
default
defineEditorFeature
({
id
:
'history'
})
export
default
defineEditorFeature
({
id
:
'history'
,
dialogs
:
[{
id
:
'history.open'
,
component
:
HistoryFeatureDialog
}]
})
apps/admin/src/common/wangeditor-customer/features/preview/FeatureDialog.jsx
0 → 100644
浏览文件 @
964ca990
import
{
Modal
}
from
'antd'
import
{
CloseOutlined
}
from
'@ant-design/icons'
import
PreviewDialog
from
'./PreviewDialog'
export
default
function
PreviewFeatureDialog
({
open
,
onClose
,
runtime
})
{
return
<
Modal
open=
{
open
}
header=
{
null
}
footer=
{
null
}
destroyOnHidden
centered
keyboard=
{
false
}
closeIcon=
{
<
CloseOutlined
style=
{
{
fontSize
:
20
,
color
:
'#fff'
}
}
/>
}
maskClosable=
{
false
}
classNames=
{
{
body
:
'phone-body'
,
wrapper
:
'phone-wrapper'
}
}
wrapClassName=
"wrap-phone-privew"
width=
"494px"
onCancel=
{
onClose
}
>
<
PreviewDialog
gData=
{
runtime
.
gData
}
editor=
{
runtime
.
editor
}
chapterId=
{
runtime
.
chapterId
}
bookId=
{
runtime
.
bookId
}
nowTitle=
{
runtime
.
nowTitle
}
/>
</
Modal
>
}
apps/admin/src/common/wangeditor-customer/features/preview/feature.js
浏览文件 @
964ca990
import
{
defineEditorFeature
}
from
'../../core/define-editor-feature'
import
PreviewFeatureDialog
from
'./FeatureDialog'
export
default
defineEditorFeature
({
id
:
'preview'
})
export
default
defineEditorFeature
({
id
:
'preview'
,
dialogs
:
[{
id
:
'preview.open'
,
component
:
PreviewFeatureDialog
}]
})
apps/admin/src/common/wangeditor-customer/shell/WangEditorCustomer.jsx
浏览文件 @
964ca990
import
{
useState
,
useEffect
,
useRef
,
forwardRef
,
useImperativeHandle
}
from
"react"
;
import
{
Button
,
Divider
,
Space
,
Modal
}
from
"antd"
;
import
{
EyeOutlined
,
SaveOutlined
,
CloseOutlined
,
HistoryOutlined
}
from
"@ant-design/icons"
;
import
{
EyeOutlined
,
SaveOutlined
,
HistoryOutlined
}
from
"@ant-design/icons"
;
import
dayjs
from
"dayjs"
;
import
"../utils/iconfont"
;
...
...
@@ -10,6 +10,7 @@ import "../utils/jax.less";
import
{
Boot
}
from
"@wangeditor/editor"
;
import
{
registerEditorFeatures
}
from
"../core/register-editor-features"
;
import
{
EditorDialogHost
}
from
"../core/EditorDialogHost"
;
import
{
openEditorDialog
}
from
'../core/editor-dialog'
import
{
editorFeatureRegistry
}
from
"../features"
;
import
{
DomEditor
,
SlateTransforms
}
from
"@wangeditor/editor"
;
...
...
@@ -24,8 +25,6 @@ dayjs.extend(relativeTime);
import
PreviewModal
from
"../features/preview/PreviewDialog"
;
import
HistoryModal
from
"../features/history/HistoryDialog"
;
import
{
EditorHeader
}
from
'./EditorHeader'
import
{
EditorSidebar
}
from
'./EditorSidebar'
import
{
useEditorLifecycle
}
from
'./useEditorLifecycle'
...
...
@@ -63,8 +62,6 @@ const WangEditorCustomer = (props, ref) => {
const
saveRef
=
useRef
();
const
[
priviewVisible
,
setPreviewVisible
]
=
useState
(
false
);
const
[
historyVisible
,
setHistoryVisible
]
=
useState
(
false
);
//点击历史
useImperativeHandle
(
ref
,
()
=>
{
...
...
@@ -144,7 +141,6 @@ const WangEditorCustomer = (props, ref) => {
],
};
const
previewRef
=
useRef
();
const
jsonContent
=
[
{
...
...
@@ -259,12 +255,12 @@ const WangEditorCustomer = (props, ref) => {
if
(
!
isView
)
{
await
saveContent
();
}
setPreviewVisible
(
true
);
openEditorDialog
(
editor
,
'preview.open'
);
};
// 历史
const
historyIt
=
async
()
=>
{
setHistoryVisible
(
true
);
openEditorDialog
(
editor
,
'history.open'
);
};
const
colorList
=
[
...
...
@@ -313,55 +309,6 @@ const WangEditorCustomer = (props, ref) => {
/>
</
div
>
{
!
isView
&&
<
EditorSidebar
editor=
{
editor
}
toolbarConfig=
{
toolbarConfig
}
toolbarRef=
{
toolbarRef
}
tabKey=
{
tabKey
}
onTabChange=
{
tabKeyChange
}
colorList=
{
colorList
}
onApplyColor=
{
setColor
}
/>
}
{
/* 预览 */
}
<
Modal
open=
{
priviewVisible
}
header=
{
null
}
footer=
{
null
}
destroyOnHidden
centered
keyboard=
{
false
}
closeIcon=
{
<
CloseOutlined
style=
{
{
fontSize
:
20
,
color
:
"#fff"
}
}
/>
}
maskClosable=
{
false
}
classNames=
{
{
body
:
"phone-body"
,
wrapper
:
"phone-wrapper"
}
}
wrapClassName=
"wrap-phone-privew"
width=
"494px"
onCancel=
{
()
=>
setPreviewVisible
(
false
)
}
>
<
PreviewModal
ref=
{
previewRef
}
gData=
{
gData
}
editor=
{
editor
}
chapterId=
{
chapterId
}
bookId=
{
bookId
}
nowTitle=
{
nowTitle
}
/>
</
Modal
>
{
/* 历史 */
}
<
Modal
open=
{
historyVisible
}
header=
{
null
}
footer=
{
null
}
destroyOnHidden
centered
keyboard=
{
false
}
closeIcon=
{
false
}
maskClosable=
{
false
}
width=
"90%"
onCancel=
{
()
=>
setHistoryVisible
(
false
)
}
wrapClassName=
"history1"
style=
{
{
padding
:
0
}
}
>
<
HistoryModal
setHistoryVisible=
{
setHistoryVisible
}
chapterId=
{
chapterId
}
bookId=
{
bookId
}
editor=
{
editor
}
saveContent=
{
saveContent
}
setContent=
{
setContent
}
/>
</
Modal
>
<
EditorDialogHost
editor=
{
editor
}
registry=
{
editorFeatureRegistry
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论