Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yubinCloud
fairy-wiki
提交
8a52f5e2
F
fairy-wiki
项目概览
yubinCloud
/
fairy-wiki
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fairy-wiki
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8a52f5e2
编写于
4月 23, 2021
作者:
yubinCloud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8-7 集成了富文本框 wangEditor
上级
cd50a45f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
19 deletion
+35
-19
web/package.json
web/package.json
+2
-1
web/src/views/admin/admin-doc.vue
web/src/views/admin/admin-doc.vue
+33
-18
未找到文件。
web/package.json
浏览文件 @
8a52f5e2
...
...
@@ -15,7 +15,8 @@
"axios"
:
"^0.21.0"
,
"vue"
:
"^3.0.0"
,
"vue-router"
:
"^4.0.0-0"
,
"vuex"
:
"^4.0.0-0"
"vuex"
:
"^4.0.0-0"
,
"wangeditor"
:
"^4.6.16"
},
"devDependencies"
:
{
"@typescript-eslint/eslint-plugin"
:
"^4.18.0"
,
...
...
web/src/views/admin/admin-doc.vue
浏览文件 @
8a52f5e2
...
...
@@ -4,23 +4,16 @@
:style=
"
{ background: '#fff', padding: '24px', margin: 0, minHeight: '280px' }"
>
<p>
<a-form
layout=
"inline"
:model=
"docQueryForm"
@
finish=
"handleQueryFormSubmit"
>
<a-form
layout=
"inline"
:model=
"docQueryForm"
>
<a-form-item>
<a-button
type=
"primary"
html-type=
"submit"
size=
"large"
>
<a-button
type=
"primary"
>
查询
</a-button>
</a-form-item>
<a-form-item>
<a-button
type=
"primary"
@
click=
"add()"
size=
"large"
>
新增
</a-button>
<a-button
type=
"primary"
@
click=
"add()"
>
新增
</a-button>
</a-form-item>
</a-form>
</p>
...
...
@@ -28,8 +21,8 @@
:columns=
"columns"
:row-key=
"record => record.id"
:data-source=
"level1"
:pagination=
"false"
:loading=
"loading"
:pagination=
"false"
>
<template
#cover
="
{ text: cover }">
<img
v-if=
"cover"
:src=
"cover"
alt=
"avatar"
/>
...
...
@@ -40,12 +33,14 @@
编辑
</a-button>
<a-popconfirm
title=
"
确认删除?
"
ok-text=
"
Yes
"
cancel-text=
"
No
"
title=
"
删除后不可恢复,确认删除?
"
ok-text=
"
是
"
cancel-text=
"
否
"
@
confirm=
"handleDeleteDoc(record.id)"
>
<a-button
type=
"danger"
>
删除
</a-button>
<a-button
type=
"danger"
>
删除
</a-button>
</a-popconfirm>
</a-space>
</
template
>
...
...
@@ -76,7 +71,10 @@
</a-tree-select>
</a-form-item>
<a-form-item
label=
"顺序"
>
<a-input
v-model:value=
"doc.sort"
type=
"textarea"
/>
<a-input
v-model:value=
"doc.sort"
/>
</a-form-item>
<a-form-item
label=
"内容"
>
<div
id=
"content"
></div>
</a-form-item>
</a-form>
</a-modal>
...
...
@@ -90,6 +88,7 @@ import ExclamationCircleOutlined from "@ant-design/icons-vue/ExclamationCircleOu
import
{
Tool
}
from
"
@/util/tool
"
;
import
{
Doc
,
DocQueryForm
}
from
"
@/models
"
;
import
{
useRoute
}
from
"
vue-router
"
;
import
E
from
'
wangeditor
'
;
...
...
@@ -178,6 +177,8 @@ export default defineComponent({
const
doc
=
ref
();
const
modalVisible
=
ref
(
false
);
const
modalLoading
=
ref
(
false
);
let
textEditor
:
E
;
const
handleModalOk
=
()
=>
{
modalLoading
.
value
=
true
;
axios
.
post
(
"
/doc/save
"
,
doc
.
value
).
then
((
response
)
=>
{
...
...
@@ -223,6 +224,16 @@ export default defineComponent({
}
};
/**
* 使用 textEditor 创建富文本编辑框
**/
function
createTextEditor
()
{
setTimeout
(
function
()
{
if
(
!
textEditor
)
textEditor
=
new
E
(
'
#content
'
);
textEditor
.
create
();
},
300
);
}
/**
* 编辑
...
...
@@ -237,6 +248,8 @@ export default defineComponent({
// 为选择树添加一个"无"
treeSelectData
.
value
.
unshift
({
id
:
0
,
name
:
'
无
'
});
// 创建富文本编辑框
createTextEditor
();
};
/**
...
...
@@ -251,6 +264,8 @@ export default defineComponent({
// 为选择树添加一个"无"
treeSelectData
.
value
.
unshift
({
id
:
0
,
name
:
'
无
'
});
// 创建富文本编辑框
createTextEditor
();
}
let
docIdListToDelete
:
Array
<
string
>
=
[];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录