Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yubinCloud
fairy-wiki
提交
2a269a0a
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 搜索 >>
提交
2a269a0a
编写于
4月 23, 2021
作者:
yubinCloud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8-9 将文档内容变成左右布局,方便文档内容的编辑
上级
171c98a9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
83 addition
and
74 deletion
+83
-74
web/src/models.ts
web/src/models.ts
+1
-1
web/src/views/admin/admin-doc.vue
web/src/views/admin/admin-doc.vue
+82
-73
未找到文件。
web/src/models.ts
浏览文件 @
2a269a0a
...
@@ -43,7 +43,7 @@ export interface CategoryQueryForm {
...
@@ -43,7 +43,7 @@ export interface CategoryQueryForm {
*/
*/
export
interface
Doc
{
export
interface
Doc
{
id
:
string
;
id
:
string
;
ebookId
:
string
;
ebookId
:
string
|
null
;
parent
:
string
;
parent
:
string
;
name
:
string
;
name
:
string
;
sort
:
number
;
sort
:
number
;
...
...
web/src/views/admin/admin-doc.vue
浏览文件 @
2a269a0a
...
@@ -3,81 +3,89 @@
...
@@ -3,81 +3,89 @@
<a-layout-content
<a-layout-content
:style=
"
{ background: '#fff', padding: '24px', margin: 0, minHeight: '280px' }"
:style=
"
{ background: '#fff', padding: '24px', margin: 0, minHeight: '280px' }"
>
>
<p>
<a-row>
<a-form
layout=
"inline"
:model=
"docQueryForm"
>
<a-col
:span=
"8"
>
<a-form-item>
<p>
<a-button
type=
"primary"
>
<a-form
layout=
"inline"
:model=
"docQueryForm"
>
查询
<a-form-item>
</a-button>
<a-button
type=
"primary"
@
click=
"handleQueryFormSubmit"
>
</a-form-item>
查询
<a-form-item>
</a-button>
<a-button
type=
"primary"
@
click=
"add()"
>
</a-form-item>
新增
<a-form-item>
</a-button>
<a-button
type=
"primary"
@
click=
"add()"
>
</a-form-item>
新增
</a-form>
</a-button>
</p>
</a-form-item>
<a-table
</a-form>
:columns=
"columns"
</p>
:row-key=
"record => record.id"
<a-table
:data-source=
"level1"
:columns=
"columns"
:loading=
"loading"
:row-key=
"record => record.id"
:pagination=
"false"
:data-source=
"level1"
>
:loading=
"loading"
<template
#cover
="
{ text: cover }">
:pagination=
"false"
<img
v-if=
"cover"
:src=
"cover"
alt=
"avatar"
/>
>
</
template
>
<template
#cover
="
{ text: cover }">
<
template
v-slot:action=
"{ text, record }"
>
<img
v-if=
"cover"
:src=
"cover"
alt=
"avatar"
/>
<a-space
size=
"small"
>
</
template
>
<a-button
type=
"primary"
@
click=
"edit(record)"
>
<
template
v-slot:action=
"{ text, record }"
>
编辑
<a-space
size=
"small"
>
</a-button>
<a-button
type=
"primary"
@
click=
"edit(record)"
>
<a-popconfirm
编辑
title=
"删除后不可恢复,确认删除?"
</a-button>
ok-text=
"是"
<a-popconfirm
cancel-text=
"否"
title=
"删除后不可恢复,确认删除?"
@
confirm=
"handleDeleteDoc(record.id)"
ok-text=
"是"
>
cancel-text=
"否"
<a-button
type=
"danger"
>
@
confirm=
"handleDeleteDoc(record.id)"
删除
>
</a-button>
<a-button
type=
"danger"
>
</a-popconfirm>
删除
</a-space>
</a-button>
</
template
>
</a-popconfirm>
</a-table>
</a-space>
</
template
>
</a-table>
</a-col>
<a-col
:span=
"16"
>
<a-form
:model=
"doc"
:label-col=
"{ span: 6 }"
:wrapper-col=
"{ span: 18 }"
>
<a-form-item
label=
"名称"
>
<a-input
v-model:value=
"doc.name"
/>
</a-form-item>
<a-form-item
label=
"父文档"
>
<a-tree-select
v-model:value=
"doc.parent"
style=
"width: 100%"
:dropdown-style=
"{ maxHeight: '400px', overflow: 'auto' }"
:tree-data=
"treeSelectData"
placeholder=
"请选择父文档"
tree-default-expand-all
:replaceFields=
"{title: 'name', key: 'id', value: 'id'}"
>
</a-tree-select>
</a-form-item>
<a-form-item
label=
"顺序"
>
<a-input
v-model:value=
"doc.sort"
/>
</a-form-item>
<a-form-item
label=
"内容"
>
<div
id=
"content"
></div>
</a-form-item>
</a-form>
</a-col>
</a-row>
</a-layout-content>
</a-layout-content>
</a-layout>
</a-layout>
<a-modal
<!--<a-modal-->
title=
"文档表单"
<!-- title="文档表单"-->
v-model:visible=
"modalVisible"
<!-- v-model:visible="modalVisible"-->
:confirm-loading=
"modalLoading"
<!-- :confirm-loading="modalLoading"-->
@
ok=
"handleModalOk"
<!-- @ok="handleModalOk"-->
>
<!-->-->
<a-form
:model=
"doc"
:label-col=
"{ span: 6 }"
:wrapper-col=
"{ span: 18 }"
>
<!-- -->
<a-form-item
label=
"名称"
>
<!--</a-modal>-->
<a-input
v-model:value=
"doc.name"
/>
</a-form-item>
<a-form-item
label=
"父文档"
>
<a-tree-select
v-model:value=
"doc.parent"
style=
"width: 100%"
:dropdown-style=
"{ maxHeight: '400px', overflow: 'auto' }"
:tree-data=
"treeSelectData"
placeholder=
"请选择父文档"
tree-default-expand-all
:replaceFields=
"{title: 'name', key: 'id', value: 'id'}"
>
</a-tree-select>
</a-form-item>
<a-form-item
label=
"顺序"
>
<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>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
...
@@ -174,7 +182,7 @@ export default defineComponent({
...
@@ -174,7 +182,7 @@ export default defineComponent({
// -------- 表单 ---------
// -------- 表单 ---------
const
treeSelectData
=
ref
();
// 因为树选择组件的属性状态,会随当前编辑的节点而变化,所以单独声明一个响应式变量
const
treeSelectData
=
ref
();
// 因为树选择组件的属性状态,会随当前编辑的节点而变化,所以单独声明一个响应式变量
treeSelectData
.
value
=
[];
treeSelectData
.
value
=
[];
const
doc
=
ref
();
const
doc
=
ref
(
{}
);
const
modalVisible
=
ref
(
false
);
const
modalVisible
=
ref
(
false
);
const
modalLoading
=
ref
(
false
);
const
modalLoading
=
ref
(
false
);
let
textEditor
:
E
;
let
textEditor
:
E
;
...
@@ -257,6 +265,7 @@ export default defineComponent({
...
@@ -257,6 +265,7 @@ export default defineComponent({
*/
*/
const
add
=
()
=>
{
const
add
=
()
=>
{
modalVisible
.
value
=
true
;
modalVisible
.
value
=
true
;
let
ebookId
:
string
;
doc
.
value
=
{
doc
.
value
=
{
ebookId
:
route
.
query
.
ebookId
ebookId
:
route
.
query
.
ebookId
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录