Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yubinCloud
fairy-wiki
提交
501b84c2
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 搜索 >>
提交
501b84c2
编写于
4月 24, 2021
作者:
yubinCloud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8-11 增加读取文档内容的功能
上级
c55b2c98
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
0 deletion
+38
-0
src/main/java/io/github/yubincloud/fairywiki/controller/DocController.java
...github/yubincloud/fairywiki/controller/DocController.java
+11
-0
src/main/java/io/github/yubincloud/fairywiki/service/DocService.java
...va/io/github/yubincloud/fairywiki/service/DocService.java
+12
-0
web/src/views/admin/admin-doc.vue
web/src/views/admin/admin-doc.vue
+15
-0
未找到文件。
src/main/java/io/github/yubincloud/fairywiki/controller/DocController.java
浏览文件 @
501b84c2
...
@@ -55,4 +55,15 @@ public class DocController {
...
@@ -55,4 +55,15 @@ public class DocController {
docService
.
deleteDocs
(
docDeleteReqDto
.
getIds
());
docService
.
deleteDocs
(
docDeleteReqDto
.
getIds
());
return
new
RestfulModel
<>(
ErrorCode
.
SUCCESS
,
""
,
0
);
return
new
RestfulModel
<>(
ErrorCode
.
SUCCESS
,
""
,
0
);
}
}
/**
* 读取文档的内容
* @param docId 所要读取的文档的 id
* @return 读取到的内容
*/
@GetMapping
(
"/read-content/{docId}"
)
public
RestfulModel
<
String
>
readDocContent
(
@PathVariable
Long
docId
)
{
String
docContent
=
docService
.
readDocContent
(
docId
);
return
new
RestfulModel
<>(
0
,
""
,
docContent
);
}
}
}
src/main/java/io/github/yubincloud/fairywiki/service/DocService.java
浏览文件 @
501b84c2
...
@@ -103,4 +103,16 @@ public class DocService {
...
@@ -103,4 +103,16 @@ public class DocService {
criteria
.
andIdIn
(
idList
);
criteria
.
andIdIn
(
idList
);
docMapper
.
deleteByExample
(
docExample
);
docMapper
.
deleteByExample
(
docExample
);
}
}
/**
* 读取一篇文档的内容
* @param docId 所要读取的文档的id
* @return 该文档的内容
*/
public
String
readDocContent
(
Long
docId
)
{
Content
content
=
contentMapper
.
selectByPrimaryKey
(
docId
);
if
(
content
==
null
)
return
""
;
return
content
.
getContent
();
}
}
}
web/src/views/admin/admin-doc.vue
浏览文件 @
501b84c2
...
@@ -240,6 +240,20 @@ export default defineComponent({
...
@@ -240,6 +240,20 @@ export default defineComponent({
}
}
};
};
/**
* 内容查询
**/
const
handleQueryContent
=
()
=>
{
axios
.
get
(
"
/doc/read-content/
"
+
doc
.
value
.
id
).
then
((
response
)
=>
{
const
respData
=
response
.
data
;
if
(
respData
.
code
===
0
)
{
textEditor
.
txt
.
html
(
respData
.
data
);
}
else
{
message
.
error
(
respData
.
msg
);
}
});
};
/**
/**
* 编辑
* 编辑
...
@@ -247,6 +261,7 @@ export default defineComponent({
...
@@ -247,6 +261,7 @@ export default defineComponent({
const
edit
=
(
record
:
any
)
=>
{
const
edit
=
(
record
:
any
)
=>
{
modalVisible
.
value
=
true
;
modalVisible
.
value
=
true
;
doc
.
value
=
Tool
.
copy
(
record
);
doc
.
value
=
Tool
.
copy
(
record
);
handleQueryContent
();
// 不能选择当前节点及其所有子孙节点,作为父节点,会使树断开
// 不能选择当前节点及其所有子孙节点,作为父节点,会使树断开
treeSelectData
.
value
=
Tool
.
copy
(
level1
.
value
);
treeSelectData
.
value
=
Tool
.
copy
(
level1
.
value
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录