Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
3d1b5c09
提交
3d1b5c09
authored
6月 25, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
27859 招生计划管理-新增或修改字段优化
上级
37155f9c
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
30 行增加
和
295 行删除
+30
-295
ReactComponent.js
zyd_public/WangEditor/WangEditor5/ReactComponent.js
+30
-3
Boot.d.ts
zyd_public/WangEditor/WangEditor5/editor/src/Boot.d.ts
+0
-31
svg.d.ts
...blic/WangEditor/WangEditor5/editor/src/constants/svg.d.ts
+0
-14
create.d.ts
zyd_public/WangEditor/WangEditor5/editor/src/create.d.ts
+0
-28
index.d.ts
zyd_public/WangEditor/WangEditor5/editor/src/index.d.ts
+0
-18
hoverbar.d.ts
...itor5/editor/src/init-default-config/config/hoverbar.d.ts
+0
-47
index.d.ts
...gEditor5/editor/src/init-default-config/config/index.d.ts
+0
-67
toolbar.d.ts
...ditor5/editor/src/init-default-config/config/toolbar.d.ts
+0
-16
index.d.ts
...tor/WangEditor5/editor/src/init-default-config/index.d.ts
+0
-5
en.d.ts
zyd_public/WangEditor/WangEditor5/editor/src/locale/en.d.ts
+0
-14
index.d.ts
...ublic/WangEditor/WangEditor5/editor/src/locale/index.d.ts
+0
-5
zh-CN.d.ts
...ublic/WangEditor/WangEditor5/editor/src/locale/zh-CN.d.ts
+0
-14
index.d.ts
...angEditor5/editor/src/register-builtin-modules/index.d.ts
+0
-10
register.d.ts
...Editor5/editor/src/register-builtin-modules/register.d.ts
+0
-7
browser-polyfill.d.ts
...Editor/WangEditor5/editor/src/utils/browser-polyfill.d.ts
+0
-6
dom.d.ts
zyd_public/WangEditor/WangEditor5/editor/src/utils/dom.d.ts
+0
-6
node-polyfill.d.ts
...angEditor/WangEditor5/editor/src/utils/node-polyfill.d.ts
+0
-4
index.js
zyd_public/WangEditor/WangEditor5/index.js
+0
-0
没有找到文件。
zyd_public/WangEditor/WangEditor5/ReactComponent.js
浏览文件 @
3d1b5c09
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
* npm install
* npm install
* 再在 git bash 中执行
* 再在 git bash 中执行
* npm run build 获取编译后的文件/packages/editor/dist 复制出来放在项目代码中并使用
* npm run build 获取编译后的文件/packages/editor/dist 复制出来放在项目代码中并使用
* 2022年6月25日 解决了上传图片功能
* TODO 无法创建自定义菜单 (Pdf上传功能, 视频上传功能);
* TODO https://www.wangeditor.com/v5/development.html#%E6%B3%A8%E5%86%8C%E8%8F%9C%E5%8D%95
*
* */
* */
/**
/**
...
@@ -49,6 +53,12 @@
...
@@ -49,6 +53,12 @@
import
styles
from
'./css/style.less'
;
import
styles
from
'./css/style.less'
;
import
*
as
WangEditor5
from
'./index.esm'
;
import
*
as
WangEditor5
from
'./index.esm'
;
import
React
,
{
Fragment
,
useEffect
,
useState
}
from
'react'
;
import
React
,
{
Fragment
,
useEffect
,
useState
}
from
'react'
;
import
compressImage
from
'@/webPublic/zyd_public/WangEditor/compressImage'
;
// import uploadFile from '@/webPublic/zyd_public/WangEditor/uploadFile';
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
{
uploadFile
as
uploadOnestopFile
}
from
'@/webPublic/one_stop_public/libs/PictureSignature/ShowItem'
;
console
.
log
(
WangEditor5
);
// console.log(WangEditor5Menus);
export
default
function
WangEditorReactComponent
(
props
)
{
export
default
function
WangEditorReactComponent
(
props
)
{
const
{
const
{
...
@@ -58,7 +68,6 @@ export default function WangEditorReactComponent(props) {
...
@@ -58,7 +68,6 @@ export default function WangEditorReactComponent(props) {
onChange
,
onChange
,
}
=
props
;
}
=
props
;
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
WangEditor5
);
let
htmlDefault
=
''
;
let
htmlDefault
=
''
;
if
(
value
&&
value
.
indexOf
(
'wangEditorHtml'
)
>
-
1
)
{
if
(
value
&&
value
.
indexOf
(
'wangEditorHtml'
)
>
-
1
)
{
htmlDefault
=
value
;
htmlDefault
=
value
;
...
@@ -68,6 +77,20 @@ export default function WangEditorReactComponent(props) {
...
@@ -68,6 +77,20 @@ export default function WangEditorReactComponent(props) {
const
editorConfig
=
{
const
editorConfig
=
{
placeholder
:
'请输入内容'
,
placeholder
:
'请输入内容'
,
html
:
htmlDefault
,
html
:
htmlDefault
,
MENU_CONF
:
{
uploadImage
:
{
customUpload
:
(
file
,
insertFn
)
=>
{
compressImage
(
file
,
(
fileNew
)
=>
{
uploadOnestopFile
(
fileNew
).
then
((
y
)
=>
{
// 使用一站式的文件上传接口
if
(
y
&&
y
.
length
)
{
insertFn
(
queryApiActionPath
()
+
y
,
file
.
name
);
}
});
});
},
},
},
onChange
:
(
editor
)
=>
{
onChange
:
(
editor
)
=>
{
// console.log('content', editor.children);
// console.log('content', editor.children);
onChange
(
editor
.
getHtml
());
onChange
(
editor
.
getHtml
());
...
@@ -85,6 +108,10 @@ export default function WangEditorReactComponent(props) {
...
@@ -85,6 +108,10 @@ export default function WangEditorReactComponent(props) {
'bulletedList'
,
'bulletedList'
,
'numberedList'
,
'numberedList'
,
],
],
// insertKeys: {
// index: 5, // 插入的位置,基于当前的 toolbarKeys
// keys: ['video-upload'],
// },
};
};
const
editor
=
WangEditor5
.
createEditor
({
const
editor
=
WangEditor5
.
createEditor
({
...
@@ -100,8 +127,8 @@ export default function WangEditorReactComponent(props) {
...
@@ -100,8 +127,8 @@ export default function WangEditorReactComponent(props) {
mode
:
'default'
,
mode
:
'default'
,
});
});
console
.
log
(
editor
.
getAllMenuKeys
());
//
console.log(editor.getAllMenuKeys());
console
.
log
(
toolBar
.
getConfig
().
toolbarKeys
);
//
console.log(toolBar.getConfig().toolbarKeys);
},
[]);
},
[]);
...
...
zyd_public/WangEditor/WangEditor5/editor/src/Boot.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description Editor View class
* @author wangfupeng
*/
import
{
IDomEditor
,
IEditorConfig
,
IToolbarConfig
,
IModuleConf
,
IRegisterMenuConf
,
IRenderElemConf
,
RenderStyleFnType
,
IElemToHtmlConf
,
styleToHtmlFnType
,
IPreParseHtmlConf
,
ParseStyleHtmlFnType
,
IParseElemHtmlConf
}
from
'@wangeditor/core'
;
declare
type
PluginType
=
<
T
extends
IDomEditor
>
(
editor
:
T
)
=>
T
;
declare
class
Boot
{
constructor
();
static
editorConfig
:
Partial
<
IEditorConfig
>
;
static
setEditorConfig
(
newConfig
?:
Partial
<
IEditorConfig
>
):
void
;
static
simpleEditorConfig
:
Partial
<
IEditorConfig
>
;
static
setSimpleEditorConfig
(
newConfig
?:
Partial
<
IEditorConfig
>
):
void
;
static
toolbarConfig
:
Partial
<
IToolbarConfig
>
;
static
setToolbarConfig
(
newConfig
?:
Partial
<
IToolbarConfig
>
):
void
;
static
simpleToolbarConfig
:
Partial
<
IToolbarConfig
>
;
static
setSimpleToolbarConfig
(
newConfig
?:
Partial
<
IToolbarConfig
>
):
void
;
static
plugins
:
PluginType
[];
static
registerPlugin
(
plugin
:
PluginType
):
void
;
static
registerMenu
(
menuConf
:
IRegisterMenuConf
,
customConfig
?:
{
[
key
:
string
]:
any
;
}):
void
;
static
registerRenderElem
(
renderElemConf
:
IRenderElemConf
):
void
;
static
registerRenderStyle
(
fn
:
RenderStyleFnType
):
void
;
static
registerElemToHtml
(
elemToHtmlConf
:
IElemToHtmlConf
):
void
;
static
registerStyleToHtml
(
fn
:
styleToHtmlFnType
):
void
;
static
registerPreParseHtml
(
preParseHtmlConf
:
IPreParseHtmlConf
):
void
;
static
registerParseElemHtml
(
parseElemHtmlConf
:
IParseElemHtmlConf
):
void
;
static
registerParseStyleHtml
(
fn
:
ParseStyleHtmlFnType
):
void
;
static
registerModule
(
module
:
Partial
<
IModuleConf
>
):
void
;
}
export
default
Boot
;
zyd_public/WangEditor/WangEditor5/editor/src/constants/svg.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description svg tag
* @author wangfupeng
*/
/**
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
* 找不到再从 iconfont.com 搜索
*/
export
declare
const
INDENT_RIGHT_SVG
=
"<svg viewBox=
\"
0 0 1024 1024
\"
><path d=
\"
M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z
\"
></path></svg>"
;
export
declare
const
JUSTIFY_LEFT_SVG
=
"<svg viewBox=
\"
0 0 1024 1024
\"
><path d=
\"
M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z
\"
></path></svg>"
;
export
declare
const
IMAGE_SVG
=
"<svg viewBox=
\"
0 0 1024 1024
\"
><path d=
\"
M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z
\"
></path></svg>"
;
export
declare
const
MORE_SVG
=
"<svg viewBox=
\"
0 0 1024 1024
\"
><path d=
\"
M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z
\"
></path><path d=
\"
M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z
\"
></path><path d=
\"
M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z
\"
></path></svg>"
;
export
declare
const
VIDEO_SVG
=
"<svg viewBox=
\"
0 0 1024 1024
\"
><path d=
\"
M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z
\"
></path></svg>"
;
zyd_public/WangEditor/WangEditor5/editor/src/create.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description create
* @author wangfupeng
*/
import
{
Descendant
}
from
'slate'
;
import
{
DOMElement
}
from
'./utils/dom'
;
import
{
IEditorConfig
,
IDomEditor
,
IToolbarConfig
,
Toolbar
}
from
'@wangeditor/core'
;
export
interface
ICreateEditorOption
{
selector
:
string
|
DOMElement
;
config
:
Partial
<
IEditorConfig
>
;
content
?:
Descendant
[];
html
?:
string
;
mode
:
string
;
}
export
interface
ICreateToolbarOption
{
editor
:
IDomEditor
|
null
;
selector
:
string
|
DOMElement
;
config
?:
Partial
<
IToolbarConfig
>
;
mode
?:
string
;
}
/**
* 创建 editor 实例
*/
export
declare
function
createEditor
(
option
?:
Partial
<
ICreateEditorOption
>
):
IDomEditor
;
/**
* 创建 toolbar 实例
*/
export
declare
function
createToolbar
(
option
:
ICreateToolbarOption
):
Toolbar
;
zyd_public/WangEditor/WangEditor5/editor/src/index.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description editor entry
* @author wangfupeng
*/
import
'./assets/index.less'
;
import
'@wangeditor/core/dist/css/style.css'
;
import
'./utils/browser-polyfill'
;
import
'./utils/node-polyfill'
;
import
'./locale/index'
;
import
'./register-builtin-modules/index'
;
import
'./init-default-config'
;
import
Boot
from
'./Boot'
;
export
{
Boot
};
export
{
DomEditor
,
IDomEditor
,
IEditorConfig
,
IToolbarConfig
,
Toolbar
,
IModuleConf
,
IButtonMenu
,
ISelectMenu
,
IDropPanelMenu
,
IModalMenu
,
i18nChangeLanguage
,
i18nAddResources
,
i18nGetResources
,
t
,
genModalTextareaElems
,
genModalInputElems
,
genModalButtonElems
,
createUploader
,
IUploadConfig
,
}
from
'@wangeditor/core'
;
export
{
Transforms
as
SlateTransforms
,
Descendant
as
SlateDescendant
,
Editor
as
SlateEditor
,
Node
as
SlateNode
,
Element
as
SlateElement
,
Text
as
SlateText
,
Path
as
SlatePath
,
Range
as
SlateRange
,
Location
as
SlateLocation
,
Point
as
SlatePoint
,
}
from
'slate'
;
export
{
createEditor
,
createToolbar
}
from
'./create'
;
declare
const
_default
:
{};
export
default
_default
;
zyd_public/WangEditor/WangEditor5/editor/src/init-default-config/config/hoverbar.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description hoverbar 配置
* @author wangfupeng
*/
export
declare
function
genDefaultHoverbarKeys
():
{
text
:
{
menuKeys
:
string
[];
};
link
:
{
menuKeys
:
string
[];
};
image
:
{
menuKeys
:
string
[];
};
pre
:
{
menuKeys
:
string
[];
};
table
:
{
menuKeys
:
string
[];
};
divider
:
{
menuKeys
:
string
[];
};
video
:
{
menuKeys
:
string
[];
};
};
export
declare
function
genSimpleHoverbarKeys
():
{
link
:
{
menuKeys
:
string
[];
};
image
:
{
menuKeys
:
string
[];
};
pre
:
{
menuKeys
:
string
[];
};
table
:
{
menuKeys
:
string
[];
};
divider
:
{
menuKeys
:
string
[];
};
video
:
{
menuKeys
:
string
[];
};
};
zyd_public/WangEditor/WangEditor5/editor/src/init-default-config/config/index.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description 获取编辑器默认配置
* @author wangfupeng
*/
export
declare
function
getDefaultEditorConfig
():
{
hoverbarKeys
:
{
text
:
{
menuKeys
:
string
[];
};
link
:
{
menuKeys
:
string
[];
};
image
:
{
menuKeys
:
string
[];
};
pre
:
{
menuKeys
:
string
[];
};
table
:
{
menuKeys
:
string
[];
};
divider
:
{
menuKeys
:
string
[];
};
video
:
{
menuKeys
:
string
[];
};
};
};
export
declare
function
getSimpleEditorConfig
():
{
hoverbarKeys
:
{
link
:
{
menuKeys
:
string
[];
};
image
:
{
menuKeys
:
string
[];
};
pre
:
{
menuKeys
:
string
[];
};
table
:
{
menuKeys
:
string
[];
};
divider
:
{
menuKeys
:
string
[];
};
video
:
{
menuKeys
:
string
[];
};
};
};
export
declare
function
getDefaultToolbarConfig
():
{
toolbarKeys
:
(
string
|
{
key
:
string
;
title
:
string
;
iconSvg
:
string
;
menuKeys
:
string
[];
})[];
};
export
declare
function
getSimpleToolbarConfig
():
{
toolbarKeys
:
(
string
|
{
key
:
string
;
title
:
string
;
iconSvg
:
string
;
menuKeys
:
string
[];
})[];
};
zyd_public/WangEditor/WangEditor5/editor/src/init-default-config/config/toolbar.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description toolbar 配置
* @author wangfupeng
*/
export
declare
function
genDefaultToolbarKeys
():
(
string
|
{
key
:
string
;
title
:
string
;
iconSvg
:
string
;
menuKeys
:
string
[];
})[];
export
declare
function
genSimpleToolbarKeys
():
(
string
|
{
key
:
string
;
title
:
string
;
iconSvg
:
string
;
menuKeys
:
string
[];
})[];
zyd_public/WangEditor/WangEditor5/editor/src/init-default-config/index.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description set default config
* @author wangfupeng
*/
export
{};
zyd_public/WangEditor/WangEditor5/editor/src/locale/en.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description i18n en
* @author wangfupeng
*/
declare
const
_default
:
{
editor
:
{
more
:
string
;
justify
:
string
;
indent
:
string
;
image
:
string
;
video
:
string
;
};
};
export
default
_default
;
zyd_public/WangEditor/WangEditor5/editor/src/locale/index.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description i18n entry
* @author wangfupeng
*/
export
{};
zyd_public/WangEditor/WangEditor5/editor/src/locale/zh-CN.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description i18n zh-CN
* @author wangfupeng
*/
declare
const
_default
:
{
editor
:
{
more
:
string
;
justify
:
string
;
indent
:
string
;
image
:
string
;
video
:
string
;
};
};
export
default
_default
;
zyd_public/WangEditor/WangEditor5/editor/src/register-builtin-modules/index.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description register builtin modules
* @author wangfupeng
*/
import
'@wangeditor/basic-modules/dist/css/style.css'
;
import
'@wangeditor/list-module/dist/css/style.css'
;
import
'@wangeditor/table-module/dist/css/style.css'
;
import
'@wangeditor/video-module/dist/css/style.css'
;
import
'@wangeditor/upload-image-module/dist/css/style.css'
;
import
'@wangeditor/code-highlight/dist/css/style.css'
;
zyd_public/WangEditor/WangEditor5/editor/src/register-builtin-modules/register.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description 注册 module
* @author wangfupeng
*/
import
{
IModuleConf
}
from
'@wangeditor/core'
;
declare
function
registerModule
(
module
:
Partial
<
IModuleConf
>
):
void
;
export
default
registerModule
;
zyd_public/WangEditor/WangEditor5/editor/src/utils/browser-polyfill.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description browser polyfill
* @author wangfupeng
*/
declare
function
globalThisPolyfill
():
void
;
declare
function
AggregateErrorPolyfill
():
void
;
zyd_public/WangEditor/WangEditor5/editor/src/utils/dom.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description dom utils
* @author wangfupeng
*/
import
DOMElement
=
globalThis
.
Element
;
export
{
DOMElement
};
zyd_public/WangEditor/WangEditor5/editor/src/utils/node-polyfill.d.ts
deleted
100644 → 0
浏览文件 @
37155f9c
/**
* @description node polyfill
* @author wangfupeng
*/
zyd_public/WangEditor/WangEditor5/index.js
deleted
100644 → 0
浏览文件 @
37155f9c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论